mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add support for node 12.2 module.createRequire(filename) method (#39209)
* Add support for module.createRequire(filename) method and deprecated createRequireFromPath(). Use NodeRequireFunction as return type for createRequireFromPath and createRequire * update version * add url parameter * remove url parameter
This commit is contained in:
committed by
Andrew Branch
parent
b0503ac105
commit
4a4375a3ac
7
types/node/globals.d.ts
vendored
7
types/node/globals.d.ts
vendored
@@ -1132,7 +1132,12 @@ declare namespace NodeJS {
|
||||
class Module {
|
||||
static runMain(): void;
|
||||
static wrap(code: string): string;
|
||||
static createRequireFromPath(path: string): (path: string) => any;
|
||||
|
||||
/**
|
||||
* @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
|
||||
*/
|
||||
static createRequireFromPath(path: string): NodeRequireFunction;
|
||||
static createRequire(path: string): NodeRequireFunction;
|
||||
static builtinModules: string[];
|
||||
|
||||
static Module: typeof Module;
|
||||
|
||||
Reference in New Issue
Block a user