From cdea5c2a81206a8f6bd51ba871e945be78aa4df0 Mon Sep 17 00:00:00 2001 From: Dave Cardwell Date: Fri, 25 Jan 2019 14:06:34 -0500 Subject: [PATCH] [extra-watch-webpack-plugin] Add initial types --- .../extra-watch-webpack-plugin-tests.ts | 6 +++++ types/extra-watch-webpack-plugin/index.d.ts | 26 +++++++++++++++++++ .../extra-watch-webpack-plugin/tsconfig.json | 16 ++++++++++++ types/extra-watch-webpack-plugin/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts create mode 100644 types/extra-watch-webpack-plugin/index.d.ts create mode 100644 types/extra-watch-webpack-plugin/tsconfig.json create mode 100644 types/extra-watch-webpack-plugin/tslint.json diff --git a/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts b/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts new file mode 100644 index 0000000000..7eb729eb31 --- /dev/null +++ b/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts @@ -0,0 +1,6 @@ +import ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin"); + +new ExtraWatchWebpackPlugin(); +new ExtraWatchWebpackPlugin({}); +new ExtraWatchWebpackPlugin({ files: "string", dirs: "string" }); +new ExtraWatchWebpackPlugin({ files: ["array"], dirs: ["array"] }); diff --git a/types/extra-watch-webpack-plugin/index.d.ts b/types/extra-watch-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..058dae79e7 --- /dev/null +++ b/types/extra-watch-webpack-plugin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for extra-watch-webpack-plugin 1.0 +// Project: https://github.com/pigcan/extra-watch-webpack-plugin#readme +// Definitions by: Dave Cardwell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from "webpack"; + +export = ExtraWatchWebpackPlugin; + +declare class ExtraWatchWebpackPlugin extends Plugin { + constructor(options?: ExtraWatchWebpackPlugin.Options); +} + +declare namespace ExtraWatchWebpackPlugin { + interface Options { + /** + * `string` (absolute path or glob pattern) or `array`, default `[]`, attach extra files to webpack's watch system + */ + files?: string | ReadonlyArray; + /** + * `string` or `array`, default `[]`, attach extra dirs to webpack's watch system + */ + dirs?: string | ReadonlyArray; + } +} diff --git a/types/extra-watch-webpack-plugin/tsconfig.json b/types/extra-watch-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..0e52bc6c44 --- /dev/null +++ b/types/extra-watch-webpack-plugin/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "extra-watch-webpack-plugin-tests.ts"] +} diff --git a/types/extra-watch-webpack-plugin/tslint.json b/types/extra-watch-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extra-watch-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }