mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-30 23:30:06 +00:00
feat: add type for "rollup-plugin-buble"
This commit is contained in:
18
types/rollup-plugin-buble/index.d.ts
vendored
Normal file
18
types/rollup-plugin-buble/index.d.ts
vendored
Normal file
@@ -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 <https://github.com/Kocal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
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> | string | RegExp | null;
|
||||
exclude?: Array<string | RegExp> | string | RegExp | null;
|
||||
}
|
||||
|
||||
export default function buble(options?: Options): Plugin;
|
||||
6
types/rollup-plugin-buble/package.json
Normal file
6
types/rollup-plugin-buble/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"rollup": "^0.63.4"
|
||||
}
|
||||
}
|
||||
57
types/rollup-plugin-buble/rollup-plugin-buble-tests.ts
Normal file
57
types/rollup-plugin-buble/rollup-plugin-buble-tests.ts
Normal file
@@ -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'],
|
||||
});
|
||||
})();
|
||||
23
types/rollup-plugin-buble/tsconfig.json
Normal file
23
types/rollup-plugin-buble/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/rollup-plugin-buble/tslint.json
Normal file
1
types/rollup-plugin-buble/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user