mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
feat: Add typings for esm (#41293)
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
committed by
Armando Aguirre
parent
e816b95a87
commit
c4d3560712
@@ -0,0 +1,3 @@
|
||||
import esm = require("esm");
|
||||
|
||||
esm(exports); // $ExpectType Require
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// Type definitions for esm 3.2
|
||||
// Project: https://github.com/standard-things/esm#readme
|
||||
// Definitions by: Richie Bendall <https://github.com/Richienb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
declare namespace Options {
|
||||
interface Esm {
|
||||
cache: boolean;
|
||||
esModule: boolean;
|
||||
extensions: boolean;
|
||||
mutableNamespace: boolean;
|
||||
namedExports: boolean;
|
||||
paths: boolean;
|
||||
vars: boolean;
|
||||
dedefault: boolean;
|
||||
topLevelReturn: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
cjs: boolean | Partial<Esm>;
|
||||
mainFields: string[];
|
||||
mode: "auto" | "all" | "strict";
|
||||
await: boolean;
|
||||
force: boolean;
|
||||
wasm: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare function esm(mod: typeof module, options?: Partial<Options.Options>): typeof require;
|
||||
export = esm;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"esm-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user