|
1 |
| -// Type definitions for Glob |
| 1 | +// Type definitions for Glob 5.0.10 |
2 | 2 | // Project: https://github.com/isaacs/node-glob
|
3 | 3 | // Definitions by: vvakame <https://github.com/vvakame/>
|
4 | 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
9 | 9 | declare module "glob" {
|
10 | 10 |
|
11 | 11 | import events = require("events");
|
| 12 | + import fs = require('fs'); |
12 | 13 | import minimatch = require("minimatch");
|
13 | 14 |
|
14 |
| - function G(pattern:string, cb:(err:Error, matches:string[])=>void):void; |
15 |
| - |
16 |
| - function G(pattern:string, options:G.IOptions, cb:(err:Error, matches:string[])=>void):void; |
| 15 | + function G(pattern: string, cb: (err: Error, matches: string[]) => void): void; |
| 16 | + function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void; |
17 | 17 |
|
18 | 18 | module G {
|
19 |
| - function sync(pattern:string, options?:IOptions):string[]; |
| 19 | + function sync(pattern: string, options?: IOptions): string[]; |
| 20 | + |
| 21 | + function hasMagic(pattern: string, options?: IOptions): boolean; |
20 | 22 |
|
21 |
| - var Glob:IGlobStatic; |
| 23 | + var Glob: IGlobStatic; |
| 24 | + var GlobSync: IGlobSyncStatic; |
22 | 25 |
|
23 | 26 | interface IOptions extends minimatch.IOptions {
|
24 | 27 | cwd?: string;
|
25 |
| - sync?: boolean; |
| 28 | + root?: string; |
| 29 | + dot?: boolean; |
26 | 30 | nomount?: boolean;
|
27 |
| - matchBase?:any; |
28 |
| - noglobstar?:any; |
| 31 | + mark?: boolean; |
| 32 | + nosort?: boolean; |
| 33 | + stat?: boolean; |
| 34 | + silent?: boolean; |
29 | 35 | strict?: boolean;
|
30 |
| - dot?:boolean; |
31 |
| - mark?:boolean; |
32 |
| - nounique?:boolean; |
33 |
| - nonull?:boolean; |
34 |
| - nosort?:boolean; |
35 |
| - nocase?:boolean; |
36 |
| - stat?:boolean; |
37 |
| - debug?:boolean; |
38 |
| - globDebug?:boolean; |
39 |
| - silent?:boolean; |
| 36 | + cache?: { [path: string]: any /* boolean | string | string[] */ }; |
| 37 | + statCache?: { [path: string]: fs.Stats }; |
| 38 | + symlinks?: any; |
| 39 | + sync?: boolean; |
| 40 | + nounique?: boolean; |
| 41 | + nonull?: boolean; |
| 42 | + debug?: boolean; |
| 43 | + nobrace?: boolean; |
| 44 | + noglobstar?: boolean; |
| 45 | + noext?: boolean; |
| 46 | + nocase?: boolean; |
| 47 | + matchBase?: any; |
| 48 | + nodir?: boolean; |
| 49 | + ignore?: any; /* string | string[] */ |
| 50 | + follow?: boolean; |
| 51 | + realpath?: boolean; |
| 52 | + nonegate?: boolean; |
| 53 | + nocomment?: boolean; |
| 54 | + |
| 55 | + /** Deprecated. */ |
| 56 | + globDebug?: boolean; |
40 | 57 | }
|
41 | 58 |
|
42 | 59 | interface IGlobStatic extends events.EventEmitter {
|
43 |
| - new (pattern:string, cb?:(err:Error, matches:string[])=>void):IGlob; |
44 |
| - new (pattern:string, options:any, cb?:(err:Error, matches:string[])=>void):IGlob; |
| 60 | + new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob; |
| 61 | + new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob; |
| 62 | + prototype: IGlob; |
| 63 | + } |
| 64 | + |
| 65 | + interface IGlobSyncStatic { |
| 66 | + new (pattern: string, options?: IOptions): IGlobBase |
| 67 | + prototype: IGlobBase; |
45 | 68 | }
|
46 | 69 |
|
47 |
| - interface IGlob { |
48 |
| - EOF:any; |
49 |
| - paused:boolean; |
50 |
| - maxDepth:number; |
51 |
| - maxLength:number; |
52 |
| - cache:any; |
53 |
| - statCache:any; |
54 |
| - changedCwd:boolean; |
| 70 | + interface IGlobBase { |
| 71 | + minimatch: minimatch.IMinimatch; |
| 72 | + options: IOptions; |
| 73 | + aborted: boolean; |
| 74 | + cache: { [path: string]: any /* boolean | string | string[] */ }; |
| 75 | + statCache: { [path: string]: fs.Stats }; |
| 76 | + symlinks: { [path: string]: boolean }; |
| 77 | + realpathCache: { [path: string]: string }; |
| 78 | + found: string[]; |
| 79 | + } |
| 80 | + |
| 81 | + interface IGlob extends IGlobBase, events.EventEmitter { |
| 82 | + pause(): void; |
| 83 | + resume(): void; |
| 84 | + abort(): void; |
| 85 | + |
| 86 | + /** Deprecated. */ |
| 87 | + EOF: any; |
| 88 | + /** Deprecated. */ |
| 89 | + paused: boolean; |
| 90 | + /** Deprecated. */ |
| 91 | + maxDepth: number; |
| 92 | + /** Deprecated. */ |
| 93 | + maxLength: number; |
| 94 | + /** Deprecated. */ |
| 95 | + changedCwd: boolean; |
| 96 | + /** Deprecated. */ |
55 | 97 | cwd: string;
|
| 98 | + /** Deprecated. */ |
56 | 99 | root: string;
|
| 100 | + /** Deprecated. */ |
57 | 101 | error: any;
|
58 |
| - aborted: boolean; |
59 |
| - minimatch: minimatch.IMinimatch; |
60 |
| - matches:string[]; |
61 |
| - |
62 |
| - log(...args:any[]):void; |
63 |
| - abort():void; |
64 |
| - pause():void; |
65 |
| - resume():void; |
66 |
| - emitMatch(m:any):void; |
| 102 | + /** Deprecated. */ |
| 103 | + matches: string[]; |
| 104 | + /** Deprecated. */ |
| 105 | + log(...args: any[]): void; |
| 106 | + /** Deprecated. */ |
| 107 | + emitMatch(m: any): void; |
67 | 108 | }
|
68 | 109 | }
|
69 | 110 |
|
70 |
| -export = G; |
| 111 | + export = G; |
71 | 112 | }
|
0 commit comments