From 155be3a701d0fea37e81c2cc9de9fbd71a1369dc Mon Sep 17 00:00:00 2001 From: woitechen <37726261+woitechen@users.noreply.github.com> Date: Mon, 2 Jul 2018 14:07:00 -0300 Subject: [PATCH] New package: 'hard-source-webpack-plugin' (#26972) * Add definitions to 'hard-source-webpack-plugin' package * Run 'npm test' --- .../hard-source-webpack-plugin-tests.ts | 8 +++++ types/hard-source-webpack-plugin/index.d.ts | 34 +++++++++++++++++++ .../hard-source-webpack-plugin/tsconfig.json | 23 +++++++++++++ types/hard-source-webpack-plugin/tslint.json | 1 + 4 files changed, 66 insertions(+) create mode 100644 types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts create mode 100644 types/hard-source-webpack-plugin/index.d.ts create mode 100644 types/hard-source-webpack-plugin/tsconfig.json create mode 100644 types/hard-source-webpack-plugin/tslint.json diff --git a/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts b/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts new file mode 100644 index 0000000000..a2cc9a486a --- /dev/null +++ b/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts @@ -0,0 +1,8 @@ +import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; + +new HardSourceWebpackPlugin({ + info: { + level: 'debug', + mode: 'test', + } +}); diff --git a/types/hard-source-webpack-plugin/index.d.ts b/types/hard-source-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..3e02ee1d8a --- /dev/null +++ b/types/hard-source-webpack-plugin/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for hard-source-webpack-plugin 0.9 +// Project: https://github.com/mzgoddard/hard-source-webpack-plugin#readme +// Definitions by: woitechen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as webpack from 'webpack'; + +declare class hard_source_webpack_plugin { + constructor(options?: Options); + apply(...args: any[]): void; +} + +declare namespace hard_source_webpack_plugin { } + +interface Options { + cacheDirectory?: string; + configHash?: (webpackConfig?: webpack.Configuration) => string; + environmentHash?: { + root: string; + directories: string[]; + files: string[]; + }; + info?: { + mode: 'none' | 'test'; + level: 'debug' | 'log' | 'info' | 'warn' | 'error'; + }; + cachePrune?: { + maxAge: number; + sizeThreshold: number; + }; +} + +export = hard_source_webpack_plugin; diff --git a/types/hard-source-webpack-plugin/tsconfig.json b/types/hard-source-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..94b7ae1705 --- /dev/null +++ b/types/hard-source-webpack-plugin/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", + "hard-source-webpack-plugin-tests.ts" + ] +} diff --git a/types/hard-source-webpack-plugin/tslint.json b/types/hard-source-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hard-source-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }