diff --git a/types/rollup-plugin-buble/index.d.ts b/types/rollup-plugin-buble/index.d.ts new file mode 100644 index 0000000000..d6e3414346 --- /dev/null +++ b/types/rollup-plugin-buble/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for rollup-plugin-buble 0.19 +// Project: https://github.com/rollup/rollup-plugin-buble#readme +// Definitions by: Hugo Alliaume +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Plugin } from 'rollup'; +import { TransformOptions } from 'buble'; + +export interface Options extends TransformOptions { + // Every files will be parsed by default, but you can specify which files to include or exclude + include?: Array | string | RegExp | null; + exclude?: Array | string | RegExp | null; +} + +export default function buble(options?: Options): Plugin; diff --git a/types/rollup-plugin-buble/package.json b/types/rollup-plugin-buble/package.json new file mode 100644 index 0000000000..ee69ca3cd2 --- /dev/null +++ b/types/rollup-plugin-buble/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "rollup": "^0.63.4" + } +} diff --git a/types/rollup-plugin-buble/rollup-plugin-buble-tests.ts b/types/rollup-plugin-buble/rollup-plugin-buble-tests.ts new file mode 100644 index 0000000000..d020539f8b --- /dev/null +++ b/types/rollup-plugin-buble/rollup-plugin-buble-tests.ts @@ -0,0 +1,57 @@ +import buble from 'rollup-plugin-buble'; + +// No options (default) +(() => { + // $ExpectType Plugin + buble(); +})(); + +// With every options +(() => { + // $ExpectType Plugin + buble({ + target: { + chrome: 71, + firefox: 64, + }, + objectAssign: true, + transforms: { + arrow: true, + classes: false, + collections: true, + computedProperty: false, + conciseMethodProperty: true, + constLoop: false, + dangerousForOf: true, + dangerousTaggedTemplateString: false, + defaultParameter: true, + destructuring: false, + forOf: true, + generator: false, + letConst: true, + modules: false, + numericLiteral: true, + parameterDestructuring: false, + reservedProperties: true, + spreadRest: false, + stickyRegExp: true, + templateString: false, + unicodeRegExp: true, + } + }); +})(); + +// Filter files +(() => { + // $ExpectType Plugin + buble({ + include: '*.js', + exclude: '*.js', + }); + + // $ExpectType Plugin + buble({ + include: /.js$/, + exclude: ['foo.js', 'bar.js'], + }); +})(); diff --git a/types/rollup-plugin-buble/tsconfig.json b/types/rollup-plugin-buble/tsconfig.json new file mode 100644 index 0000000000..80dec6b110 --- /dev/null +++ b/types/rollup-plugin-buble/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rollup-plugin-buble-tests.ts" + ] +} diff --git a/types/rollup-plugin-buble/tslint.json b/types/rollup-plugin-buble/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rollup-plugin-buble/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }