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