-
-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathmodule.d.ts
47 lines (38 loc) · 989 Bytes
/
module.d.ts
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
35
36
37
38
39
40
41
42
43
44
45
46
47
import 'node:module';
declare global {
namespace NodeJS {
export interface Module {
_compile(code: string, filename: string): string;
}
}
}
declare module 'module' {
// https://nodejs.org/api/module.html#loadurl-context-nextload
interface LoadHookContext {
importAttributes: ImportAssertions;
}
// CommonJS
export const _extensions: NodeJS.RequireExtensions;
export const _cache: NodeJS.Require['cache'];
export type Parent = {
id: string;
/**
* Can be null if the parent id is 'internal/preload' (e.g. via --require)
* which doesn't have a file path.
*/
filename: string | null;
path: string;
paths: string[];
};
export function _resolveFilename(
request: string,
parent: Parent | undefined,
isMain?: boolean,
options?: Record<PropertyKey, unknown>,
): string;
export function _nodeModulePaths(path: string): string[];
interface LoadFnOutput {
// Added in https://github.com/nodejs/node/pull/43164
responseURL?: string;
}
}