diff --git a/types/html-webpack-tags-plugin/html-webpack-tags-plugin-tests.ts b/types/html-webpack-tags-plugin/html-webpack-tags-plugin-tests.ts new file mode 100644 index 0000000000..328d8cc583 --- /dev/null +++ b/types/html-webpack-tags-plugin/html-webpack-tags-plugin-tests.ts @@ -0,0 +1,19 @@ +import HtmlWebpackPlugin = require('html-webpack-plugin'); +import * as tags from 'html-webpack-tags-plugin'; + +const optionsArray: tags.Options[] = [ + { + tags: 'tag' + }, + { + tags: ['tags', 'hugs'], + files: 'readme.txt' + }, + { + tags: ['tags', 'hugs'], + files: 'readme.txt', + append: true + } +]; + +const plugins: HtmlWebpackPlugin[] = optionsArray.map(options => new HtmlWebpackPlugin(options)); diff --git a/types/html-webpack-tags-plugin/index.d.ts b/types/html-webpack-tags-plugin/index.d.ts new file mode 100644 index 0000000000..7dcd41957c --- /dev/null +++ b/types/html-webpack-tags-plugin/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for html-webpack-tags-plugin 2.0 +// Project: https://github.com/jharris4/html-webpack-tags-plugin +// Definitions by: Vladimir Grenaderov +// Max Boguslavskiy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; + +declare namespace HtmlWebpackTagsPlugin { + interface Options { + tags: string | string[]; + files?: string | string[]; + append?: boolean; + } +} + +declare class HtmlWebpackTagsPlugin extends Plugin { + constructor(options: HtmlWebpackTagsPlugin.Options); +} + +export = HtmlWebpackTagsPlugin; diff --git a/types/html-webpack-tags-plugin/tsconfig.json b/types/html-webpack-tags-plugin/tsconfig.json new file mode 100644 index 0000000000..4b0ce45542 --- /dev/null +++ b/types/html-webpack-tags-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", + "html-webpack-tags-plugin-tests.ts" + ] +} diff --git a/types/html-webpack-tags-plugin/tslint.json b/types/html-webpack-tags-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/html-webpack-tags-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }