index.d.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
  2. export interface MinimatchOptions {
  3. nobrace?: boolean;
  4. nocomment?: boolean;
  5. nonegate?: boolean;
  6. debug?: boolean;
  7. noglobstar?: boolean;
  8. noext?: boolean;
  9. nonull?: boolean;
  10. windowsPathsNoEscape?: boolean;
  11. allowWindowsEscape?: boolean;
  12. partial?: boolean;
  13. dot?: boolean;
  14. nocase?: boolean;
  15. nocaseMagicOnly?: boolean;
  16. magicalBraces?: boolean;
  17. matchBase?: boolean;
  18. flipNegate?: boolean;
  19. preserveMultipleSlashes?: boolean;
  20. optimizationLevel?: number;
  21. platform?: Platform;
  22. windowsNoMagicRoot?: boolean;
  23. }
  24. export declare const minimatch: {
  25. (p: string, pattern: string, options?: MinimatchOptions): boolean;
  26. sep: Sep;
  27. GLOBSTAR: typeof GLOBSTAR;
  28. filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
  29. defaults: (def: MinimatchOptions) => typeof minimatch;
  30. braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
  31. makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
  32. match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
  33. Minimatch: typeof Minimatch;
  34. escape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
  35. unescape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
  36. };
  37. export default minimatch;
  38. type Sep = '\\' | '/';
  39. export declare const sep: Sep;
  40. export declare const GLOBSTAR: unique symbol;
  41. export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
  42. export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
  43. export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
  44. export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
  45. export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
  46. export type MMRegExp = RegExp & {
  47. _src?: string;
  48. _glob?: string;
  49. };
  50. type SubparseReturn = [string, boolean];
  51. type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
  52. type ParseReturn = ParseReturnFiltered | false;
  53. export declare class Minimatch {
  54. options: MinimatchOptions;
  55. set: ParseReturnFiltered[][];
  56. pattern: string;
  57. windowsPathsNoEscape: boolean;
  58. nonegate: boolean;
  59. negate: boolean;
  60. comment: boolean;
  61. empty: boolean;
  62. preserveMultipleSlashes: boolean;
  63. partial: boolean;
  64. globSet: string[];
  65. globParts: string[][];
  66. nocase: boolean;
  67. isWindows: boolean;
  68. platform: Platform;
  69. windowsNoMagicRoot: boolean;
  70. regexp: false | null | MMRegExp;
  71. constructor(pattern: string, options?: MinimatchOptions);
  72. hasMagic(): boolean;
  73. debug(..._: any[]): void;
  74. make(): void;
  75. preprocess(globParts: string[][]): string[][];
  76. adjascentGlobstarOptimize(globParts: string[][]): string[][];
  77. levelOneOptimize(globParts: string[][]): string[][];
  78. levelTwoFileOptimize(parts: string | string[]): string[];
  79. firstPhasePreProcess(globParts: string[][]): string[][];
  80. secondPhasePreProcess(globParts: string[][]): string[][];
  81. partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
  82. parseNegate(): void;
  83. matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
  84. braceExpand(): string[];
  85. parse(pattern: string): ParseReturn | SubparseReturn;
  86. makeRe(): false | MMRegExp;
  87. slashSplit(p: string): string[];
  88. match(f: string, partial?: boolean): boolean;
  89. static defaults(def: MinimatchOptions): typeof Minimatch;
  90. }
  91. export { escape } from './escape.js';
  92. export { unescape } from './unescape.js';
  93. //# sourceMappingURL=index.d.ts.map