diff --git a/src/index.ts b/src/index.ts index 8e5a3dd2..b0bc33b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,19 +3,17 @@ import ProviderAsync from './providers/async'; import Provider from './providers/provider'; import ProviderStream from './providers/stream'; import ProviderSync from './providers/sync'; -import Settings, { Options } from './settings'; -import { Entry, EntryItem, Pattern } from './types/index'; +import Settings, { Options as OptionsInternal } from './settings'; +import { Entry as EntryInternal, EntryItem, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types/index'; import * as utils from './utils/index'; -type Task = taskManager.Task; - -type EntryObjectModePredicate = { [P in keyof Pick]-?: true }; -type EntryStatsPredicate = { [P in keyof Pick]-?: true }; +type EntryObjectModePredicate = { [P in keyof Pick]-?: true }; +type EntryStatsPredicate = { [P in keyof Pick]-?: true }; type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate; -function FastGlob(source: Pattern | Pattern[], options: Options & EntryObjectPredicate): Promise; -function FastGlob(source: Pattern | Pattern[], options?: Options): Promise; -function FastGlob(source: Pattern | Pattern[], options?: Options): Promise { +function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise; +function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise; +function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise { try { assertPatternsInput(source); } catch (error) { @@ -28,9 +26,15 @@ function FastGlob(source: Pattern | Pattern[], options?: Options): Promise(source: Pattern | Pattern[], _Provider: new (settings: Settings) => Provider, options?: Options): T[] { - const patterns = ([] as Pattern[]).concat(source); +function getWorks(source: PatternInternal | PatternInternal[], _Provider: new (settings: Settings) => Provider, options?: OptionsInternal): T[] { + const patterns = ([] as PatternInternal[]).concat(source); const settings = new Settings(options); const tasks = taskManager.generate(patterns, settings);