diff --git a/types/babel__plugin-transform-runtime/babel__plugin-transform-runtime-tests.ts b/types/babel__plugin-transform-runtime/babel__plugin-transform-runtime-tests.ts new file mode 100644 index 0000000000..dc2f439930 --- /dev/null +++ b/types/babel__plugin-transform-runtime/babel__plugin-transform-runtime-tests.ts @@ -0,0 +1,95 @@ +/* tslint:disable:no-consecutive-blank-lines comment-format */ + +import { Options } from '@babel/plugin-transform-runtime'; + + +//========// +// COREJS // +//========// + +let options: Options = { + corejs: 2, +}; + +options = { + corejs: 3, +}; + +options = { + corejs: { + version: 2, + proposals: true, + }, +}; + +options = { + corejs: { + version: 3, + proposals: false, + }, +}; + + +//=========// +// HELPERS // +//=========// + +options = { + helpers: true, +}; + +options = { + helpers: false, +}; + + +//=============// +// REGENERATOR // +//=============// + +options = { + regenerator: true, +}; + +options = { + regenerator: false, +}; + + +//================// +// USE ES MODULES // +//================// + +options = { + useESModules: true, +}; + +options = { + useESModules: false, +}; + + +//==================// +// ABSOLUTE RUNTIME // +//==================// + +options = { + absoluteRuntime: true, +}; + +options = { + absoluteRuntime: false, +}; + +options = { + absoluteRuntime: '/some/path/here', +}; + + +//=========// +// VERSION // +//=========// + +options = { + version: '^1.2.3', +}; diff --git a/types/babel__plugin-transform-runtime/index.d.ts b/types/babel__plugin-transform-runtime/index.d.ts new file mode 100644 index 0000000000..6763af19a7 --- /dev/null +++ b/types/babel__plugin-transform-runtime/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for @babel/plugin-transform-runtime 7.9 +// Project: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime, https://babeljs.io/docs/en/babel-plugin-transform-runtime +// Definitions by: Slava Fomin II +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + corejs?: CorejsOption; + helpers?: boolean; + regenerator?: boolean; + useESModules?: boolean; + absoluteRuntime?: (boolean | string); + version?: string; +} + +export type CorejsOption = ( + | CorejsVersion + | { version: CorejsVersion, proposals: boolean } + | false +); + +export type CorejsVersion = (2 | 3); diff --git a/types/babel__plugin-transform-runtime/tsconfig.json b/types/babel__plugin-transform-runtime/tsconfig.json new file mode 100644 index 0000000000..1b3efc52e0 --- /dev/null +++ b/types/babel__plugin-transform-runtime/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "strict": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/plugin-transform-runtime": [ + "babel__plugin-transform-runtime" + ] + } + }, + "files": [ + "index.d.ts", + "babel__plugin-transform-runtime-tests.ts" + ] +} diff --git a/types/babel__plugin-transform-runtime/tslint.json b/types/babel__plugin-transform-runtime/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/babel__plugin-transform-runtime/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}