1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import events = require("events");
|
12 | import minimatch = require("minimatch");
|
13 |
|
14 | declare function G(pattern: string, cb: (err: Error | null, matches: string[]) => void): G.IGlob;
|
15 | declare function G(pattern: string, options: G.IOptions, cb: (err: Error | null, matches: string[]) => void): G.IGlob;
|
16 |
|
17 | declare namespace G {
|
18 | function __promisify__(pattern: string, options?: IOptions): Promise<string[]>;
|
19 |
|
20 | function sync(pattern: string, options?: IOptions): string[];
|
21 |
|
22 | function hasMagic(pattern: string, options?: IOptions): boolean;
|
23 |
|
24 | let glob: typeof G;
|
25 | let Glob: IGlobStatic;
|
26 | let GlobSync: IGlobSyncStatic;
|
27 |
|
28 | interface IOptions extends minimatch.IOptions {
|
29 | cwd?: string | undefined;
|
30 | root?: string | undefined;
|
31 | dot?: boolean | undefined;
|
32 | nomount?: boolean | undefined;
|
33 | mark?: boolean | undefined;
|
34 | nosort?: boolean | undefined;
|
35 | stat?: boolean | undefined;
|
36 | silent?: boolean | undefined;
|
37 | strict?: boolean | undefined;
|
38 | cache?: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> } | undefined;
|
39 | statCache?: { [path: string]: false | { isDirectory(): boolean} | undefined } | undefined;
|
40 | symlinks?: { [path: string]: boolean | undefined } | undefined;
|
41 | realpathCache?: { [path: string]: string } | undefined;
|
42 | sync?: boolean | undefined;
|
43 | nounique?: boolean | undefined;
|
44 | nonull?: boolean | undefined;
|
45 | debug?: boolean | undefined;
|
46 | nobrace?: boolean | undefined;
|
47 | noglobstar?: boolean | undefined;
|
48 | noext?: boolean | undefined;
|
49 | nocase?: boolean | undefined;
|
50 | matchBase?: any;
|
51 | nodir?: boolean | undefined;
|
52 | ignore?: string | ReadonlyArray<string> | undefined;
|
53 | follow?: boolean | undefined;
|
54 | realpath?: boolean | undefined;
|
55 | nonegate?: boolean | undefined;
|
56 | nocomment?: boolean | undefined;
|
57 | absolute?: boolean | undefined;
|
58 | }
|
59 |
|
60 | interface IGlobStatic extends events.EventEmitter {
|
61 | new (pattern: string, cb?: (err: Error | null, matches: string[]) => void): IGlob;
|
62 | new (pattern: string, options: IOptions, cb?: (err: Error | null, matches: string[]) => void): IGlob;
|
63 | prototype: IGlob;
|
64 | }
|
65 |
|
66 | interface IGlobSyncStatic {
|
67 | new (pattern: string, options?: IOptions): IGlobBase;
|
68 | prototype: IGlobBase;
|
69 | }
|
70 |
|
71 | interface IGlobBase {
|
72 | minimatch: minimatch.IMinimatch;
|
73 | options: IOptions;
|
74 | aborted: boolean;
|
75 | cache: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
|
76 | statCache: { [path: string]: false | { isDirectory(): boolean; } | undefined };
|
77 | symlinks: { [path: string]: boolean | undefined };
|
78 | realpathCache: { [path: string]: string };
|
79 | found: string[];
|
80 | }
|
81 |
|
82 | interface IGlob extends IGlobBase, events.EventEmitter {
|
83 | pause(): void;
|
84 | resume(): void;
|
85 | abort(): void;
|
86 | }
|
87 | }
|
88 |
|
89 | export = G;
|