Skip to content

Commit

Permalink
Merge branch 'gkong/node-module-flow' of github.com:parcel-bundler/pa…
Browse files Browse the repository at this point in the history
…rcel into gkong/node-module-flow
  • Loading branch information
gorakong committed Nov 19, 2020
2 parents da5c43e + 15623e8 commit 2b1e3d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions flow-libs/module.js.flow
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//@flow strict-local

// Derived from the README and source of json-source-map located at
// https://github.com/epoberezkin/json-source-map and
// Derived from the documentation and source of Module located at
// https://nodejs.org/api/module.html#module_modules_module_api and
// https://github.com/nodejs/node/blob/cbfa2d11d4e42ea7f6a847a6930fd1022773252e/lib/internal/modules/cjs/loader.js/
// Which is licensed MIT

declare module 'module' {
declare type FilePath = string;

declare export default class Module {
constructor(id: FilePath, parent?: Module): void;
id: string;
path: FilePath;
exports: {|[export: string]: mixed|};
Expand All @@ -22,6 +23,10 @@ declare module 'module' {
createRequire(fileName: string): (id: string) => mixed;
syncBuiltinESMExports(): void;

static runMain(): void;

static wrap(code: string): string;

static _cache: {|[key: FilePath]: Module|};

static _pathCache: {|[cacheKey: string]: FilePath|};
Expand Down Expand Up @@ -59,7 +64,5 @@ declare module 'module' {
static _initPaths(): void;

static findPnpApi(lookupSource: string): PnpApi | null;

constructor(id: FilePath, parent: Module): Module;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b1e3d6

Please sign in to comment.