From 00b0305f7eeaec761670a202b0d35cf3d9dba9ae Mon Sep 17 00:00:00 2001 From: Vlad Shcherbin Date: Tue, 29 Jan 2019 22:41:56 +0300 Subject: [PATCH 1/2] Add rollup-plugin-delete types --- types/rollup-plugin-delete/index.d.ts | 24 +++++++++++++++++++ types/rollup-plugin-delete/package.json | 7 ++++++ .../rollup-plugin-delete-tests.ts | 13 ++++++++++ types/rollup-plugin-delete/tsconfig.json | 23 ++++++++++++++++++ types/rollup-plugin-delete/tslint.json | 1 + 5 files changed, 68 insertions(+) create mode 100644 types/rollup-plugin-delete/index.d.ts create mode 100644 types/rollup-plugin-delete/package.json create mode 100644 types/rollup-plugin-delete/rollup-plugin-delete-tests.ts create mode 100644 types/rollup-plugin-delete/tsconfig.json create mode 100644 types/rollup-plugin-delete/tslint.json diff --git a/types/rollup-plugin-delete/index.d.ts b/types/rollup-plugin-delete/index.d.ts new file mode 100644 index 0000000000..9f9cfe020d --- /dev/null +++ b/types/rollup-plugin-delete/index.d.ts @@ -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 +// 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; + + /** + * Outputs removed files and folders to console. + * @default false + */ + readonly verbose?: boolean; +} + +export default function(options?: Options): Plugin; diff --git a/types/rollup-plugin-delete/package.json b/types/rollup-plugin-delete/package.json new file mode 100644 index 0000000000..8daa001274 --- /dev/null +++ b/types/rollup-plugin-delete/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "@types/del": "^3.0.1", + "rollup": ">=0.60.0" + } +} diff --git a/types/rollup-plugin-delete/rollup-plugin-delete-tests.ts b/types/rollup-plugin-delete/rollup-plugin-delete-tests.ts new file mode 100644 index 0000000000..eff3508e29 --- /dev/null +++ b/types/rollup-plugin-delete/rollup-plugin-delete-tests.ts @@ -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 diff --git a/types/rollup-plugin-delete/tsconfig.json b/types/rollup-plugin-delete/tsconfig.json new file mode 100644 index 0000000000..d03999e03a --- /dev/null +++ b/types/rollup-plugin-delete/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-delete-tests.ts" + ] +} diff --git a/types/rollup-plugin-delete/tslint.json b/types/rollup-plugin-delete/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rollup-plugin-delete/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b9ac343d1126748daa40c57d0c797d8416bb1a71 Mon Sep 17 00:00:00 2001 From: Vlad Shcherbin Date: Tue, 29 Jan 2019 23:19:55 +0300 Subject: [PATCH 2/2] Remove @types dependency from package.json --- types/rollup-plugin-delete/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/types/rollup-plugin-delete/package.json b/types/rollup-plugin-delete/package.json index 8daa001274..272f65edde 100644 --- a/types/rollup-plugin-delete/package.json +++ b/types/rollup-plugin-delete/package.json @@ -1,7 +1,6 @@ { "private": true, "dependencies": { - "@types/del": "^3.0.1", "rollup": ">=0.60.0" } }