index.d.ts 6.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { Minipass } from 'minipass';
  2. import { Path } from 'path-scurry';
  3. import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
  4. import { Glob } from './glob.js';
  5. export { escape, unescape } from 'minimatch';
  6. export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
  7. export { Glob } from './glob.js';
  8. export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
  9. export { hasMagic } from './has-magic.js';
  10. export { Ignore } from './ignore.js';
  11. export type { IgnoreLike } from './ignore.js';
  12. export type { MatchStream } from './walker.js';
  13. /**
  14. * Syncronous form of {@link globStream}. Will read all the matches as fast as
  15. * you consume them, even all in a single tick if you consume them immediately,
  16. * but will still respond to backpressure if they're not consumed immediately.
  17. */
  18. export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
  19. export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
  20. export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
  21. export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
  22. /**
  23. * Return a stream that emits all the strings or `Path` objects and
  24. * then emits `end` when completed.
  25. */
  26. export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
  27. export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
  28. export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
  29. export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
  30. /**
  31. * Synchronous form of {@link glob}
  32. */
  33. export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
  34. export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
  35. export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
  36. export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
  37. /**
  38. * Perform an asynchronous glob search for the pattern(s) specified. Returns
  39. * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
  40. * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
  41. * full option descriptions.
  42. */
  43. declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
  44. declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
  45. declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
  46. declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
  47. /**
  48. * Return a sync iterator for walking glob pattern matches.
  49. */
  50. export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
  51. export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
  52. export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
  53. export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
  54. /**
  55. * Return an async iterator for walking glob pattern matches.
  56. */
  57. export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
  58. export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
  59. export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
  60. export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
  61. export declare const streamSync: typeof globStreamSync;
  62. export declare const stream: typeof globStream & {
  63. sync: typeof globStreamSync;
  64. };
  65. export declare const iterateSync: typeof globIterateSync;
  66. export declare const iterate: typeof globIterate & {
  67. sync: typeof globIterateSync;
  68. };
  69. export declare const sync: typeof globSync & {
  70. stream: typeof globStreamSync;
  71. iterate: typeof globIterateSync;
  72. };
  73. export declare const glob: typeof glob_ & {
  74. glob: typeof glob_;
  75. globSync: typeof globSync;
  76. sync: typeof globSync & {
  77. stream: typeof globStreamSync;
  78. iterate: typeof globIterateSync;
  79. };
  80. globStream: typeof globStream;
  81. stream: typeof globStream & {
  82. sync: typeof globStreamSync;
  83. };
  84. globStreamSync: typeof globStreamSync;
  85. streamSync: typeof globStreamSync;
  86. globIterate: typeof globIterate;
  87. iterate: typeof globIterate & {
  88. sync: typeof globIterateSync;
  89. };
  90. globIterateSync: typeof globIterateSync;
  91. iterateSync: typeof globIterateSync;
  92. Glob: typeof Glob;
  93. hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
  94. escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape">) => string;
  95. unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape">) => string;
  96. };
  97. //# sourceMappingURL=index.d.ts.map