-
-
Notifications
You must be signed in to change notification settings - Fork 754
/
Copy pathresolve-module.d.cts
34 lines (34 loc) · 1.16 KB
/
resolve-module.d.cts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export type RequireResolveOptions = {
/**
* Additional paths to resolve from.
*/
paths?: string[];
};
export type RequireResolve = (id: string, options: RequireResolveOptions) => string;
/**
* Resolves modules according to Node's resolution rules.
*
* @param {string} id Module name or path.
* @param {string[]} [paths] Additional paths to resolve from.
* @returns {string} Resolved module path.
*/
export function resolveModule(id: string, paths?: string[]): string;
/**
* @typedef RequireResolveOptions
* @property {string[]} [paths] Additional paths to resolve from.
*/
/**
* @callback RequireResolve
* @param {string} id Module name or path.
* @param {RequireResolveOptions} options Options to apply.
* @returns {string} Resolved module path.
*/
/**
* Resolves modules according to Node's resolution rules.
*
* @param {RequireResolve} resolve Node-like require.resolve implementation.
* @param {string} id Module name or path.
* @param {string[]} [paths] Additional paths to resolve from.
* @returns {string} Resolved module path.
*/
export function resolveModuleCustomResolve(resolve: RequireResolve, id: string, paths?: string[]): string;