Merge pull request #32598 from vladshcherbin/rollup-plugin-delete

[rollup-plugin-delete] Add types
This commit is contained in:
Pranav Senthilnathan
2019-01-30 16:12:50 -08:00
committed by GitHub
5 changed files with 67 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for rollup-plugin-delete 0.2
// Project: https://github.com/vladshcherbin/rollup-plugin-delete#readme
// Definitions by: Vlad Shcherbin <https://github.com/vladshcherbin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import del = require('del');
import { Plugin } from 'rollup';
export interface Options extends del.Options {
/**
* Patterns of files and folders to be deleted.
* @default []
*/
readonly targets: ReadonlyArray<string> | string;
/**
* Outputs removed files and folders to console.
* @default false
*/
readonly verbose?: boolean;
}
export default function(options?: Options): Plugin;
+6
View File
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"rollup": ">=0.60.0"
}
}
@@ -0,0 +1,13 @@
import del from 'rollup-plugin-delete';
del(); // $ExpectType Plugin
del({}); // $ExpectError
del({ targets: '/dist' }); // $ExpectType Plugin
del({ targets: ['/dist'], verbose: true }); // $ExpectType Plugin
del({ targets: ['/dist'], verbose: true, dryRun: true }); // $ExpectType Plugin
del({ targets: ['/dist'], verbose: true, dryRun: true, debug: true }); // $ExpectType Plugin
+23
View 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-delete-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }