mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for start-server-webpack-plugin (#43689)
* Added declarations for start-server-webpack-plugin * Applied standard linting * Update start-server-webpack-plugin - accept string litterals for 'signal' option Co-Authored-By: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com> * Update start-server-webpack-plugin - create parameterless constructor suppport Co-Authored-By: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com> * Update start-server-webpack-plugin - remove redundant typing of 'apply' method Co-Authored-By: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com> * Update start-server-webpack-plugin - remove typescript version as not needed Co-Authored-By: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com> * Update start-server-webpack-plugin - combined constructors Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
This commit is contained in:
parent
7ad13bfd69
commit
bb3bc696c1
42
types/start-server-webpack-plugin/index.d.ts
vendored
Normal file
42
types/start-server-webpack-plugin/index.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Type definitions for start-server-webpack-plugin 2.2
|
||||
// Project: https://github.com/ericclemmons/start-server-webpack-plugin
|
||||
// Definitions by: AGenson <https://github.com/AGenson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin, Compiler } from 'webpack';
|
||||
|
||||
export = StartServerWebpackPlugin;
|
||||
|
||||
declare class StartServerWebpackPlugin extends Plugin {
|
||||
constructor(options?: string | StartServerWebpackPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace StartServerWebpackPlugin {
|
||||
interface Options {
|
||||
/**
|
||||
* Name of the server to start (built asset from webpack).
|
||||
* If not provided, the plugin will tell you the available names.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Arguments for node.
|
||||
* Default: `[]`.
|
||||
*/
|
||||
nodeArgs?: string[];
|
||||
/**
|
||||
* Arguments for the script.
|
||||
* Default: `[]`.
|
||||
*/
|
||||
args?: string[];
|
||||
/**
|
||||
* Signal to send for HMR.
|
||||
* Default: 'false'.
|
||||
*/
|
||||
signal?: false | true | 'SIGUSR2';
|
||||
/**
|
||||
* Allow typing 'rs' to restart the server.
|
||||
* Default: 'true' if in 'development' mode, 'false' otherwise.
|
||||
*/
|
||||
keyboard?: boolean;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import StartServerWebpackPlugin = require('start-server-webpack-plugin');
|
||||
|
||||
const c1: Configuration = {
|
||||
plugins: [
|
||||
new StartServerWebpackPlugin('main.js')
|
||||
]
|
||||
};
|
||||
|
||||
const c2: Configuration = {
|
||||
plugins: [
|
||||
new StartServerWebpackPlugin({
|
||||
name: 'main.js',
|
||||
nodeArgs: [],
|
||||
args: [],
|
||||
signal: false,
|
||||
keyboard: false
|
||||
})
|
||||
]
|
||||
};
|
||||
23
types/start-server-webpack-plugin/tsconfig.json
Normal file
23
types/start-server-webpack-plugin/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"start-server-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/start-server-webpack-plugin/tslint.json
Normal file
1
types/start-server-webpack-plugin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user