mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Add types for webpack-watched-glob-entries-plugin
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Type definitions for webpack-watched-glob-entries-plugin 2.1
|
||||
// Project: https://github.com/Milanzor/webpack-watched-glob-entries-plugin#readme
|
||||
// Definitions by: Joel Spadin <https://github.com/ChaosinaCan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { IOptions } from 'glob';
|
||||
import { EntryFunc, Plugin } from 'webpack';
|
||||
|
||||
export interface PluginOptions {
|
||||
basename_as_entry_name?: boolean;
|
||||
}
|
||||
|
||||
export default class WebpackWatchedGlobEntries extends Plugin {
|
||||
static getEntries(globs: string[], globOptions?: IOptions, pluginOptions?: PluginOptions): EntryFunc;
|
||||
static getFiles(globString: string, globOptions?: IOptions, basename_as_entry_name?: boolean): Record<string, string>;
|
||||
}
|
||||
@@ -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",
|
||||
"webpack-watched-glob-entries-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
import GlobEntriesPlugin from 'webpack-watched-glob-entries-plugin';
|
||||
|
||||
new GlobEntriesPlugin(); // $ExpectType WebpackWatchedGlobEntries
|
||||
|
||||
GlobEntriesPlugin.getEntries(['']); // $ExpectType EntryFunc
|
||||
|
||||
// $ExpectType EntryFunc
|
||||
GlobEntriesPlugin.getEntries([''], {
|
||||
ignore: ''
|
||||
});
|
||||
|
||||
// $ExpectType EntryFunc
|
||||
GlobEntriesPlugin.getEntries([''], {
|
||||
ignore: '',
|
||||
}, {
|
||||
basename_as_entry_name: true,
|
||||
});
|
||||
|
||||
GlobEntriesPlugin.getFiles(''); // $ExpectType Record<string, string>
|
||||
|
||||
// $ExpectType Record<string, string>
|
||||
GlobEntriesPlugin.getFiles('', {
|
||||
ignore: '',
|
||||
});
|
||||
|
||||
// $ExpectType Record<string, string>
|
||||
GlobEntriesPlugin.getFiles('', {
|
||||
ignore: '',
|
||||
}, true);
|
||||
Reference in New Issue
Block a user