UNPKG

882 BTypeScriptView Raw
1// Type definitions for esm 3.2
2// Project: https://github.com/standard-things/esm#readme
3// Definitions by: Richie Bendall <https://github.com/Richienb>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node"/>
7
8declare namespace Options {
9 interface Esm {
10 cache: boolean;
11 esModule: boolean;
12 extensions: boolean;
13 mutableNamespace: boolean;
14 namedExports: boolean;
15 paths: boolean;
16 vars: boolean;
17 dedefault: boolean;
18 topLevelReturn: boolean;
19 }
20
21 interface Options {
22 cjs: boolean | Partial<Esm>;
23 mainFields: string[];
24 mode: "auto" | "all" | "strict";
25 await: boolean;
26 force: boolean;
27 wasm: boolean;
28 }
29}
30
31declare function esm(mod: typeof module, options?: Partial<Options.Options>): typeof require;
32export = esm;