diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80619fc..527d944 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,9 +27,6 @@ jobs: - name: 👕 Lint commit messages uses: wagoid/commitlint-github-action@v4 - - name: ▶️ Run flow-typed script - run: npm run flow-typed - - name: ▶️ Run build script run: npm run build diff --git a/.gitignore b/.gitignore index 27bda27..f89bdaa 100644 --- a/.gitignore +++ b/.gitignore @@ -46,9 +46,6 @@ jspm_packages # Yarn Integrity file .yarn-integrity -# Flow Typed -flow-typed - .idea .DS_Store diff --git a/flow-typed/npm/@commitlint/cli_vx.x.x.js b/flow-typed/npm/@commitlint/cli_vx.x.x.js new file mode 100644 index 0000000..a249cb3 --- /dev/null +++ b/flow-typed/npm/@commitlint/cli_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: ee51b512fb7939980610e35462569242 +// flow-typed version: <>/@commitlint/cli_v^16.2.1/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * '@commitlint/cli' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module '@commitlint/cli' { + declare module.exports: any; +} diff --git a/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js b/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js new file mode 100644 index 0000000..cde7c94 --- /dev/null +++ b/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: 57351b40a8359ae26879210465f6b9da +// flow-typed version: <>/@commitlint/config-conventional_v^16.2.1/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * '@commitlint/config-conventional' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module '@commitlint/config-conventional' { + declare module.exports: any; +} diff --git a/flow-typed/npm/@krakenjs/grumbler-scripts_vx.x.x.js b/flow-typed/npm/@krakenjs/grumbler-scripts_vx.x.x.js new file mode 100644 index 0000000..70d7df9 --- /dev/null +++ b/flow-typed/npm/@krakenjs/grumbler-scripts_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: f9d31b01ab7e20cccd0c7e6bc7415dc7 +// flow-typed version: <>/@krakenjs/grumbler-scripts_v^8.0.4/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * '@krakenjs/grumbler-scripts' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module '@krakenjs/grumbler-scripts' { + declare module.exports: any; +} diff --git a/flow-typed/npm/@octokit/rest_v18.x.x.js b/flow-typed/npm/@octokit/rest_v18.x.x.js new file mode 100644 index 0000000..62f6fd3 --- /dev/null +++ b/flow-typed/npm/@octokit/rest_v18.x.x.js @@ -0,0 +1,185 @@ +// flow-typed signature: 6103021a6389a42ea8b41c577b3f91b3 +// flow-typed version: 79dc43986b/@octokit/rest_v18.x.x/flow_>=v0.83.x + +declare module '@octokit/rest' { + /** + * Octokit-specific request options which are ignored for the actual request, but can be used by Octokit or plugins to manipulate how the request is sent or how a response is handled + */ + declare type RequestRequestOptions = {| + /** + * Node only. Useful for custom proxy, certificate, or dns lookup. + * + * @see https://nodejs.org/api/http.html#http_class_http_agent + */ + agent?: mixed, + /** + * Custom replacement for built-in fetch method. Useful for testing or request hooks. + */ + fetch?: any, + /** + * Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests. + */ + signal?: any, + /** + * Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead. + */ + timeout?: number, + [option: string]: any, + |}; + + declare class Octokit { + constructor(options?: {| + authStrategy?: any, + auth?: any, + userAgent?: string, + previews?: Array, + baseUrl?: string, + log?: {| + debug?: (message: string) => mixed; + info?: (message: string) => mixed; + warn?: (message: string) => mixed; + error?: (message: string) => mixed; + |}, + request?: RequestRequestOptions, + timeZone?: string, + [option: string]: any, + |}): this; + + static VERSION: string; + + actions: {| [key: string]: any |}, + activity: {| [key: string]: any |}, + apps: {| [key: string]: any |}, + auth: (...args: Array) => Promise<{| [key: string]: any |}>, + billing: {| [key: string]: any |}, + checks: {| [key: string]: any |}, + codeScanning: {| [key: string]: any |}, + codesOfConduct: {| [key: string]: any |}, + emojis: {| [key: string]: any |}, + enterpriseAdmin: {| [key: string]: any |}, + gists: {| [key: string]: any |}, + git: {| [key: string]: any |}, + gitignore: {| [key: string]: any |}, + graphql: (...args: Array) => any, + hook: (...args: Array) => any, + interactions: {| [key: string]: any |}, + issues: {| [key: string]: any |}, + licenses: {| [key: string]: any |}, + log:{| [key: string]: any |}, + markdown: {| [key: string]: any |}, + meta: {| [key: string]: any |}, + migrations: {| [key: string]: any |}, + orgs: {| [key: string]: any |}, + packages: {| [key: string]: any |}, + paginate: (...args: Array) => any, + projects: {| [key: string]: any |}, + pulls: {| [key: string]: any |}, + rateLimit: {| [key: string]: any |}, + reactions: {| [key: string]: any |}, + repos: { + getContent: ({| + owner: string, + repo: string, + path?: string, + ref?: string, + |}) => Promise<{| + headers: {| [key: string]: any |}, + status: number, + url: string, + data: Array<{| + download_url: any, + git_url: string, + html_url: string, + name: string, + path: string, + sha: string, + size: number, + type: string, + url: string, + _links: {| + git: string, + html: string, + self: string, + |} + |}>, + |}>, + /** + * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API. + * + * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + */ + listReleases: ({| + /** + * The account owner of the repository. The name is not case sensitive. + */ + owner: string, + /** + * The name of the repository. The name is not case sensitive. + */ + repo: string, + /** + * The number of results per page (max 100). + */ + page?: number, + /** + * Page number of the results to fetch. + */ + per_page?: number, + |}) => Promise<{| + headers: {| [key: string]: any |}, + status: number, + url: string, + data: Array<{| + url: string, + assets_url: string, + upload_url: string, + html_url: string, + id: number, + author: {| + login: string, + id: number, + node_id: string, + avatar_url: string, + gravatar_id: string, + url: string, + html_url: string, + followers_url: string, + following_url: string, + gists_url: string, + starred_url: string, + subscriptions_url: string, + organizations_url: string, + repos_url: string, + events_url: string, + received_events_url: string, + type: string, + site_admin: boolean, + |}, + node_id: string, + tag_name: string, + target_commitish: string, + name: any, + draft: boolean, + prerelease: boolean, + created_at: string, + published_at: string, + assets: Array, + tarball_url: string, + zipball_url: string, + body: string, + |}>, + |}>, + [key: string]: any, + }, + request: (...args: Array) => any, + rest: {| [key: string]: any |}, + search: {| [key: string]: any |}, + secretScanning: {| [key: string]: any |}, + teams: {| [key: string]: any |}, + users: {| [key: string]: any |}, + } + + declare module.exports: {| + Octokit: typeof Octokit, + |}; +} diff --git a/flow-typed/npm/colors_v1.x.x.js b/flow-typed/npm/colors_v1.x.x.js new file mode 100644 index 0000000..90c35c0 --- /dev/null +++ b/flow-typed/npm/colors_v1.x.x.js @@ -0,0 +1,90 @@ +// flow-typed signature: 6c56e55f6af24f47c33f50f10270785f +// flow-typed version: 590676b089/colors_v1.x.x/flow_>=v0.104.x + +declare module "colors" { + declare type Color = { + (text: string): string, + strip: Color, + stripColors: Color, + black: Color, + red: Color, + green: Color, + yellow: Color, + blue: Color, + magenta: Color, + cyan: Color, + white: Color, + gray: Color, + grey: Color, + bgBlack: Color, + bgRed: Color, + bgGreen: Color, + bgYellow: Color, + bgBlue: Color, + bgMagenta: Color, + bgCyan: Color, + bgWhite: Color, + reset: Color, + bold: Color, + dim: Color, + italic: Color, + underline: Color, + inverse: Color, + hidden: Color, + strikethrough: Color, + rainbow: Color, + zebra: Color, + america: Color, + trap: Color, + random: Color, + zalgo: Color, + ... + }; + + declare module.exports: { + enabled: boolean, + themes: {...}, + enable(): void, + disable(): void, + setTheme(theme: {...}): void, + strip: Color, + stripColors: Color, + black: Color, + red: Color, + green: Color, + yellow: Color, + blue: Color, + magenta: Color, + cyan: Color, + white: Color, + gray: Color, + grey: Color, + bgBlack: Color, + bgRed: Color, + bgGreen: Color, + bgYellow: Color, + bgBlue: Color, + bgMagenta: Color, + bgCyan: Color, + bgWhite: Color, + reset: Color, + bold: Color, + dim: Color, + italic: Color, + underline: Color, + inverse: Color, + hidden: Color, + strikethrough: Color, + rainbow: Color, + zebra: Color, + america: Color, + trap: Color, + random: Color, + zalgo: Color, + ... + }; +} + +declare module "colors/safe" { + declare module.exports: $Exports<"colors">; +} diff --git a/flow-typed/npm/cross-env_vx.x.x.js b/flow-typed/npm/cross-env_vx.x.x.js new file mode 100644 index 0000000..a559b85 --- /dev/null +++ b/flow-typed/npm/cross-env_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: 039eb7682e6f1879e2844cf344350b5c +// flow-typed version: <>/cross-env_v^7.0.3/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'cross-env' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'cross-env' { + declare module.exports: any; +} diff --git a/flow-typed/npm/flow-bin_v0.x.x.js b/flow-typed/npm/flow-bin_v0.x.x.js new file mode 100644 index 0000000..fda1f29 --- /dev/null +++ b/flow-typed/npm/flow-bin_v0.x.x.js @@ -0,0 +1,6 @@ +// flow-typed signature: 28fdff7f110e1c75efab63ff205dda30 +// flow-typed version: c6154227d1/flow-bin_v0.x.x/flow_>=v0.104.x + +declare module "flow-bin" { + declare module.exports: string; +} diff --git a/flow-typed/npm/fs-extra_v8.x.x.js b/flow-typed/npm/fs-extra_v8.x.x.js new file mode 100644 index 0000000..89f097a --- /dev/null +++ b/flow-typed/npm/fs-extra_v8.x.x.js @@ -0,0 +1,871 @@ +// flow-typed signature: beb4c73787fb04b445ce22aee439eed9 +// flow-typed version: d81afd5307/fs-extra_v8.x.x/flow_>=v0.104.x + +declare module "fs-extra" { + import type { Stats, ReadStream, WriteStream } from "fs"; + import typeof fsTypes from "fs"; + + declare type SymlinkType = "dir" | "file"; + declare type FsSymlinkType = "dir" | "file" | "junction"; + + declare type CopyFilterSync = (src: string, dest: string) => boolean; + declare type CopyFilterAsync = ( + src: string, + dest: string + ) => Promise; + + declare type CopyOptions = { + dereference?: boolean, + overwrite?: boolean, + preserveTimestamps?: boolean, + errorOnExist?: boolean, + recursive?: boolean, + ... + }; + + declare type CopyOptionsAync = CopyOptions & { filter?: CopyFilterSync | CopyFilterAsync, ... }; + + declare type CopyOptionsSync = CopyOptions & { filter?: CopyFilterSync, ... }; + + declare type MoveOptions = { + overwrite?: boolean, + limit?: number, + ... + }; + + declare type ReadOptions = { + throws?: boolean, + fs?: Object, + reviver?: any, + encoding?: string, + flag?: string, + ... + }; + + declare type WriteFileOptions = { + encoding?: string, + flag?: string, + mode?: number, + ... + }; + + declare type WriteOptions = WriteFileOptions & { + fs?: Object, + replacer?: any, + spaces?: number | string, + EOL?: string, + ... + }; + + declare type ReadResult = { + bytesRead: number, + buffer: Buffer, + ... + }; + + declare type WriteResult = { + bytesWritten: number, + buffer: Buffer, + ... + }; + + declare type ReadStreamOptions = { + bufferSize?: number, + encoding?: string, + fd?: number, + flags?: string, + mode?: number, + ... + } + + declare type WriteStreamOptions = { + encoding?: string, + flags?: string, + string?: string, + ... + } + + declare function copy( + src: string, + dest: string, + options?: CopyOptionsAync + ): Promise; + declare function copy( + src: string, + dest: string, + callback: (err: Error) => void + ): void; + declare function copy( + src: string, + dest: string, + options: CopyOptionsAync, + callback: (err: Error) => void + ): void; + declare function copySync( + src: string, + dest: string, + options?: CopyOptionsSync + ): void; + + declare function move( + src: string, + dest: string, + options?: MoveOptions + ): Promise; + declare function move( + src: string, + dest: string, + callback: (err: Error) => void + ): void; + declare function move( + src: string, + dest: string, + options: MoveOptions, + callback: (err: Error) => void + ): void; + declare function moveSync( + src: string, + dest: string, + options?: MoveOptions + ): void; + + declare function createFile(file: string): Promise; + declare function createFile( + file: string, + callback: (err: Error) => void + ): void; + declare function createFileSync(file: string): void; + declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; + declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; + + declare function ensureDir(path: string): Promise; + declare function ensureDir( + path: string, + callback: (err: Error) => void + ): void; + declare function ensureDirSync(path: string): void; + + declare function exists(path: string): Promise; + declare function exists(path: string, callback?: (exists: boolean) => void): void; + + declare function mkdirs(dir: string): Promise; + declare function mkdirs( + dir: string, + callback: (err: Error) => void + ): void; + declare function mkdirsSync(dir: string): void; + + declare function mkdirp(dir: string): Promise; + declare function mkdirp( + dir: string, + callback: (err: Error) => void + ): void; + declare function mkdirpSync(dir: string): void; + + declare function outputFile( + file: string, + data: any, + options?: WriteFileOptions | string + ): Promise; + declare function outputFile( + file: string, + data: any, + callback: (err: Error) => void + ): void; + declare function outputFile( + file: string, + data: any, + options: WriteFileOptions | string, + callback: (err: Error) => void + ): void; + declare function outputFileSync( + file: string, + data: any, + options?: WriteFileOptions | string + ): void; + + declare function readJson( + file: string, + options?: ReadOptions + ): Promise; + declare function readJson( + file: string, + callback: (err: Error, jsonObject: any) => void + ): void; + declare function readJson( + file: string, + options: ReadOptions, + callback: (err: Error, jsonObject: any) => void + ): void; + declare function readJSON( + file: string, + options?: ReadOptions + ): Promise; + declare function readJSON( + file: string, + callback: (err: Error, jsonObject: any) => void + ): void; + declare function readJSON( + file: string, + options: ReadOptions, + callback: (err: Error, jsonObject: any) => void + ): void; + + declare function readJsonSync( + file: string, + options?: ReadOptions + ): any; + declare function readJSONSync( + file: string, + options?: ReadOptions + ): any; + + declare function remove(dir: string): Promise; + declare function remove( + dir: string, + callback: (err: Error) => void + ): void; + declare function removeSync(dir: string): void; + + declare function outputJson( + file: string, + data: any, + options?: WriteOptions + ): Promise; + declare function outputJSON( + file: string, + data: any, + options?: WriteOptions + ): Promise; + declare function outputJson( + file: string, + data: any, + options: WriteOptions, + callback: (err: Error) => void + ): void; + declare function outputJSON( + file: string, + data: any, + options: WriteOptions, + callback: (err: Error) => void + ): void; + declare function outputJson( + file: string, + data: any, + callback: (err: Error) => void + ): void; + declare function outputJSON( + file: string, + data: any, + callback: (err: Error) => void + ): void; + declare function outputJsonSync( + file: string, + data: any, + options?: WriteOptions + ): void; + declare function outputJSONSync( + file: string, + data: any, + options?: WriteOptions + ): void; + + declare function writeJSON( + file: string, + object: any, + options?: WriteOptions + ): Promise; + declare function writeJSON( + file: string, + object: any, + callback: (err: Error) => void + ): void; + declare function writeJSON( + file: string, + object: any, + options: WriteOptions, + callback: (err: Error) => void + ): void; + declare function writeJson( + file: string, + object: any, + options?: WriteOptions + ): Promise; + declare function writeJson( + file: string, + object: any, + callback: (err: Error) => void + ): void; + declare function writeJson( + file: string, + object: any, + options: WriteOptions, + callback: (err: Error) => void + ): void; + + declare function writeJsonSync( + file: string, + object: any, + options?: WriteOptions + ): void; + declare function writeJSONSync( + file: string, + object: any, + options?: WriteOptions + ): void; + + declare function ensureFile(path: string): Promise; + declare function ensureFile( + path: string, + callback: (err: Error) => void + ): void; + declare function ensureFileSync(path: string): void; + + declare function ensureLink(src: string, dest: string): Promise; + declare function ensureLink( + src: string, + dest: string, + callback: (err: Error) => void + ): void; + declare function ensureLinkSync(src: string, dest: string): void; + + declare function ensureSymlink( + src: string, + dest: string, + type?: SymlinkType + ): Promise; + declare function ensureSymlink( + src: string, + dest: string, + type: SymlinkType, + callback: (err: Error) => void + ): void; + declare function ensureSymlink( + src: string, + dest: string, + callback: (err: Error) => void + ): void; + declare function ensureSymlinkSync( + src: string, + dest: string, + type?: SymlinkType + ): void; + + declare function emptyDir(path: string): Promise; + declare function emptyDir( + path: string, + callback: (err: Error) => void + ): void; + declare function emptyDirSync(path: string): void; + + declare function pathExists(path: string): Promise; + declare function pathExists( + path: string, + callback: (err: Error, exists: boolean) => void + ): void; + declare function pathExistsSync(path: string): boolean; + + declare function access( + path: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function access( + path: string | Buffer, + mode: number, + callback: (err: ErrnoError) => void + ): void; + declare function access( + path: string | Buffer, + mode?: number + ): Promise; + + declare function appendFile( + file: string | Buffer | number, + data: any, + options: { + encoding?: string, + mode?: number | string, + flag?: string, + ... + }, + callback: (err: ErrnoError) => void + ): void; + declare function appendFile( + file: string | Buffer | number, + data: any, + callback: (err: ErrnoError) => void + ): void; + declare function appendFile( + file: string | Buffer | number, + data: any, + options?: { + encoding?: string, + mode?: number | string, + flag?: string, + ... + } + ): Promise; + + declare function chmod( + path: string | Buffer, + mode: string | number, + callback: (err: ErrnoError) => void + ): void; + declare function chmod( + path: string | Buffer, + mode: string | number + ): Promise; + + declare function chown( + path: string | Buffer, + uid: number, + gid: number + ): Promise; + declare function chown( + path: string | Buffer, + uid: number, + gid: number, + callback: (err: ErrnoError) => void + ): void; + + declare function close( + fd: number, + callback: (err: ErrnoError) => void + ): void; + declare function close(fd: number): Promise; + + declare function fchmod( + fd: number, + mode: string | number, + callback: (err: ErrnoError) => void + ): void; + declare function fchmod( + fd: number, + mode: string | number + ): Promise; + + declare function fchown( + fd: number, + uid: number, + gid: number, + callback: (err: ErrnoError) => void + ): void; + declare function fchown( + fd: number, + uid: number, + gid: number + ): Promise; + + declare function fdatasync(fd: number, callback: () => void): void; + declare function fdatasync(fd: number): Promise; + + declare function fstat( + fd: number, + callback: (err: ErrnoError, stats: Stats) => any + ): void; + declare function fstat(fd: number): Promise; + + declare function fsync( + fd: number, + callback: (err: ErrnoError) => void + ): void; + declare function fsync(fd: number): Promise; + + declare function ftruncate( + fd: number, + callback: (err: ErrnoError) => void + ): void; + declare function ftruncate( + fd: number, + len: number, + callback: (err: ErrnoError) => void + ): void; + declare function ftruncate(fd: number, len?: number): Promise; + + declare function futimes( + fd: number, + atime: number, + mtime: number, + callback: (err: ErrnoError) => void + ): void; + declare function futimes( + fd: number, + atime: Date, + mtime: Date, + callback: (err: ErrnoError) => void + ): void; + declare function futimes( + fd: number, + atime: number, + mtime: number + ): Promise; + declare function futimes( + fd: number, + atime: Date, + mtime: Date + ): Promise; + + declare function lchown( + path: string | Buffer, + uid: number, + gid: number, + callback: (err: ErrnoError) => void + ): void; + declare function lchown( + path: string | Buffer, + uid: number, + gid: number + ): Promise; + + declare function link( + srcpath: string | Buffer, + dstpath: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function link( + srcpath: string | Buffer, + dstpath: string | Buffer + ): Promise; + + declare function lstat( + path: string | Buffer, + callback: (err: ErrnoError, stats: Stats) => any + ): void; + declare function lstat(path: string | Buffer): Promise; + + declare function mkdir( + path: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function mkdir( + path: string | Buffer, + mode: number | string, + callback: (err: ErrnoError) => void + ): void; + declare function mkdir(path: string | Buffer): Promise; + + declare function open( + path: string | Buffer, + flags: string | number, + callback: (err: ErrnoError, fd: number) => void + ): void; + declare function open( + path: string | Buffer, + flags: string | number, + mode: number, + callback: (err: ErrnoError, fd: number) => void + ): void; + declare function open( + path: string | Buffer, + flags: string | number, + mode?: number + ): Promise; + + declare function read( + fd: number, + buffer: Buffer, + offset: number, + length: number, + position: number | null, + callback: (err: ErrnoError, bytesRead: number, buffer: Buffer) => void + ): void; + declare function read( + fd: number, + buffer: Buffer, + offset: number, + length: number, + position: number | null + ): Promise; + + declare function readFile( + file: string | Buffer | number, + callback: (err: ErrnoError, data: Buffer) => void + ): void; + declare function readFile( + file: string | Buffer | number, + encoding: string, + callback: (err: ErrnoError, data: string) => void + ): void; + declare function readFile( + file: string | Buffer | number, + options: { flag?: string, ... } | { + encoding: string, + flag?: string, + ... + }, + callback: (err: ErrnoError, data: Buffer) => void + ): void; + declare function readFile( + file: string | Buffer | number, + options: { flag?: string, ... } | { + encoding: string, + flag?: string, + ... + }, + ): Promise; + declare function readFile( + file: string | Buffer | number, + encoding: string + ): Promise; + declare function readFile( + file: string | Buffer | number + ): Promise; + + declare function readdir( + path: string | Buffer, + callback: (err: ErrnoError, files: string[]) => void + ): void; + declare function readdir(path: string | Buffer): Promise; + + declare function readlink( + path: string | Buffer, + callback: (err: ErrnoError, linkString: string) => any + ): void; + declare function readlink(path: string | Buffer): Promise; + + declare function realpath( + path: string | Buffer, + callback: (err: ErrnoError, resolvedPath: string) => any + ): void; + declare function realpath( + path: string | Buffer, + cache: { [path: string]: string, ... }, + callback: (err: ErrnoError, resolvedPath: string) => any + ): void; + declare function realpath( + path: string | Buffer, + cache?: { [path: string]: string, ... } + ): Promise; + + declare function rename( + oldPath: string, + newPath: string, + callback: (err: ErrnoError) => void + ): void; + declare function rename( + oldPath: string, + newPath: string + ): Promise; + + declare function rmdir( + path: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function rmdir(path: string | Buffer): Promise; + + declare function stat( + path: string | Buffer, + callback: (err: ErrnoError, stats: Stats) => any + ): void; + declare function stat(path: string | Buffer): Promise; + + declare function statSync(path: string): Stats; + + declare function symlink( + srcpath: string | Buffer, + dstpath: string | Buffer, + type: FsSymlinkType | void, + callback: (err: ErrnoError) => void + ): void; + declare function symlink( + srcpath: string | Buffer, + dstpath: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function symlink( + srcpath: string | Buffer, + dstpath: string | Buffer, + type?: FsSymlinkType + ): Promise; + + declare function truncate( + path: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function truncate( + path: string | Buffer, + len: number, + callback: (err: ErrnoError) => void + ): void; + declare function truncate( + path: string | Buffer, + len?: number + ): Promise; + + declare function unlink( + path: string | Buffer, + callback: (err: ErrnoError) => void + ): void; + declare function unlink(path: string | Buffer): Promise; + + declare function utimes( + path: string | Buffer, + atime: number, + mtime: number, + callback: (err: ErrnoError) => void + ): void; + declare function utimes( + path: string | Buffer, + atime: Date, + mtime: Date, + callback: (err: ErrnoError) => void + ): void; + declare function utimes( + path: string | Buffer, + atime: number, + mtime: number + ): Promise; + declare function utimes( + path: string | Buffer, + atime: Date, + mtime: Date + ): Promise; + + declare function write( + fd: number, + buffer: Buffer, + offset: number, + length: number, + position: number | null, + callback: (err: ErrnoError, written: number, buffer: Buffer) => void + ): void; + declare function write( + fd: number, + buffer: Buffer, + offset: number, + length: number, + callback: (err: ErrnoError, written: number, buffer: Buffer) => void + ): void; + declare function write( + fd: number, + data: any, + callback: (err: ErrnoError, written: number, str: string) => void + ): void; + declare function write( + fd: number, + data: any, + offset: number, + callback: (err: ErrnoError, written: number, str: string) => void + ): void; + declare function write( + fd: number, + data: any, + offset: number, + encoding: string, + callback: (err: ErrnoError, written: number, str: string) => void + ): void; + declare function write( + fd: number, + buffer: Buffer, + offset: number, + length: number, + position?: number | null + ): Promise; + declare function write( + fd: number, + data: any, + offset: number, + encoding?: string + ): Promise; + + declare function writeFile( + file: string | Buffer | number, + data: any, + callback: (err: ErrnoError) => void + ): void; + declare function writeFile( + file: string | Buffer | number, + data: any, + options?: WriteFileOptions | string + ): Promise; + declare function writeFile( + file: string | Buffer | number, + data: any, + options: WriteFileOptions | string, + callback: (err: ErrnoError) => void + ): void; + + declare function mkdtemp(prefix: string): Promise; + declare function mkdtemp( + prefix: string, + callback: (err: ErrnoError, folder: string) => void + ): void; + + declare module.exports: {| + ...fsTypes; + access: typeof access; + appendFile: typeof appendFile; + chmod: typeof chmod; + chown: typeof chown; + close: typeof close; + copy: typeof copy; + copySync: typeof copySync; + createFile: typeof createFile; + createFileSync: typeof createFileSync; + createReadStream: typeof createReadStream; + createWriteStream: typeof createWriteStream; + emptyDir: typeof emptyDir; + emptyDirSync: typeof emptyDirSync; + ensureDir: typeof ensureDir; + ensureDirSync: typeof ensureDirSync; + ensureFile: typeof ensureFile; + ensureFileSync: typeof ensureFileSync; + ensureLink: typeof ensureLink; + ensureLinkSync: typeof ensureLinkSync; + ensureSymlink: typeof ensureSymlink; + ensureSymlinkSync: typeof ensureSymlinkSync; + exists: typeof exists; + fchmod: typeof fchmod; + fchown: typeof fchown; + fdatasync: typeof fdatasync; + fstat: typeof fstat; + fsync: typeof fsync; + ftruncate: typeof ftruncate; + futimes: typeof futimes; + lchown: typeof lchown; + link: typeof link; + lstat: typeof lstat; + mkdir: typeof mkdir; + mkdirp: typeof mkdirp; + mkdirpSync: typeof mkdirpSync; + mkdirs: typeof mkdirs; + mkdirsSync: typeof mkdirsSync; + mkdtemp: typeof mkdtemp; + move: typeof move; + moveSync: typeof moveSync; + open: typeof open; + outputFile: typeof outputFile; + outputFileSync: typeof outputFileSync; + outputJson: typeof outputJson; + outputJSON: typeof outputJSON; + outputJsonSync: typeof outputJsonSync; + outputJSONSync: typeof outputJSONSync; + pathExists: typeof pathExists; + pathExistsSync: typeof pathExistsSync; + read: typeof read; + readdir: typeof readdir; + readFile: typeof readFile; + readJson: typeof readJson; + readJSON: typeof readJSON; + readJsonSync: typeof readJsonSync; + readJSONSync: typeof readJSONSync; + readlink: typeof readlink; + realpath: typeof realpath; + remove: typeof remove; + removeSync: typeof removeSync; + rename: typeof rename; + rmdir: typeof rmdir; + stat: typeof stat; + statSync: typeof statSync; + symlink: typeof symlink; + truncate: typeof truncate; + unlink: typeof unlink; + utimes: typeof utimes; + write: typeof write; + writeFile: typeof writeFile; + writeJSON: typeof writeJSON; + writeJson: typeof writeJson; + writeJsonSync: typeof writeJsonSync; + writeJSONSync: typeof writeJSONSync; + |}; +} diff --git a/flow-typed/npm/glob_v7.x.x.js b/flow-typed/npm/glob_v7.x.x.js new file mode 100644 index 0000000..4bd3df6 --- /dev/null +++ b/flow-typed/npm/glob_v7.x.x.js @@ -0,0 +1,79 @@ +// flow-typed signature: d2a519d7d007e9ba3e5bf2ac3ff76eca +// flow-typed version: f243e51ed7/glob_v7.x.x/flow_>=v0.104.x + +declare module "glob" { + declare type MinimatchOptions = {| + debug?: boolean, + nobrace?: boolean, + noglobstar?: boolean, + dot?: boolean, + noext?: boolean, + nocase?: boolean, + nonull?: boolean, + matchBase?: boolean, + nocomment?: boolean, + nonegate?: boolean, + flipNegate?: boolean + |}; + + declare type Options = {| + ...MinimatchOptions, + cwd?: string, + root?: string, + nomount?: boolean, + mark?: boolean, + nosort?: boolean, + stat?: boolean, + silent?: boolean, + strict?: boolean, + cache?: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }, + statCache?: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }, + symlinks?: { [path: string]: boolean | void, ... }, + realpathCache?: { [path: string]: string, ... }, + sync?: boolean, + nounique?: boolean, + nodir?: boolean, + ignore?: string | $ReadOnlyArray, + follow?: boolean, + realpath?: boolean, + absolute?: boolean + |}; + + /** + * Called when an error occurs, or matches are found + * err + * matches: filenames found matching the pattern + */ + declare type CallBack = (err: ?Error, matches: Array) => void; + + declare class Glob extends events$EventEmitter { + constructor(pattern: string): this; + constructor(pattern: string, callback: CallBack): this; + constructor(pattern: string, options: Options, callback: CallBack): this; + + minimatch: {...}; + options: Options; + aborted: boolean; + cache: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }; + statCache: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }; + symlinks: { [path: string]: boolean | void, ... }; + realpathCache: { [path: string]: string, ... }; + found: Array; + + pause(): void; + resume(): void; + abort(): void; + } + + declare class GlobModule { + Glob: Class; + + (pattern: string, callback: CallBack): void; + (pattern: string, options: Options, callback: CallBack): void; + + hasMagic(pattern: string, options?: Options): boolean; + sync(pattern: string, options?: Options): Array; + } + + declare module.exports: GlobModule; +} diff --git a/flow-typed/npm/husky_vx.x.x.js b/flow-typed/npm/husky_vx.x.x.js new file mode 100644 index 0000000..88b2a4b --- /dev/null +++ b/flow-typed/npm/husky_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: 3f15389d4b64e16afbe5b322b0784ed7 +// flow-typed version: <>/husky_v^7.0.4/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'husky' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'husky' { + declare module.exports: any; +} diff --git a/flow-typed/npm/jest_v29.x.x.js b/flow-typed/npm/jest_v29.x.x.js new file mode 100644 index 0000000..37c2cf4 --- /dev/null +++ b/flow-typed/npm/jest_v29.x.x.js @@ -0,0 +1,1267 @@ +// flow-typed signature: 0e64c840aab684c37415b655ddbf8ce1 +// flow-typed version: 02d4f1d2c5/jest_v29.x.x/flow_>=v0.134.x <=v0.200.x + +type JestMockFn, TReturn> = { + (...args: TArguments): TReturn, + /** + * An object for introspecting mock calls + */ + mock: { + /** + * An array that represents all calls that have been made into this mock + * function. Each call is represented by an array of arguments that were + * passed during the call. + */ + calls: Array, + /** + * An array containing the call arguments of the last call that was made + * to this mock function. If the function was not called, it will return + * undefined. + */ + lastCall: TArguments, + /** + * An array that contains all the object instances that have been + * instantiated from this mock function. + */ + instances: Array, + /** + * An array that contains all the object results that have been + * returned by this mock function call + */ + results: Array<{ + isThrow: boolean, + value: TReturn, + ... + }>, + ... + }, + /** + * Resets all information stored in the mockFn.mock.calls and + * mockFn.mock.instances arrays. Often this is useful when you want to clean + * up a mock's usage data between two assertions. + */ + mockClear(): void, + /** + * Resets all information stored in the mock. This is useful when you want to + * completely restore a mock back to its initial state. + */ + mockReset(): void, + /** + * Removes the mock and restores the initial implementation. This is useful + * when you want to mock functions in certain test cases and restore the + * original implementation in others. Beware that mockFn.mockRestore only + * works when mock was created with jest.spyOn. Thus you have to take care of + * restoration yourself when manually assigning jest.fn(). + */ + mockRestore(): void, + /** + * Accepts a function that should be used as the implementation of the mock. + * The mock itself will still record all calls that go into and instances + * that come from itself -- the only difference is that the implementation + * will also be executed when the mock is called. + */ + mockImplementation( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a function that will be used as an implementation of the mock for + * one call to the mocked function. Can be chained so that multiple function + * calls produce different results. + */ + mockImplementationOnce( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a string to use in test result output in place of "jest.fn()" to + * indicate which mock function is being referenced. + */ + mockName(name: string): JestMockFn, + /** + * Just a simple sugar function for returning `this` + */ + mockReturnThis(): void, + /** + * Accepts a value that will be returned whenever the mock function is called. + */ + mockReturnValue(value: TReturn): JestMockFn, + /** + * Sugar for only returning a value once inside your mock + */ + mockReturnValueOnce(value: TReturn): JestMockFn, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value)) + */ + mockResolvedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value)) + */ + mockResolvedValueOnce( + value: TReturn + ): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.reject(value)) + */ + mockRejectedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value)) + */ + mockRejectedValueOnce(value: TReturn): JestMockFn>, + ... +}; + +type JestAsymmetricEqualityType = { + /** + * A custom Jasmine equality tester + */ + asymmetricMatch(value: mixed): boolean, + ... +}; + +type JestCallsType = { + allArgs(): mixed, + all(): mixed, + any(): boolean, + count(): number, + first(): mixed, + mostRecent(): mixed, + reset(): void, + ... +}; + +type JestClockType = { + install(): void, + mockDate(date: Date): void, + tick(milliseconds?: number): void, + uninstall(): void, + ... +}; + +type JestMatcherResult = { + message?: string | (() => string), + pass: boolean, + ... +}; + +type JestMatcher = ( + received: any, + ...actual: Array +) => JestMatcherResult | Promise; + +type JestPromiseType = { + /** + * Use rejects to unwrap the reason of a rejected promise so any other + * matcher can be chained. If the promise is fulfilled the assertion fails. + */ + rejects: JestExpectType, + /** + * Use resolves to unwrap the value of a fulfilled promise so any other + * matcher can be chained. If the promise is rejected the assertion fails. + */ + resolves: JestExpectType, + ... +}; + +/** + * Jest allows functions and classes to be used as test names in test() and + * describe() + */ +type JestTestName = string | Function; + +type FakeableAPI = + | 'Date' + | 'hrtime' + | 'nextTick' + | 'performance' + | 'queueMicrotask' + | 'requestAnimationFrame' + | 'cancelAnimationFrame' + | 'requestIdleCallback' + | 'cancelIdleCallback' + | 'setImmediate' + | 'clearImmediate' + | 'setInterval' + | 'clearInterval' + | 'setTimeout' + | 'clearTimeout'; + +type FakeTimersConfig = { + advanceTimers?: boolean | number, + doNotFake?: Array, + now?: number | Date, + timerLimit?: number, + legacyFakeTimers?: boolean, + ... +}; + +/** + * Plugin: jest-styled-components + */ + +type JestStyledComponentsMatcherValue = + | string + | JestAsymmetricEqualityType + | RegExp + | typeof undefined; + +type JestStyledComponentsMatcherOptions = { + media?: string, + modifier?: string, + supports?: string, + ... +}; + +type JestStyledComponentsMatchersType = { + toHaveStyleRule( + property: string, + value: JestStyledComponentsMatcherValue, + options?: JestStyledComponentsMatcherOptions + ): void, + ... +}; + +/** + * Plugin: jest-enzyme + */ +type EnzymeMatchersType = { + // 5.x + toBeEmpty(): void, + toBePresent(): void, + // 6.x + toBeChecked(): void, + toBeDisabled(): void, + toBeEmptyRender(): void, + toContainMatchingElement(selector: string): void, + toContainMatchingElements(n: number, selector: string): void, + toContainExactlyOneMatchingElement(selector: string): void, + toContainReact(element: React$Element): void, + toExist(): void, + toHaveClassName(className: string): void, + toHaveHTML(html: string): void, + toHaveProp: ((propKey: string, propValue?: any) => void) & + ((props: { ... }) => void), + toHaveRef(refName: string): void, + toHaveState: ((stateKey: string, stateValue?: any) => void) & + ((state: { ... }) => void), + toHaveStyle: ((styleKey: string, styleValue?: any) => void) & + ((style: { ... }) => void), + toHaveTagName(tagName: string): void, + toHaveText(text: string): void, + toHaveValue(value: any): void, + toIncludeText(text: string): void, + toMatchElement( + element: React$Element, + options?: {| ignoreProps?: boolean, verbose?: boolean |} + ): void, + toMatchSelector(selector: string): void, + // 7.x + toHaveDisplayName(name: string): void, + ... +}; + +// DOM testing library extensions (jest-dom) +// https://github.com/testing-library/jest-dom +type DomTestingLibraryType = { + /** + * @deprecated + */ + toBeInTheDOM(container?: HTMLElement): void, + + // 4.x + toBeInTheDocument(): void, + toBeVisible(): void, + toBeEmpty(): void, + toBeDisabled(): void, + toBeEnabled(): void, + toBeInvalid(): void, + toBeRequired(): void, + toBeValid(): void, + toContainElement(element: HTMLElement | null): void, + toContainHTML(htmlText: string): void, + toHaveAttribute(attr: string, value?: any): void, + toHaveClass(...classNames: string[]): void, + toHaveFocus(): void, + toHaveFormValues(expectedValues: { [name: string]: any, ... }): void, + toHaveStyle(css: string | { [name: string]: any, ... }): void, + toHaveTextContent( + text: string | RegExp, + options?: {| normalizeWhitespace: boolean |} + ): void, + toHaveValue(value?: string | string[] | number): void, + + // 5.x + toHaveDisplayValue(value: string | string[]): void, + toBeChecked(): void, + toBeEmptyDOMElement(): void, + toBePartiallyChecked(): void, + toHaveDescription(text: string | RegExp): void, + ... +}; + +// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers +type JestJQueryMatchersType = { + toExist(): void, + toHaveLength(len: number): void, + toHaveId(id: string): void, + toHaveClass(className: string): void, + toHaveTag(tag: string): void, + toHaveAttr(key: string, val?: any): void, + toHaveProp(key: string, val?: any): void, + toHaveText(text: string | RegExp): void, + toHaveData(key: string, val?: any): void, + toHaveValue(val: any): void, + toHaveCss(css: { [key: string]: any, ... }): void, + toBeChecked(): void, + toBeDisabled(): void, + toBeEmpty(): void, + toBeHidden(): void, + toBeSelected(): void, + toBeVisible(): void, + toBeFocused(): void, + toBeInDom(): void, + toBeMatchedBy(sel: string): void, + toHaveDescendant(sel: string): void, + toHaveDescendantWithText(sel: string, text: string | RegExp): void, + ... +}; + +// Jest Extended Matchers: https://github.com/jest-community/jest-extended +type JestExtendedMatchersType = { + /** + * Note: Currently unimplemented + * Passing assertion + * + * @param {String} message + */ + // pass(message: string): void; + + /** + * Note: Currently unimplemented + * Failing assertion + * + * @param {String} message + */ + // fail(message: string): void; + + /** + * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty. + */ + toBeEmpty(): void, + /** + * Use .toBeOneOf when checking if a value is a member of a given Array. + * @param {Array.<*>} members + */ + toBeOneOf(members: any[]): void, + /** + * Use `.toBeNil` when checking a value is `null` or `undefined`. + */ + toBeNil(): void, + /** + * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`. + * @param {Function} predicate + */ + toSatisfy(predicate: (n: any) => boolean): void, + /** + * Use `.toBeArray` when checking if a value is an `Array`. + */ + toBeArray(): void, + /** + * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x. + * @param {Number} x + */ + toBeArrayOfSize(x: number): void, + /** + * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set. + * @param {Array.<*>} members + */ + toIncludeAllMembers(members: any[]): void, + /** + * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set. + * @param {Array.<*>} members + */ + toIncludeAnyMembers(members: any[]): void, + /** + * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array. + * @param {Function} predicate + */ + toSatisfyAll(predicate: (n: any) => boolean): void, + /** + * Use `.toBeBoolean` when checking if a value is a `Boolean`. + */ + toBeBoolean(): void, + /** + * Use `.toBeTrue` when checking a value is equal (===) to `true`. + */ + toBeTrue(): void, + /** + * Use `.toBeFalse` when checking a value is equal (===) to `false`. + */ + toBeFalse(): void, + /** + * Use .toBeDate when checking if a value is a Date. + */ + toBeDate(): void, + /** + * Use `.toBeFunction` when checking if a value is a `Function`. + */ + toBeFunction(): void, + /** + * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. + * + * Note: Required Jest version >22 + * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same + * + * @param {Mock} mock + */ + toHaveBeenCalledBefore(mock: JestMockFn): void, + /** + * Use `.toBeNumber` when checking if a value is a `Number`. + */ + toBeNumber(): void, + /** + * Use `.toBeNaN` when checking a value is `NaN`. + */ + toBeNaN(): void, + /** + * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`. + */ + toBeFinite(): void, + /** + * Use `.toBePositive` when checking if a value is a positive `Number`. + */ + toBePositive(): void, + /** + * Use `.toBeNegative` when checking if a value is a negative `Number`. + */ + toBeNegative(): void, + /** + * Use `.toBeEven` when checking if a value is an even `Number`. + */ + toBeEven(): void, + /** + * Use `.toBeOdd` when checking if a value is an odd `Number`. + */ + toBeOdd(): void, + /** + * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive). + * + * @param {Number} start + * @param {Number} end + */ + toBeWithin(start: number, end: number): void, + /** + * Use `.toBeObject` when checking if a value is an `Object`. + */ + toBeObject(): void, + /** + * Use `.toContainKey` when checking if an object contains the provided key. + * + * @param {String} key + */ + toContainKey(key: string): void, + /** + * Use `.toContainKeys` when checking if an object has all of the provided keys. + * + * @param {Array.} keys + */ + toContainKeys(keys: string[]): void, + /** + * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys. + * + * @param {Array.} keys + */ + toContainAllKeys(keys: string[]): void, + /** + * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys. + * + * @param {Array.} keys + */ + toContainAnyKeys(keys: string[]): void, + /** + * Use `.toContainValue` when checking if an object contains the provided value. + * + * @param {*} value + */ + toContainValue(value: any): void, + /** + * Use `.toContainValues` when checking if an object contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainValues(values: any[]): void, + /** + * Use `.toContainAllValues` when checking if an object only contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainAllValues(values: any[]): void, + /** + * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values. + * + * @param {Array.<*>} values + */ + toContainAnyValues(values: any[]): void, + /** + * Use `.toContainEntry` when checking if an object contains the provided entry. + * + * @param {Array.} entry + */ + toContainEntry(entry: [string, string]): void, + /** + * Use `.toContainEntries` when checking if an object contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainEntries(entries: [string, string][]): void, + /** + * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainAllEntries(entries: [string, string][]): void, + /** + * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries. + * + * @param {Array.>} entries + */ + toContainAnyEntries(entries: [string, string][]): void, + /** + * Use `.toBeExtensible` when checking if an object is extensible. + */ + toBeExtensible(): void, + /** + * Use `.toBeFrozen` when checking if an object is frozen. + */ + toBeFrozen(): void, + /** + * Use `.toBeSealed` when checking if an object is sealed. + */ + toBeSealed(): void, + /** + * Use `.toBeString` when checking if a value is a `String`. + */ + toBeString(): void, + /** + * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings. + * + * @param {String} string + */ + toEqualCaseInsensitive(string: string): void, + /** + * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix. + * + * @param {String} prefix + */ + toStartWith(prefix: string): void, + /** + * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix. + * + * @param {String} suffix + */ + toEndWith(suffix: string): void, + /** + * Use `.toInclude` when checking if a `String` includes the given `String` substring. + * + * @param {String} substring + */ + toInclude(substring: string): void, + /** + * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times. + * + * @param {String} substring + * @param {Number} times + */ + toIncludeRepeated(substring: string, times: number): void, + /** + * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings. + * + * @param {Array.} substring + */ + toIncludeMultiple(substring: string[]): void, + ... +}; + +// Diffing snapshot utility for Jest (snapshot-diff) +// https://github.com/jest-community/snapshot-diff +type SnapshotDiffType = { + /** + * Compare the difference between the actual in the `expect()` + * vs the object inside `valueB` with some extra options. + */ + toMatchDiffSnapshot( + valueB: any, + options?: {| + expand?: boolean, + colors?: boolean, + contextLines?: number, + stablePatchmarks?: boolean, + aAnnotation?: string, + bAnnotation?: string, + |}, + testName?: string + ): void, + ... +}; + +interface JestExpectType { + not: JestExpectType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType & + SnapshotDiffType; + /** + * If you have a mock function, you can use .lastCalledWith to test what + * arguments it was last called with. + */ + lastCalledWith(...args: Array): void; + /** + * toBe just checks that a value is what you expect. It uses === to check + * strict equality. + */ + toBe(value: any): void; + /** + * Use .toBeCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toBeCalledWith(...args: Array): void; + /** + * Using exact equality with floating point numbers is a bad idea. Rounding + * means that intuitive things fail. + */ + toBeCloseTo(num: number, delta: any): void; + /** + * Use .toBeDefined to check that a variable is not undefined. + */ + toBeDefined(): void; + /** + * Use .toBeFalsy when you don't care what a value is, you just want to + * ensure a value is false in a boolean context. + */ + toBeFalsy(): void; + /** + * To compare floating point numbers, you can use toBeGreaterThan. + */ + toBeGreaterThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeGreaterThanOrEqual. + */ + toBeGreaterThanOrEqual(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThan. + */ + toBeLessThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThanOrEqual. + */ + toBeLessThanOrEqual(number: number): void; + /** + * Use .toBeInstanceOf(Class) to check that an object is an instance of a + * class. + */ + toBeInstanceOf(cls: Class<*>): void; + /** + * .toBeNull() is the same as .toBe(null) but the error messages are a bit + * nicer. + */ + toBeNull(): void; + /** + * Use .toBeTruthy when you don't care what a value is, you just want to + * ensure a value is true in a boolean context. + */ + toBeTruthy(): void; + /** + * Use .toBeUndefined to check that a variable is undefined. + */ + toBeUndefined(): void; + /** + * Use .toContain when you want to check that an item is in a list. For + * testing the items in the list, this uses ===, a strict equality check. + */ + toContain(item: any): void; + /** + * Use .toContainEqual when you want to check that an item is in a list. For + * testing the items in the list, this matcher recursively checks the + * equality of all fields, rather than checking for object identity. + */ + toContainEqual(item: any): void; + /** + * Use .toEqual when you want to check that two objects have the same value. + * This matcher recursively checks the equality of all fields, rather than + * checking for object identity. + */ + toEqual(value: any): void; + /** + * Use .toHaveBeenCalled to ensure that a mock function got called. + */ + toHaveBeenCalled(): void; + toBeCalled(): void; + /** + * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact + * number of times. + */ + toHaveBeenCalledTimes(number: number): void; + toBeCalledTimes(number: number): void; + /** + * + */ + toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void; + nthCalledWith(nthCall: number, ...args: Array): void; + /** + * + */ + toHaveReturned(): void; + toReturn(): void; + /** + * + */ + toHaveReturnedTimes(number: number): void; + toReturnTimes(number: number): void; + /** + * + */ + toHaveReturnedWith(value: any): void; + toReturnWith(value: any): void; + /** + * + */ + toHaveLastReturnedWith(value: any): void; + lastReturnedWith(value: any): void; + /** + * + */ + toHaveNthReturnedWith(nthCall: number, value: any): void; + nthReturnedWith(nthCall: number, value: any): void; + /** + * Use .toHaveBeenCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toHaveBeenCalledWith(...args: Array): void; + toBeCalledWith(...args: Array): void; + /** + * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called + * with specific arguments. + */ + toHaveBeenLastCalledWith(...args: Array): void; + lastCalledWith(...args: Array): void; + /** + * Check that an object has a .length property and it is set to a certain + * numeric value. + */ + toHaveLength(number: number): void; + /** + * + */ + toHaveProperty(propPath: string | $ReadOnlyArray, value?: any): void; + /** + * Use .toMatch to check that a string matches a regular expression or string. + */ + toMatch(regexpOrString: RegExp | string): void; + /** + * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. + */ + toMatchObject(object: Object | Array): void; + /** + * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object. + */ + toStrictEqual(value: any): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(propertyMatchers?: any, name?: string): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(name: string): void; + + toMatchInlineSnapshot(snapshot?: string): void; + toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void; + /** + * Use .toThrow to test that a function throws when it is called. + * If you want to test that a specific error gets thrown, you can provide an + * argument to toThrow. The argument can be a string for the error message, + * a class for the error, or a regex that should match the error. + * + * Alias: .toThrowError + */ + toThrow(message?: string | Error | Class | RegExp): void; + toThrowError(message?: string | Error | Class | RegExp): void; + /** + * Use .toThrowErrorMatchingSnapshot to test that a function throws a error + * matching the most recent snapshot when it is called. + */ + toThrowErrorMatchingSnapshot(): void; + toThrowErrorMatchingInlineSnapshot(snapshot?: string): void; +} + +type JestObjectType = { + /** + * Disables automatic mocking in the module loader. + * + * After this method is called, all `require()`s will return the real + * versions of each module (rather than a mocked version). + */ + disableAutomock(): JestObjectType, + /** + * An un-hoisted version of disableAutomock + */ + autoMockOff(): JestObjectType, + /** + * Enables automatic mocking in the module loader. + */ + enableAutomock(): JestObjectType, + /** + * An un-hoisted version of enableAutomock + */ + autoMockOn(): JestObjectType, + /** + * Clears the mock.calls and mock.instances properties of all mocks. + * Equivalent to calling .mockClear() on every mocked function. + */ + clearAllMocks(): JestObjectType, + /** + * Resets the state of all mocks. Equivalent to calling .mockReset() on every + * mocked function. + */ + resetAllMocks(): JestObjectType, + /** + * Restores all mocks back to their original value. + */ + restoreAllMocks(): JestObjectType, + /** + * Removes any pending timers from the timer system. + */ + clearAllTimers(): void, + /** + * Returns the number of fake timers still left to run. + */ + getTimerCount(): number, + /** + * Set the current system time used by fake timers. + * Simulates a user changing the system clock while your program is running. + * It affects the current time but it does not in itself cause + * e.g. timers to fire; they will fire exactly as they would have done + * without the call to jest.setSystemTime(). + */ + setSystemTime(now?: number | Date): void, + /** + * The same as `mock` but not moved to the top of the expectation by + * babel-jest. + */ + doMock(moduleName: string, moduleFactory?: any): JestObjectType, + /** + * The same as `unmock` but not moved to the top of the expectation by + * babel-jest. + */ + dontMock(moduleName: string): JestObjectType, + /** + * Returns a new, unused mock function. Optionally takes a mock + * implementation. + */ + fn, TReturn>( + implementation?: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Determines if the given function is a mocked function. + */ + isMockFunction(fn: Function): boolean, + /** + * Alias of `createMockFromModule`. + */ + genMockFromModule(moduleName: string): any, + /** + * Given the name of a module, use the automatic mocking system to generate a + * mocked version of the module for you. + */ + createMockFromModule(moduleName: string): any, + /** + * Mocks a module with an auto-mocked version when it is being required. + * + * The second argument can be used to specify an explicit module factory that + * is being run instead of using Jest's automocking feature. + * + * The third argument can be used to create virtual mocks -- mocks of modules + * that don't exist anywhere in the system. + */ + mock( + moduleName: string, + moduleFactory?: any, + options?: Object + ): JestObjectType, + /** + * Returns the actual module instead of a mock, bypassing all checks on + * whether the module should receive a mock implementation or not. + */ + requireActual(m: $Flow$ModuleRef | string): T, + /** + * Returns a mock module instead of the actual module, bypassing all checks + * on whether the module should be required normally or not. + */ + requireMock(moduleName: string): any, + /** + * Resets the module registry - the cache of all required modules. This is + * useful to isolate modules where local state might conflict between tests. + */ + resetModules(): JestObjectType, + /** + * Creates a sandbox registry for the modules that are loaded inside the + * callback function. This is useful to isolate specific modules for every + * test so that local module state doesn't conflict between tests. + */ + isolateModules(fn: () => void): JestObjectType, + /** + * Exhausts the micro-task queue (usually interfaced in node via + * process.nextTick). + */ + runAllTicks(): void, + /** + * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), + * setInterval(), and setImmediate()). + */ + runAllTimers(): void, + /** + * Exhausts all tasks queued by setImmediate(). + */ + runAllImmediates(): void, + /** + * Executes only the macro task queue (i.e. all tasks queued by setTimeout() + * or setInterval() and setImmediate()). + */ + advanceTimersByTime(msToRun: number): void, + /** + * Executes only the macro-tasks that are currently pending (i.e., only the + * tasks that have been queued by setTimeout() or setInterval() up to this + * point) + */ + runOnlyPendingTimers(): void, + /** + * Explicitly supplies the mock object that the module system should return + * for the specified module. Note: It is recommended to use jest.mock() + * instead. + */ + setMock(moduleName: string, moduleExports: any): JestObjectType, + /** + * Indicates that the module system should never return a mocked version of + * the specified module from require() (e.g. that it should always return the + * real module). + */ + unmock(moduleName: string): JestObjectType, + /** + * Instructs Jest to use fake versions of the standard timer functions + * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, + * setImmediate and clearImmediate). + */ + useFakeTimers(fakeTimersConfig?: FakeTimersConfig): JestObjectType, + /** + * Instructs Jest to use the real versions of the standard timer functions. + */ + useRealTimers(): JestObjectType, + /** + * Creates a mock function similar to jest.fn but also tracks calls to + * object[methodName]. + */ + spyOn( + object: Object, + methodName: string, + accessType?: 'get' | 'set' + ): JestMockFn, + /** + * Set the default timeout interval for tests and before/after hooks in milliseconds. + * Note: The default timeout interval is 5 seconds if this method is not called. + */ + setTimeout(timeout: number): JestObjectType, + ... +}; + +type JestSpyType = { calls: JestCallsType, ... }; + +type JestDoneFn = {| + (error?: Error): void, + fail: (error: Error) => void, +|}; + +/** Runs this function after every test inside this context */ +declare function afterEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before every test inside this context */ +declare function beforeEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function after all tests have finished inside this context */ +declare function afterAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before any tests have started inside this context */ +declare function beforeAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; + +/** A context for grouping tests together */ +declare var describe: { + /** + * Creates a block that groups together several related tests in one "test suite" + */ + (name: JestTestName, fn: () => void): void, + /** + * Only run this describe block + */ + only(name: JestTestName, fn: () => void): void, + /** + * Skip running this describe block + */ + skip(name: JestTestName, fn: () => void): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +/** An individual test unit */ +declare var it: { + /** + * An individual test unit + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * Only run this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + only: {| + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + |}, + /** + * Skip running this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + skip: {| + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + |}, + /** + * Highlight planned tests in the summary output + * + * @param {String} Name of Test to do + */ + todo(name: string): void, + /** + * Run the test concurrently + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + concurrent( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +declare function fit( + name: JestTestName, + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** An individual test unit */ +declare var test: typeof it; +/** A disabled group of tests */ +declare var xdescribe: typeof describe; +/** A focused group of tests */ +declare var fdescribe: typeof describe; +/** A disabled individual test */ +declare var xit: typeof it; +/** A disabled individual test */ +declare var xtest: typeof it; + +type JestPrettyFormatColors = { + comment: { + close: string, + open: string, + ... + }, + content: { + close: string, + open: string, + ... + }, + prop: { + close: string, + open: string, + ... + }, + tag: { + close: string, + open: string, + ... + }, + value: { + close: string, + open: string, + ... + }, + ... +}; + +type JestPrettyFormatIndent = (string) => string; +type JestPrettyFormatRefs = Array; +type JestPrettyFormatPrint = (any) => string; +type JestPrettyFormatStringOrNull = string | null; + +type JestPrettyFormatOptions = {| + callToJSON: boolean, + edgeSpacing: string, + escapeRegex: boolean, + highlight: boolean, + indent: number, + maxDepth: number, + min: boolean, + plugins: JestPrettyFormatPlugins, + printFunctionName: boolean, + spacing: string, + theme: {| + comment: string, + content: string, + prop: string, + tag: string, + value: string, + |}, +|}; + +type JestPrettyFormatPlugin = { + print: ( + val: any, + serialize: JestPrettyFormatPrint, + indent: JestPrettyFormatIndent, + opts: JestPrettyFormatOptions, + colors: JestPrettyFormatColors + ) => string, + test: (any) => boolean, + ... +}; + +type JestPrettyFormatPlugins = Array; + +/** The expect function is used every time you want to test a value */ +declare var expect: { + /** The object that you want to make assertions against */ + ( + value: any + ): JestExpectType & + JestPromiseType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType & + SnapshotDiffType, + /** Add additional Jasmine matchers to Jest's roster */ + extend(matchers: { [name: string]: JestMatcher, ... }): void, + /** Add a module that formats application-specific data structures. */ + addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void, + assertions(expectedAssertions: number): void, + hasAssertions(): void, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + objectContaining(value: Object): Object, + /** Matches any received string that contains the exact expected string. */ + stringContaining(value: string): string, + stringMatching(value: string | RegExp): string, + not: { + arrayContaining: (value: $ReadOnlyArray) => Array, + objectContaining: (value: { ... }) => Object, + stringContaining: (value: string) => string, + stringMatching: (value: string | RegExp) => string, + ... + }, + ... +}; + +// TODO handle return type +// http://jasmine.github.io/2.4/introduction.html#section-Spies +declare function spyOn(value: mixed, method: string): Object; + +/** Holds all functions related to manipulating test runner */ +declare var jest: JestObjectType; + +/** + * The global Jasmine object, this is generally not exposed as the public API, + * using features inside here could break in later versions of Jest. + */ +declare var jasmine: { + DEFAULT_TIMEOUT_INTERVAL: number, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + clock(): JestClockType, + createSpy(name: string): JestSpyType, + createSpyObj( + baseName: string, + methodNames: Array + ): { [methodName: string]: JestSpyType, ... }, + objectContaining(value: Object): Object, + stringMatching(value: string): string, + ... +}; diff --git a/flow-typed/npm/lint-staged_vx.x.x.js b/flow-typed/npm/lint-staged_vx.x.x.js new file mode 100644 index 0000000..d67fedc --- /dev/null +++ b/flow-typed/npm/lint-staged_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: 02e00596c36db1fd06eadf41e71f9865 +// flow-typed version: <>/lint-staged_v^12.4.0/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'lint-staged' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'lint-staged' { + declare module.exports: any; +} diff --git a/flow-typed/npm/md5_v2.x.x.js b/flow-typed/npm/md5_v2.x.x.js new file mode 100644 index 0000000..ff7d45e --- /dev/null +++ b/flow-typed/npm/md5_v2.x.x.js @@ -0,0 +1,16 @@ +// flow-typed signature: 198b480a6b35dbf3a74cb37d21258b00 +// flow-typed version: c6154227d1/md5_v2.x.x/flow_>=v0.104.x + +// @flow + +declare module "md5" { + declare module.exports: ( + message: string | Buffer, + options?: { + asString?: boolean, + asBytes?: boolean, + encoding?: string, + ... + } + ) => string; +} diff --git a/flow-typed/npm/mkdirp_v1.x.x.js b/flow-typed/npm/mkdirp_v1.x.x.js new file mode 100644 index 0000000..01ba821 --- /dev/null +++ b/flow-typed/npm/mkdirp_v1.x.x.js @@ -0,0 +1,25 @@ +// flow-typed signature: 28ddcca31abd597a77830710de25f5fe +// flow-typed version: a75473352d/mkdirp_v1.x.x/flow_>=v0.83.x + +declare module 'mkdirp' { + import typeof { mkdir, stat } from 'fs'; + + declare type FsImplementation = { + +mkdir?: mkdir, + +stat?: stat, + ... + }; + + declare type Options = number | string | {| mode?: number; fs?: FsImplementation |}; + + declare type Callback = (err: ?Error, path: ?string) => void; + + declare module.exports: {| + (path: string, options?: Options | Callback): Promise; + sync(path: string, options?: Options): string | void; + manual(path: string, options?: Options | Callback): Promise; + manualSync(path: string, options?: Options): string | void; + native(path: string, options?: Options | Callback): Promise; + nativeSync(path: string, options?: Options): string | void; + |}; +} diff --git a/flow-typed/npm/mocha_v4.x.x.js b/flow-typed/npm/mocha_v4.x.x.js new file mode 100644 index 0000000..d0a3e3f --- /dev/null +++ b/flow-typed/npm/mocha_v4.x.x.js @@ -0,0 +1,237 @@ +// flow-typed signature: 8b533a1271b4580048529f45ac3a3c68 +// flow-typed version: ba7bfb2fda/mocha_v4.x.x/flow_>=v0.104.x + +declare interface $npm$mocha$SetupOptions { + slow?: number; + timeout?: number; + ui?: string; + globals?: Array; + reporter?: any; + bail?: boolean; + ignoreLeaks?: boolean; + grep?: any; +} + +declare type $npm$mocha$done = (error?: any) => any; + +// declare interface $npm$mocha$SuiteCallbackContext { +// timeout(ms: number): void; +// retries(n: number): void; +// slow(ms: number): void; +// } + +// declare interface $npm$mocha$TestCallbackContext { +// skip(): void; +// timeout(ms: number): void; +// retries(n: number): void; +// slow(ms: number): void; +// [index: string]: any; +// } + +declare interface $npm$mocha$Suite { + parent: $npm$mocha$Suite; + title: string; + fullTitle(): string; +} + +declare type $npm$mocha$ContextDefinition = {| + (description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite; + only(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite; + skip(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): void; + timeout(ms: number): void; +|} + +declare type $npm$mocha$TestDefinition = {| + (expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test; + only(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test; + skip(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): void; + timeout(ms: number): void; + state: 'failed' | 'passed'; +|} + +declare interface $npm$mocha$Runner {} + +declare class $npm$mocha$BaseReporter { + stats: { + suites: number, + tests: number, + passes: number, + pending: number, + failures: number, + ... + }; + + constructor(runner: $npm$mocha$Runner): $npm$mocha$BaseReporter; +} + +declare class $npm$mocha$DocReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$DotReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$HTMLReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$HTMLCovReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONCovReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONStreamReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$LandingReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$ListReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$MarkdownReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$MinReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$NyanReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$ProgressReporter extends $npm$mocha$BaseReporter { + constructor(runner: $npm$mocha$Runner, options?: { + open?: string, + complete?: string, + incomplete?: string, + close?: string, + ... + }): $npm$mocha$ProgressReporter; +} +declare class $npm$mocha$SpecReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$TAPReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$XUnitReporter extends $npm$mocha$BaseReporter { + constructor(runner: $npm$mocha$Runner, options?: any): $npm$mocha$XUnitReporter; +} + +declare class $npm$mocha$Mocha { + currentTest: $npm$mocha$TestDefinition; + constructor(options?: { + grep?: RegExp, + ui?: string, + reporter?: string, + timeout?: number, + reporterOptions?: any, + slow?: number, + bail?: boolean, + ... + }): $npm$mocha$Mocha; + setup(options: $npm$mocha$SetupOptions): this; + bail(value?: boolean): this; + addFile(file: string): this; + reporter(name: string): this; + reporter(reporter: (runner: $npm$mocha$Runner, options: any) => any): this; + ui(value: string): this; + grep(value: string): this; + grep(value: RegExp): this; + invert(): this; + ignoreLeaks(value: boolean): this; + checkLeaks(): this; + throwError(error: Error): void; + growl(): this; + globals(value: string): this; + globals(values: Array): this; + useColors(value: boolean): this; + useInlineDiffs(value: boolean): this; + timeout(value: number): this; + slow(value: number): this; + enableTimeouts(value: boolean): this; + asyncOnly(value: boolean): this; + noHighlighting(value: boolean): this; + run(onComplete?: (failures: number) => void): $npm$mocha$Runner; + + static reporters: { + Doc: $npm$mocha$DocReporter, + Dot: $npm$mocha$DotReporter, + HTML: $npm$mocha$HTMLReporter, + HTMLCov: $npm$mocha$HTMLCovReporter, + JSON: $npm$mocha$JSONReporter, + JSONCov: $npm$mocha$JSONCovReporter, + JSONStream: $npm$mocha$JSONStreamReporter, + Landing: $npm$mocha$LandingReporter, + List: $npm$mocha$ListReporter, + Markdown: $npm$mocha$MarkdownReporter, + Min: $npm$mocha$MinReporter, + Nyan: $npm$mocha$NyanReporter, + Progress: $npm$mocha$ProgressReporter, + ... + }; +} + +// declare interface $npm$mocha$HookCallbackContext { +// skip(): void; +// timeout(ms: number): void; +// [index: string]: any; +// } + +declare interface $npm$mocha$Runnable { + title: string; + fn: Function; + async: boolean; + sync: boolean; + timedOut: boolean; +} + +declare interface $npm$mocha$Test extends $npm$mocha$Runnable { + parent: $npm$mocha$Suite; + pending: boolean; + state: 'failed' | 'passed' | void; + fullTitle(): string; +} + +// declare interface $npm$mocha$BeforeAndAfterContext extends $npm$mocha$HookCallbackContext { +// currentTest: $npm$mocha$Test; +// } + +declare var mocha: $npm$mocha$Mocha; +declare var describe: $npm$mocha$ContextDefinition; +declare var xdescribe: $npm$mocha$ContextDefinition; +declare var context: $npm$mocha$ContextDefinition; +declare var suite: $npm$mocha$ContextDefinition; +declare var it: $npm$mocha$TestDefinition; +declare var xit: $npm$mocha$TestDefinition; +declare var test: $npm$mocha$TestDefinition; +declare var specify: $npm$mocha$TestDefinition; + +type Run = () => void; + +declare var run: Run; + +type Setup = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type Teardown = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type SuiteSetup = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type SuiteTeardown = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type Before = + | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type After = + | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type BeforeEach = + | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type AfterEach = + | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; + + +declare var setup: Setup; +declare var teardown: Teardown; +declare var suiteSetup: SuiteSetup; +declare var suiteTeardown: SuiteTeardown; +declare var before: Before +declare var after: After; +declare var beforeEach: BeforeEach; +declare var afterEach: AfterEach; + +declare module "mocha" { + declare export var mocha: $npm$mocha$TestDefinition; + declare export var describe: $npm$mocha$ContextDefinition; + declare export var xdescribe: $npm$mocha$ContextDefinition; + declare export var context: $npm$mocha$ContextDefinition; + declare export var suite: $npm$mocha$ContextDefinition; + declare export var it: $npm$mocha$TestDefinition; + declare export var xit: $npm$mocha$TestDefinition; + declare export var test: $npm$mocha$TestDefinition; + declare export var specify: $npm$mocha$TestDefinition; + + declare export var run: Run; + + declare export var setup: Setup; + declare export var teardown: Teardown; + declare export var suiteSetup: SuiteSetup; + declare export var suiteTeardown: SuiteTeardown; + declare export var before: Before; + declare export var after: After; + declare export var beforeEach: BeforeEach; + declare export var afterEach: AfterEach; + + declare export default $npm$mocha$Mocha; +} diff --git a/flow-typed/npm/node-stream-zip_v1.x.x.js b/flow-typed/npm/node-stream-zip_v1.x.x.js new file mode 100644 index 0000000..2940cc2 --- /dev/null +++ b/flow-typed/npm/node-stream-zip_v1.x.x.js @@ -0,0 +1,191 @@ +// flow-typed signature: bd18604d0696d9e4ad0da443cf74273b +// flow-typed version: 1ff21d416b/node-stream-zip_v1.x.x/flow_>=v0.104.x + +declare module 'node-stream-zip' { + declare type StreamZipOptions = {| + /** + * File to read + * @default undefined + */ + file?: string; + + /** + * Alternatively, you can pass fd here + * @default undefined + */ + fd?: number; + + /** + * You will be able to work with entries inside zip archive, + * otherwise the only way to access them is entry event + * @default true + */ + storeEntries?: boolean; + + /** + * By default, entry name is checked for malicious characters, like ../ or c:\123, + * pass this flag to disable validation error + * @default false + */ + skipEntryNameValidation?: boolean; + + /** + * Filesystem read chunk size + * @default automatic based on file size + */ + chunkSize?: number; + + /** + * Encoding used to decode file names + * @default UTF8 + */ + nameEncoding?: string; + |} + + declare type ZipEntry = {| + /** + * file name + */ + name: string; + + /** + * true if it's a directory entry + */ + isDirectory: boolean; + + /** + * true if it's a file entry, see also isDirectory + */ + isFile: boolean; + + /** + * file comment + */ + comment: string; + + /** + * if the file is encrypted + */ + encrypted: boolean; + + /** + * version made by + */ + verMade: number; + + /** + * version needed to extract + */ + version: number; + + /** + * encrypt, decrypt flags + */ + flags: number; + + /** + * compression method + */ + method: number; + + /** + * modification time + */ + time: number; + + /** + * uncompressed file crc-32 value + */ + crc: number; + + /** + * compressed size + */ + compressedSize: number; + + /** + * uncompressed size + */ + size: number; + + /** + * volume number start + */ + diskStart: number; + + /** + * internal file attributes + */ + inattr: number; + + /** + * external file attributes + */ + attr: number; + + /** + * LOC header offset + */ + offset: number; + |} + + declare class StreamZipAsync { + constructor(config: StreamZipOptions): this; + + entriesCount: Promise; + comment: Promise; + + entry(name: string): Promise; + entries(): Promise<{ [name: string]: ZipEntry }>; + entryData(entry: string | ZipEntry): Promise; + stream(entry: string | ZipEntry): Promise; + extract(entry: string | ZipEntry | null, outPath: string): Promise; + + on(event: 'entry', handler: (entry: ZipEntry) => void): void; + on(event: 'extract', handler: (entry: ZipEntry, outPath: string) => void): void; + + close(): Promise; + } + + declare class StreamZip { + constructor(config: StreamZipOptions): this; + + entriesCount: number; + comment: string; + + on(event: 'error', handler: (error: any) => void): void; + on(event: 'entry', handler: (entry: ZipEntry) => void): void; + on(event: 'ready', handler: () => void): void; + on(event: 'extract', handler: (entry: ZipEntry, outPath: string) => void): void; + + entry(name: string): ?ZipEntry; + + entries(): { [name: string]: ZipEntry }; + + stream( + entry: string | ZipEntry, + callback: (err: any | null, stream?: ReadableStream) => void + ): void; + + entryDataSync(entry: string | ZipEntry): Buffer; + + openEntry( + entry: string | ZipEntry, + callback: (err: any | null, entry?: ZipEntry) => void, + sync: boolean + ): void; + + extract( + entry: string | ZipEntry | null, + outPath: string, + callback: (err?: any, res?: number) => void + ): void; + + close(callback?: (err?: any) => void): void; + + static async: Class; + } + + declare module.exports: Class; + } + \ No newline at end of file diff --git a/flow-typed/npm/prettier_v1.x.x.js b/flow-typed/npm/prettier_v1.x.x.js new file mode 100644 index 0000000..ae6d0bd --- /dev/null +++ b/flow-typed/npm/prettier_v1.x.x.js @@ -0,0 +1,228 @@ +// flow-typed signature: cfdc7e61e71ab8d32e882a236b798eaf +// flow-typed version: 02d4f1d2c5/prettier_v1.x.x/flow_>=v0.104.x <=v0.200.x + +declare module "prettier" { + declare export type AST = { [key: string]: any, ... }; + declare export type Doc = { + [key: string]: any, + ... + }; + declare export type FastPath = { + stack: any[], + getName(): null | string | number | Symbol, + getValue(): T, + getNode(count?: number): null | T, + getParentNode(count?: number): null | T, + call(callback: (path: FastPath) => U, ...names: Array): U, + each(callback: (path: FastPath) => void, ...names: Array): void, + map(callback: (path: FastPath, index: number) => U, ...names: Array): U[], + ... + }; + + declare export type PrettierParserName = + | "babylon" // deprecated + | "babel" + | "babel-flow" + | "flow" + | "typescript" + | "postcss" // deprecated + | "css" + | "less" + | "scss" + | "json" + | "json5" + | "json-stringify" + | "graphql" + | "markdown" + | "vue" + | "html" + | "angular" + | "mdx" + | "yaml"; + + declare export type PrettierParser = { + [name: PrettierParserName]: (text: string, options?: { [key: string]: any, ... }) => AST, + ... + }; + + declare export type CustomParser = ( + text: string, + parsers: PrettierParser, + options: Options + ) => AST; + + declare export type Options = {| + printWidth?: number, + tabWidth?: number, + useTabs?: boolean, + semi?: boolean, + singleQuote?: boolean, + trailingComma?: "none" | "es5" | "all", + bracketSpacing?: boolean, + jsxBracketSameLine?: boolean, + arrowParens?: "avoid" | "always", + rangeStart?: number, + rangeEnd?: number, + parser?: PrettierParserName | CustomParser, + filepath?: string, + requirePragma?: boolean, + insertPragma?: boolean, + proseWrap?: "always" | "never" | "preserve", + plugins?: Array + |}; + + declare export type Plugin = { + languages: SupportLanguage, + parsers: { [parserName: string]: Parser, ... }, + printers: { [astFormat: string]: Printer, ... }, + options?: SupportOption[], + ... + }; + + declare export type Parser = { + parse: ( + text: string, + parsers: { [parserName: string]: Parser, ... }, + options: { [key: string]: any, ... } + ) => AST, + astFormat: string, + hasPragma?: (text: string) => boolean, + locStart: (node: any) => number, + locEnd: (node: any) => number, + preprocess?: (text: string, options: { [key: string]: any, ... }) => string, + ... + }; + + declare export type Printer = { + print: ( + path: FastPath<>, + options: { [key: string]: any, ... }, + print: (path: FastPath<>) => Doc + ) => Doc, + embed: ( + path: FastPath<>, + print: (path: FastPath<>) => Doc, + textToDoc: (text: string, options: { [key: string]: any, ... }) => Doc, + options: { [key: string]: any, ... } + ) => ?Doc, + insertPragma?: (text: string) => string, + massageAstNode?: (node: any, newNode: any, parent: any) => any, + hasPrettierIgnore?: (path: FastPath<>) => boolean, + canAttachComment?: (node: any) => boolean, + willPrintOwnComments?: (path: FastPath<>) => boolean, + printComments?: (path: FastPath<>, print: (path: FastPath<>) => Doc, options: { [key: string]: any, ... }, needsSemi: boolean) => Doc, + handleComments?: { + ownLine?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean, + endOfLine?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean, + remaining?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean, + ... + }, + ... + }; + + declare export type CursorOptions = {| + cursorOffset: number, + printWidth?: $PropertyType, + tabWidth?: $PropertyType, + useTabs?: $PropertyType, + semi?: $PropertyType, + singleQuote?: $PropertyType, + trailingComma?: $PropertyType, + bracketSpacing?: $PropertyType, + jsxBracketSameLine?: $PropertyType, + arrowParens?: $PropertyType, + parser?: $PropertyType, + filepath?: $PropertyType, + requirePragma?: $PropertyType, + insertPragma?: $PropertyType, + proseWrap?: $PropertyType, + plugins?: $PropertyType + |}; + + declare export type CursorResult = {| + formatted: string, + cursorOffset: number + |}; + + declare export type ResolveConfigOptions = {| + useCache?: boolean, + config?: string, + editorconfig?: boolean + |}; + + declare export type SupportLanguage = { + name: string, + since: string, + parsers: Array, + group?: string, + tmScope: string, + aceMode: string, + codemirrorMode: string, + codemirrorMimeType: string, + aliases?: Array, + extensions: Array, + filenames?: Array, + linguistLanguageId: number, + vscodeLanguageIds: Array, + ... + }; + + declare export type SupportOption = {| + since: string, + type: "int" | "boolean" | "choice" | "path", + deprecated?: string, + redirect?: SupportOptionRedirect, + description: string, + oppositeDescription?: string, + default: SupportOptionValue, + range?: SupportOptionRange, + choices?: SupportOptionChoice + |}; + + declare export type SupportOptionRedirect = {| + options: string, + value: SupportOptionValue + |}; + + declare export type SupportOptionRange = {| + start: number, + end: number, + step: number + |}; + + declare export type SupportOptionChoice = {| + value: boolean | string, + description?: string, + since?: string, + deprecated?: string, + redirect?: SupportOptionValue + |}; + + declare export type SupportOptionValue = number | boolean | string; + + declare export type SupportInfo = {| + languages: Array, + options: Array + |}; + + declare export type FileInfo = {| + ignored: boolean, + inferredParser: PrettierParserName | null, + |}; + + declare export type Prettier = {| + format: (source: string, options?: Options) => string, + check: (source: string, options?: Options) => boolean, + formatWithCursor: (source: string, options: CursorOptions) => CursorResult, + resolveConfig: { + (filePath: string, options?: ResolveConfigOptions): Promise, + sync(filePath: string, options?: ResolveConfigOptions): ?Options, + ... + }, + clearConfigCache: () => void, + getSupportInfo: (version?: string) => SupportInfo, + getFileInfo: (filePath: string) => Promise + |}; + + declare export default Prettier; +} diff --git a/flow-typed/npm/prettier_vx.x.x.js b/flow-typed/npm/prettier_vx.x.x.js new file mode 100644 index 0000000..b686231 --- /dev/null +++ b/flow-typed/npm/prettier_vx.x.x.js @@ -0,0 +1,150 @@ +// flow-typed signature: 93996c004bfe0cad85af74f873a8a9e2 +// flow-typed version: <>/prettier_v^2.6.2/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'prettier' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'prettier' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'prettier/bin-prettier' { + declare module.exports: any; +} + +declare module 'prettier/cli' { + declare module.exports: any; +} + +declare module 'prettier/doc' { + declare module.exports: any; +} + +declare module 'prettier/parser-angular' { + declare module.exports: any; +} + +declare module 'prettier/parser-babel' { + declare module.exports: any; +} + +declare module 'prettier/parser-espree' { + declare module.exports: any; +} + +declare module 'prettier/parser-flow' { + declare module.exports: any; +} + +declare module 'prettier/parser-glimmer' { + declare module.exports: any; +} + +declare module 'prettier/parser-graphql' { + declare module.exports: any; +} + +declare module 'prettier/parser-html' { + declare module.exports: any; +} + +declare module 'prettier/parser-markdown' { + declare module.exports: any; +} + +declare module 'prettier/parser-meriyah' { + declare module.exports: any; +} + +declare module 'prettier/parser-postcss' { + declare module.exports: any; +} + +declare module 'prettier/parser-typescript' { + declare module.exports: any; +} + +declare module 'prettier/parser-yaml' { + declare module.exports: any; +} + +declare module 'prettier/standalone' { + declare module.exports: any; +} + +declare module 'prettier/third-party' { + declare module.exports: any; +} + +// Filename aliases +declare module 'prettier/bin-prettier.js' { + declare module.exports: $Exports<'prettier/bin-prettier'>; +} +declare module 'prettier/cli.js' { + declare module.exports: $Exports<'prettier/cli'>; +} +declare module 'prettier/doc.js' { + declare module.exports: $Exports<'prettier/doc'>; +} +declare module 'prettier/index' { + declare module.exports: $Exports<'prettier'>; +} +declare module 'prettier/index.js' { + declare module.exports: $Exports<'prettier'>; +} +declare module 'prettier/parser-angular.js' { + declare module.exports: $Exports<'prettier/parser-angular'>; +} +declare module 'prettier/parser-babel.js' { + declare module.exports: $Exports<'prettier/parser-babel'>; +} +declare module 'prettier/parser-espree.js' { + declare module.exports: $Exports<'prettier/parser-espree'>; +} +declare module 'prettier/parser-flow.js' { + declare module.exports: $Exports<'prettier/parser-flow'>; +} +declare module 'prettier/parser-glimmer.js' { + declare module.exports: $Exports<'prettier/parser-glimmer'>; +} +declare module 'prettier/parser-graphql.js' { + declare module.exports: $Exports<'prettier/parser-graphql'>; +} +declare module 'prettier/parser-html.js' { + declare module.exports: $Exports<'prettier/parser-html'>; +} +declare module 'prettier/parser-markdown.js' { + declare module.exports: $Exports<'prettier/parser-markdown'>; +} +declare module 'prettier/parser-meriyah.js' { + declare module.exports: $Exports<'prettier/parser-meriyah'>; +} +declare module 'prettier/parser-postcss.js' { + declare module.exports: $Exports<'prettier/parser-postcss'>; +} +declare module 'prettier/parser-typescript.js' { + declare module.exports: $Exports<'prettier/parser-typescript'>; +} +declare module 'prettier/parser-yaml.js' { + declare module.exports: $Exports<'prettier/parser-yaml'>; +} +declare module 'prettier/standalone.js' { + declare module.exports: $Exports<'prettier/standalone'>; +} +declare module 'prettier/third-party.js' { + declare module.exports: $Exports<'prettier/third-party'>; +} diff --git a/flow-typed/npm/rimraf_v3.x.x.js b/flow-typed/npm/rimraf_v3.x.x.js new file mode 100644 index 0000000..df98e86 --- /dev/null +++ b/flow-typed/npm/rimraf_v3.x.x.js @@ -0,0 +1,20 @@ +// flow-typed signature: 31191d41b239d1242753bdea18136ae9 +// flow-typed version: 6ee04b16cf/rimraf_v3.x.x/flow_>=v0.104.x + +declare module 'rimraf' { + declare type Options = { + maxBusyTries?: number, + emfileWait?: number, + glob?: boolean, + disableGlob?: boolean, + ... + }; + + declare type Callback = (err: ?Error, path: ?string) => void; + + declare module.exports: { + (f: string, opts?: Options | Callback, callback?: Callback): void, + sync(path: string, opts?: Options): void, + ... + }; +} diff --git a/flow-typed/npm/semver_v7.x.x.js b/flow-typed/npm/semver_v7.x.x.js new file mode 100644 index 0000000..8d0b030 --- /dev/null +++ b/flow-typed/npm/semver_v7.x.x.js @@ -0,0 +1,232 @@ +// flow-typed signature: bf6205896c200fb28700dfa8d29f2b8a +// flow-typed version: 3d76504c27/semver_v7.x.x/flow_>=v0.104.x + +declare module "semver" { + declare type Release = + | "major" + | "premajor" + | "minor" + | "preminor" + | "patch" + | "prepatch" + | "prerelease"; + + // The supported comparators are taken from the source here: + // https://github.com/npm/node-semver/blob/8bd070b550db2646362c9883c8d008d32f66a234/semver.js#L623 + declare type Operator = + | "===" + | "!==" + | "==" + | "=" + | "" // Not sure why you would want this, but whatever. + | "!=" + | ">" + | ">=" + | "<" + | "<="; + + declare class SemVer { + build: Array; + loose: ?boolean; + major: number; + minor: number; + patch: number; + prerelease: Array; + raw: string; + version: string; + + constructor(version: string | SemVer, options?: Options): SemVer; + compare(other: string | SemVer): -1 | 0 | 1; + compareMain(other: string | SemVer): -1 | 0 | 1; + comparePre(other: string | SemVer): -1 | 0 | 1; + compareBuild(other: string | SemVer): -1 | 0 | 1; + format(): string; + inc(release: Release, identifier: string): this; + } + + declare class Comparator { + options?: Options; + operator: Operator; + semver: SemVer; + value: string; + + constructor(comp: string | Comparator, options?: Options): Comparator; + parse(comp: string): void; + test(version: string): boolean; + } + + declare class Range { + loose: ?boolean; + raw: string; + set: Array>; + + constructor(range: string | Range, options?: Options): Range; + format(): string; + parseRange(range: string): Array; + test(version: string): boolean; + toString(): string; + } + + declare var SEMVER_SPEC_VERSION: string; + declare var re: Array; + declare var src: Array; + + declare type Options = { + options?: Options, + includePrerelease?: boolean, + ... + } | boolean; + + // Functions + declare function valid(v: string | SemVer, options?: Options): string | null; + declare function clean(v: string | SemVer, options?: Options): string | null; + declare function inc( + v: string | SemVer, + release: Release, + options?: Options, + identifier?: string + ): string | null; + declare function inc( + v: string | SemVer, + release: Release, + identifier: string + ): string | null; + declare function major(v: string | SemVer, options?: Options): number; + declare function minor(v: string | SemVer, options?: Options): number; + declare function patch(v: string | SemVer, options?: Options): number; + declare function intersects(r1: string | SemVer, r2: string | SemVer, loose?: boolean): boolean; + declare function minVersion(r: string | Range): Range | null; + + // Comparison + declare function gt( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function gte( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function lt( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function lte( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function eq( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function neq( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): boolean; + declare function cmp( + v1: string | SemVer, + comparator: Operator, + v2: string | SemVer, + options?: Options + ): boolean; + declare function compare( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): -1 | 0 | 1; + declare function rcompare( + v1: string | SemVer, + v2: string | SemVer, + options?: Options + ): -1 | 0 | 1; + declare function diff(v1: string | SemVer, v2: string | SemVer): ?Release; + declare function intersects(comparator: Comparator): boolean; + declare function sort( + list: Array, + options?: Options + ): Array; + declare function rsort( + list: Array, + options?: Options + ): Array; + declare function compareIdentifiers( + v1: string | SemVer, + v2: string | SemVer + ): -1 | 0 | 1; + declare function rcompareIdentifiers( + v1: string | SemVer, + v2: string | SemVer + ): -1 | 0 | 1; + + // Ranges + declare function validRange( + range: string | Range, + options?: Options + ): string | null; + declare function satisfies( + version: string | SemVer, + range: string | Range, + options?: Options + ): boolean; + declare function maxSatisfying( + versions: Array, + range: string | Range, + options?: Options + ): string | SemVer | null; + declare function minSatisfying( + versions: Array, + range: string | Range, + options?: Options + ): string | SemVer | null; + declare function gtr( + version: string | SemVer, + range: string | Range, + options?: Options + ): boolean; + declare function ltr( + version: string | SemVer, + range: string | Range, + options?: Options + ): boolean; + declare function outside( + version: string | SemVer, + range: string | Range, + hilo: ">" | "<", + options?: Options + ): boolean; + declare function intersects( + range: Range + ): boolean; + declare function simplifyRange( + ranges: Array, + range: string | Range, + options?: Options, + ): string | Range; + declare function subset( + sub: string | Range, + dom: string | Range, + options?: Options, + ): boolean; + + // Coercion + declare function coerce( + version: string | SemVer, + options?: Options + ): ?SemVer + + // Not explicitly documented, or deprecated + declare function parse(version: string, options?: Options): ?SemVer; + declare function toComparators( + range: string | Range, + options?: Options + ): Array>; +} + +declare module "semver/preload" { + declare module.exports: $Exports<"semver">; +} diff --git a/flow-typed/npm/standard-version_vx.x.x.js b/flow-typed/npm/standard-version_vx.x.x.js new file mode 100644 index 0000000..31f339a --- /dev/null +++ b/flow-typed/npm/standard-version_vx.x.x.js @@ -0,0 +1,18 @@ +// flow-typed signature: 84ff87a30bde022c60e59edfba5190b1 +// flow-typed version: <>/standard-version_v^9.3.2/flow_v0.135.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'standard-version' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'standard-version' { + declare module.exports: any; +} diff --git a/flow-typed/npm/yargs_v15.x.x.js b/flow-typed/npm/yargs_v15.x.x.js new file mode 100644 index 0000000..b6d9794 --- /dev/null +++ b/flow-typed/npm/yargs_v15.x.x.js @@ -0,0 +1,301 @@ +// flow-typed signature: d538758c32ffc612a9c0d1262c22d161 +// flow-typed version: 3c81f4d103/yargs_v15.x.x/flow_>=v0.118.x <=v0.200.x + +declare module "yargs" { + declare type Argv = { + [key: string]: any, + _: Array, + $0: string, + ... + }; + + declare type Options = $Shape<{ + alias: string | Array, + array: boolean, + boolean: boolean, + choices: Array, + coerce: (arg: {[key: string]: any, ...} | any) => mixed, + config: boolean, + configParser: (configPath: string) => { [key: string]: mixed, ... }, + conflicts: string | Array | { [key: string]: string, ... }, + count: boolean, + default: mixed, + defaultDescription: string, + demandOption: boolean | string, + desc: string, + describe: string, + description: string, + global: boolean, + group: string, + implies: string | { [key: string]: string, ... }, + nargs: number, + normalize: boolean, + number: boolean, + required: boolean, + requiresArg: boolean, + skipValidation: boolean, + string: boolean, + type: "array" | "boolean" | "count" | "number" | "string", + ... + }>; + + declare type CommonModuleObject = {| + command?: string | Array, + aliases?: Array | string, + builder?: { [key: string]: Options, ... } | ((yargsInstance: Yargs) => mixed), + handler?: ((argv: Argv) => void) | ((argv: Argv) => Promise) + |}; + + declare type ModuleObjectDesc = {| + ...CommonModuleObject, + desc?: string | false + |}; + + declare type ModuleObjectDescribe = {| + ...CommonModuleObject, + describe?: string | false + |}; + + declare type ModuleObjectDescription = {| + ...CommonModuleObject, + description?: string | false + |}; + + declare type ModuleObject = + | ModuleObjectDesc + | ModuleObjectDescribe + | ModuleObjectDescription; + + declare type MiddleWareCallback = + | (argv: Argv, yargsInstance?: Yargs) => void + | (argv: Argv, yargsInstance?: Yargs) => Promise; + + declare type Middleware = MiddleWareCallback | Array; + + declare class Yargs { + (args: Array): Yargs; + + alias(key: string, alias: string): this; + alias(alias: { [key: string]: string | Array, ... }): this; + argv: Argv; + array(key: string | Array): this; + boolean(parameter: string | Array): this; + check(fn: (argv: Argv, options: Array) => ?boolean): this; + choices(key: string, allowed: Array): this; + choices(allowed: { [key: string]: Array, ... }): this; + coerce(key: string, fn: (value: any) => mixed): this; + coerce(object: { [key: string]: (value: any) => mixed, ... }): this; + coerce(keys: Array, fn: (value: any) => mixed): this; + + command( + cmd: string | Array, + desc: string | false, + builder?: { [key: string]: Options, ... } | ((yargsInstance: Yargs) => mixed), + handler?: Function + ): this; + + command( + cmd: string | Array, + desc: string | false, + module: ModuleObject + ): this; + + command(module: ModuleObject): this; + + commandDir( + directory: string, + options?: { + exclude?: string | Function, + extensions?: Array, + include?: string | Function, + recurse?: boolean, + visit?: Function, + ... + }, + ): this; + + completion( + cmd?: string, + description?: string | false | ( + current: string, + argv: Argv, + done: (compeltion: Array) => void + ) => ?(Array | Promise>), + fn?: ( + current: string, + argv: Argv, + done: (completion: Array) => void + ) => ?(Array | Promise>) + ): this; + + config( + key?: string, + description?: string, + parseFn?: (configPath: string) => { [key: string]: mixed, ... } + ): this; + config( + key: string, + parseFn?: (configPath: string) => { [key: string]: mixed, ... } + ): this; + config(config: { [key: string]: mixed, ... }): this; + + conflicts(key: string, value: string | Array): this; + conflicts(keys: { [key: string]: string | Array, ... }): this; + + count(name: string): this; + + default(key: string, value: mixed, description?: string): this; + default(defaults: { [key: string]: mixed, ... }): this; + + // Deprecated: use demandOption() and demandCommand() instead. + demand(key: string, msg?: string | boolean): this; + demand(count: number, max?: number, msg?: string | boolean): this; + + demandOption(key: string | Array, msg?: string | boolean): this; + + demandCommand(): this; + demandCommand(min: number, minMsg?: string): this; + demandCommand( + min: number, + max: number, + minMsg?: string, + maxMsg?: string + ): this; + + describe(key: string, description: string): this; + describe(describeObject: { [key: string]: string, ... }): this; + + detectLocale(shouldDetect: boolean): this; + + env(prefix?: string): this; + + epilog(text: string): this; + epilogue(text: string): this; + + example(cmd: string, desc?: string): this; + + exitProcess(enable: boolean): this; + + fail(fn: (failureMessage: string, err: Error, yargs: Yargs) => mixed): this; + + getCompletion(args: Array, fn: () => void): this; + + global(globals: string | Array, isGlobal?: boolean): this; + + group(key: string | Array, groupName: string): this; + + help(option: boolean): this; + + help(option?: string, desc?: string): this; + + hide(key: string): this; + + implies(key: string, value: string | Array): this; + implies(keys: { [key: string]: string | Array, ... }): this; + + locale( + locale: | "de" + | "en" + | "es" + | "fr" + | "hi" + | "hu" + | "id" + | "it" + | "ja" + | "ko" + | "nb" + | "pirate" + | "pl" + | "pt" + | "pt_BR" + | "ru" + | "th" + | "tr" + | "zh_CN" + ): this; + locale(): string; + + middleware( + middlewareCallbacks: Middleware, + applyBeforeValidation?: boolean, + ): this; + + nargs(key: string, count: number): this; + + normalize(key: string): this; + + number(key: string | Array): this; + + onFinishCommand(handler: () => mixed): this; + + option(key: string, options?: Options): this; + option(optionMap: { [key: string]: Options, ... }): this; + + options(key: string, options?: Options): this; + options(optionMap: { [key: string]: Options, ... }): this; + + parse( + args?: string | Array, + context?: { [key: string]: any, ... }, + parseCallback?: (err: Error, argv: Argv, output?: string) => void + ): Argv; + parse( + args?: string | Array, + parseCallback?: (err: Error, argv: Argv, output?: string) => void + ): Argv; + + parserConfiguration(configuration: {[key: string]: any, ...}): this; + + pkgConf(key: string, cwd?: string): this; + + positional(key: string, opt?: Options): this; + + recommendCommands(): this; + + // Alias of demand() + require(key: string, msg: string | boolean): this; + require(count: number, max?: number, msg?: string | boolean): this; + + requiresArg(key: string | Array): this; + + reset(): this; + + scriptName(name: string): this; + + showCompletionScript(): this; + + showHelp(consoleLevel?: "error" | "warn" | "log"): this; + showHelp(printCallback: (usageData: string) => void): this; + + showHelpOnFail(enable: boolean, message?: string): this; + + strict(): this; + + skipValidation(key: string): this; + + strict(global?: boolean): this; + + string(key: string | Array): this; + + terminalWidth(): number; + + updateLocale(obj: { [key: string]: string, ... }): this; + updateStrings(obj: { [key: string]: string, ... }): this; + + usage(message: string, opts?: { [key: string]: Options, ... }): this; + + version(): this; + version(version: string | false): this; + version(option: string | (() => string), version: string): this; + version( + option: string | (() => string), + description: string | (() => string), + version: string + ): this; + + wrap(columns: number | null): this; + } + + declare module.exports: Yargs; +} diff --git a/package.json b/package.json index 29c2b0e..3e120f1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "dev": "babel-node --plugins @babel/plugin-transform-modules-commonjs $(npm bin)/webpack-dev-server --config webpack.config.js --port 9000 --open-page demo/dev/index.htm --hot=false --inline=false", - "setup": "npm install && npm run flow-typed", + "setup": "npm install", "lint": "eslint src/ test/ *.js --ext .js,.jsx", "flow-typed": "rm -rf ./flow-typed && flow-typed install && flow-typed install react@6 && flow-typed install mocha@4", "flow": "flow", @@ -14,10 +14,10 @@ "karma": "cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start", "babel": "babel src/ --out-dir dist/module", "webpack": "babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress", - "test": "npm run format:check && npm run lint && npm run flow-typed && npm run flow && npm run karma", + "test": "npm run format:check && npm run lint && npm run flow && npm run karma", "build": "npm run test && npm run babel && npm run webpack", "clean": "rimraf dist coverage", - "reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install", + "reinstall": "rimraf node_modules && npm install", "debug": "cross-env NODE_ENV=debug", "prepare": "husky install", "prerelease": "npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'", @@ -94,8 +94,8 @@ "@commitlint/config-conventional": "^16.2.1", "@krakenjs/grumbler-scripts": "^8.0.4", "cross-env": "^7.0.3", - "flow-bin": "0.135.0", - "flow-typed": "^3.8.0", + "flow-bin": "^0.135.0", + "flow-typed": "^3.9.0", "husky": "^7.0.4", "jest": "^29.3.1", "lint-staged": "^12.4.0",