|
| 1 | +// flow-typed signature: d2a519d7d007e9ba3e5bf2ac3ff76eca |
| 2 | +// flow-typed version: f243e51ed7/glob_v7.x.x/flow_>=v0.104.x |
| 3 | + |
| 4 | +declare module "glob" { |
| 5 | + declare type MinimatchOptions = {| |
| 6 | + debug?: boolean, |
| 7 | + nobrace?: boolean, |
| 8 | + noglobstar?: boolean, |
| 9 | + dot?: boolean, |
| 10 | + noext?: boolean, |
| 11 | + nocase?: boolean, |
| 12 | + nonull?: boolean, |
| 13 | + matchBase?: boolean, |
| 14 | + nocomment?: boolean, |
| 15 | + nonegate?: boolean, |
| 16 | + flipNegate?: boolean |
| 17 | + |}; |
| 18 | + |
| 19 | + declare type Options = {| |
| 20 | + ...MinimatchOptions, |
| 21 | + cwd?: string, |
| 22 | + root?: string, |
| 23 | + nomount?: boolean, |
| 24 | + mark?: boolean, |
| 25 | + nosort?: boolean, |
| 26 | + stat?: boolean, |
| 27 | + silent?: boolean, |
| 28 | + strict?: boolean, |
| 29 | + cache?: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray<string>, ... }, |
| 30 | + statCache?: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }, |
| 31 | + symlinks?: { [path: string]: boolean | void, ... }, |
| 32 | + realpathCache?: { [path: string]: string, ... }, |
| 33 | + sync?: boolean, |
| 34 | + nounique?: boolean, |
| 35 | + nodir?: boolean, |
| 36 | + ignore?: string | $ReadOnlyArray<string>, |
| 37 | + follow?: boolean, |
| 38 | + realpath?: boolean, |
| 39 | + absolute?: boolean |
| 40 | + |}; |
| 41 | + |
| 42 | + /** |
| 43 | + * Called when an error occurs, or matches are found |
| 44 | + * err |
| 45 | + * matches: filenames found matching the pattern |
| 46 | + */ |
| 47 | + declare type CallBack = (err: ?Error, matches: Array<string>) => void; |
| 48 | + |
| 49 | + declare class Glob extends events$EventEmitter { |
| 50 | + constructor(pattern: string): this; |
| 51 | + constructor(pattern: string, callback: CallBack): this; |
| 52 | + constructor(pattern: string, options: Options, callback: CallBack): this; |
| 53 | + |
| 54 | + minimatch: {...}; |
| 55 | + options: Options; |
| 56 | + aborted: boolean; |
| 57 | + cache: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray<string>, ... }; |
| 58 | + statCache: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }; |
| 59 | + symlinks: { [path: string]: boolean | void, ... }; |
| 60 | + realpathCache: { [path: string]: string, ... }; |
| 61 | + found: Array<string>; |
| 62 | + |
| 63 | + pause(): void; |
| 64 | + resume(): void; |
| 65 | + abort(): void; |
| 66 | + } |
| 67 | + |
| 68 | + declare class GlobModule { |
| 69 | + Glob: Class<Glob>; |
| 70 | + |
| 71 | + (pattern: string, callback: CallBack): void; |
| 72 | + (pattern: string, options: Options, callback: CallBack): void; |
| 73 | + |
| 74 | + hasMagic(pattern: string, options?: Options): boolean; |
| 75 | + sync(pattern: string, options?: Options): Array<string>; |
| 76 | + } |
| 77 | + |
| 78 | + declare module.exports: GlobModule; |
| 79 | +} |
0 commit comments