index.d.ts 3.9 KB

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