You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.3KB

  1. // IncludeOptions definitions copied from minimatch (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/minimatch/index.d.ts)
  2. interface IncludeOptions {
  3. /**
  4. * Dump a ton of stuff to stderr.
  5. *
  6. * @default false
  7. */
  8. debug?: boolean;
  9. /**
  10. * Do not expand {a,b} and {1..3} brace sets.
  11. *
  12. * @default false
  13. */
  14. nobrace?: boolean;
  15. /**
  16. * Disable ** matching against multiple folder names.
  17. *
  18. * @default false
  19. */
  20. noglobstar?: boolean;
  21. /**
  22. * Allow patterns to match filenames starting with a period,
  23. * even if the pattern does not explicitly have a period in that spot.
  24. *
  25. * @default false
  26. */
  27. dot?: boolean;
  28. /**
  29. * Disable "extglob" style patterns like +(a|b).
  30. *
  31. * @default false
  32. */
  33. noext?: boolean;
  34. /**
  35. * Perform a case-insensitive match.
  36. *
  37. * @default false
  38. */
  39. nocase?: boolean;
  40. /**
  41. * When a match is not found by minimatch.match,
  42. * return a list containing the pattern itself if this option is set.
  43. * Otherwise, an empty list is returned if there are no matches.
  44. *
  45. * @default false
  46. */
  47. nonull?: boolean;
  48. /**
  49. * If set, then patterns without slashes will be matched against
  50. * the basename of the path if it contains slashes.
  51. *
  52. * @default false
  53. */
  54. matchBase?: boolean;
  55. /**
  56. * Suppress the behavior of treating #
  57. * at the start of a pattern as a comment.
  58. *
  59. * @default false
  60. */
  61. nocomment?: boolean;
  62. /**
  63. * Suppress the behavior of treating a leading ! character as negation.
  64. *
  65. * @default false
  66. */
  67. nonegate?: boolean;
  68. /**
  69. * Returns from negate expressions the same as if they were not negated.
  70. * (Ie, true on a hit, false on a miss.)
  71. *
  72. * @default false
  73. */
  74. flipNegate?: boolean;
  75. }
  76. export class FileList {
  77. static clone(): FileList
  78. static verbose: boolean
  79. }
  80. export interface FileList extends Omit<Array<string>, "length"> {
  81. pendingAdd: string[]
  82. pending: boolean
  83. excludes: {
  84. pats: RegExp[],
  85. funcs: Function[],
  86. regex: null | RegExp
  87. }
  88. items: string[]
  89. toArray(): string[]
  90. include(...items: string[]): this
  91. include(...items: (IncludeOptions | string)[]): this
  92. exclude(...items: string[]): this
  93. shouldExclude(item: string): boolean
  94. resolve(): this
  95. clearInclusions(): this
  96. clearExclusions(): this
  97. length(): number
  98. }