UNPKG

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