mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Add process.mainModule, improve NodeModule (#12257)
* Add process.mainModule, improve NodeModule Add mainModule in process. See https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_process_mainmodule improve require.main see https://nodejs.org/dist/latest-v6.x/docs/api/modules.html#modules_accessing_the_main_module improve NodeModule see https://nodejs.org/dist/latest-v6.x/docs/api/modules.html#modules_module_children and https://nodejs.org/dist/latest-v6.x/docs/api/modules.html#modules_module_parent * Correct require.main and NodeModule
This commit is contained in:
7
node/node-4.d.ts
vendored
7
node/node-4.d.ts
vendored
@@ -52,7 +52,7 @@ interface NodeRequire extends NodeRequireFunction {
|
||||
resolve(id:string): string;
|
||||
cache: any;
|
||||
extensions: any;
|
||||
main: any;
|
||||
main: NodeModule;
|
||||
}
|
||||
|
||||
declare var require: NodeRequire;
|
||||
@@ -63,8 +63,8 @@ interface NodeModule {
|
||||
id: string;
|
||||
filename: string;
|
||||
loaded: boolean;
|
||||
parent: any;
|
||||
children: any[];
|
||||
parent: NodeModule;
|
||||
children: NodeModule[];
|
||||
}
|
||||
|
||||
declare var module: NodeModule;
|
||||
@@ -339,6 +339,7 @@ declare namespace NodeJS {
|
||||
title: string;
|
||||
arch: string;
|
||||
platform: string;
|
||||
mainModule?: NodeModule;
|
||||
memoryUsage(): MemoryUsage;
|
||||
nextTick(callback: Function): void;
|
||||
umask(mask?: number): number;
|
||||
|
||||
Reference in New Issue
Block a user