UNPKG

2.18 kBTypeScriptView Raw
1/// <reference types="node" />
2import * as taskManager from './managers/tasks';
3import { Options as OptionsInternal } from './settings';
4import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types';
5type EntryObjectModePredicate = {
6 [TKey in keyof Pick<OptionsInternal, 'objectMode'>]-?: true;
7};
8type EntryStatsPredicate = {
9 [TKey in keyof Pick<OptionsInternal, 'stats'>]-?: true;
10};
11type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
12declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise<EntryInternal[]>;
13declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise<string[]>;
14declare namespace FastGlob {
15 type Options = OptionsInternal;
16 type Entry = EntryInternal;
17 type Task = taskManager.Task;
18 type Pattern = PatternInternal;
19 type FileSystemAdapter = FileSystemAdapterInternal;
20 const glob: typeof FastGlob;
21 const globSync: typeof sync;
22 const globStream: typeof stream;
23 const async: typeof FastGlob;
24 function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[];
25 function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[];
26 function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream;
27 function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[];
28 function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean;
29 function escapePath(source: string): PatternInternal;
30 function convertPathToPattern(source: string): PatternInternal;
31 namespace posix {
32 function escapePath(source: string): PatternInternal;
33 function convertPathToPattern(source: string): PatternInternal;
34 }
35 namespace win32 {
36 function escapePath(source: string): PatternInternal;
37 function convertPathToPattern(source: string): PatternInternal;
38 }
39}
40export = FastGlob;