UNPKG

1.12 kBTypeScriptView Raw
1import * as MappingEntry from "./mapping-entry";
2import * as Filesystem from "./filesystem";
3/**
4 * Function that can match a path async
5 */
6export interface MatchPathAsync {
7 (requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: ReadonlyArray<string> | undefined, callback: MatchPathAsyncCallback): void;
8}
9export interface MatchPathAsyncCallback {
10 (err?: Error, path?: string): void;
11}
12/**
13 * See the sync version for docs.
14 */
15export declare function createMatchPathAsync(absoluteBaseUrl: string, paths: {
16 [key: string]: Array<string>;
17}, mainFields?: (string | string[])[], addMatchAll?: boolean): MatchPathAsync;
18/**
19 * See the sync version for docs.
20 */
21export declare function matchFromAbsolutePathsAsync(absolutePathMappings: ReadonlyArray<MappingEntry.MappingEntry>, requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: readonly string[] | undefined, callback: MatchPathAsyncCallback, mainFields?: (string | string[])[]): void;