Added type for html-webpack-tags-plugin (#39286)

* commented plugin

* corrected test name

* corrected test name
This commit is contained in:
Max Boguslavsky 2019-10-23 00:06:00 +03:00 committed by Wesley Wigham
parent f24547c4f9
commit e47ab14b90
4 changed files with 65 additions and 0 deletions

View File

@ -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));

View File

@ -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 <https://github.com/VladimirGrenaderov>
// Max Boguslavskiy <https://github.com/maxbogus>
// 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;

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",
"html-webpack-tags-plugin-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }