minimatch.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Type definitions for Minimatch 2.0.8
  2. // Project: https://github.com/isaacs/minimatch
  3. // Definitions by: vvakame <https://github.com/vvakame/>
  4. // Definitions: https://github.com/borisyankov/DefinitelyTyped
  5. declare module "minimatch" {
  6. function M(target: string, pattern: string, options?: M.IOptions): boolean;
  7. module M {
  8. function match(list: string[], pattern: string, options?: IOptions): string[];
  9. function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean;
  10. function makeRe(pattern: string, options?: IOptions): RegExp;
  11. var Minimatch: IMinimatchStatic;
  12. interface IOptions {
  13. debug?: boolean;
  14. nobrace?: boolean;
  15. noglobstar?: boolean;
  16. dot?: boolean;
  17. noext?: boolean;
  18. nocase?: boolean;
  19. nonull?: boolean;
  20. matchBase?: boolean;
  21. nocomment?: boolean;
  22. nonegate?: boolean;
  23. flipNegate?: boolean;
  24. }
  25. interface IMinimatchStatic {
  26. new (pattern: string, options?: IOptions): IMinimatch;
  27. prototype: IMinimatch;
  28. }
  29. interface IMinimatch {
  30. pattern: string;
  31. options: IOptions;
  32. /** 2-dimensional array of regexp or string expressions. */
  33. set: any[][]; // (RegExp | string)[][]
  34. regexp: RegExp;
  35. negate: boolean;
  36. comment: boolean;
  37. empty: boolean;
  38. makeRe(): RegExp; // regexp or boolean
  39. match(fname: string): boolean;
  40. matchOne(files: string[], pattern: string[], partial: boolean): boolean;
  41. /** Deprecated. For internal use. */
  42. debug(): void;
  43. /** Deprecated. For internal use. */
  44. make(): void;
  45. /** Deprecated. For internal use. */
  46. parseNegate(): void;
  47. /** Deprecated. For internal use. */
  48. braceExpand(pattern: string, options: IOptions): void;
  49. /** Deprecated. For internal use. */
  50. parse(pattern: string, isSub?: boolean): void;
  51. }
  52. }
  53. export = M;
  54. }