UNPKG

6.17 kBTypeScriptView Raw
1import { Minipass } from 'minipass';
2import { Path } from 'path-scurry';
3import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
4import { Glob } from './glob.js';
5export { escape, unescape } from 'minimatch';
6export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
7export { Glob } from './glob.js';
8export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
9export { hasMagic } from './has-magic.js';
10export { Ignore } from './ignore.js';
11export type { IgnoreLike } from './ignore.js';
12export 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 */
18export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
19export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
20export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
21export 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 */
26export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
27export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
28export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
29export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
30/**
31 * Synchronous form of {@link glob}
32 */
33export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
34export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
35export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
36export 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 */
43declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
44declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
45declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
46declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
47/**
48 * Return a sync iterator for walking glob pattern matches.
49 */
50export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
51export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
52export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
53export 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 */
57export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
58export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
59export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
60export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
61export declare const streamSync: typeof globStreamSync;
62export declare const stream: typeof globStream & {
63 sync: typeof globStreamSync;
64};
65export declare const iterateSync: typeof globIterateSync;
66export declare const iterate: typeof globIterate & {
67 sync: typeof globIterateSync;
68};
69export declare const sync: typeof globSync & {
70 stream: typeof globStreamSync;
71 iterate: typeof globIterateSync;
72};
73export 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"> | undefined) => string;
95 unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
96};
97//# sourceMappingURL=index.d.ts.map
\No newline at end of file