glob.d.ts 2.8 KB

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