-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
178 lines (164 loc) · 4.84 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
declare namespace WebpackDevServer {
export interface Configuration {
allowedHosts?: string[] | string;
bonjour?: boolean | { [key: string]: any };
client?: boolean | ClientClass;
compress?: boolean;
devMiddleware?: { [key: string]: any };
headers?: any;
historyApiFallback?: boolean | { [key: string]: any };
host?: string;
hot?: boolean | HotEnum;
http2?: boolean;
https?: boolean | HTTPSObject;
ipc?: boolean | string;
liveReload?: boolean;
magicHtml?: boolean;
onAfterSetupMiddleware?: any;
onBeforeSetupMiddleware?: any;
onListening?: any;
open?: Array<OpenObject | string> | boolean | OpenObject | string;
port?: number | string;
proxy?: any[] | { [key: string]: any };
setupExitSignals?: boolean;
static?: Array<StaticObject | string> | boolean | StaticObject | string;
watchFiles?: Array<WatchFilesObject | string> | WatchFilesObject | string;
webSocketServer?: any;
}
export interface ClientClass {
logging?: ClientLogging;
overlay?: boolean | ClientOverlayClass;
progress?: boolean;
webSocketTransport?: string;
webSocketURL?: ClientWebSocketURLClass | string;
}
export enum ClientLogging {
Error = "error",
Info = "info",
Log = "log",
None = "none",
Verbose = "verbose",
Warn = "warn",
}
export interface ClientOverlayClass {
/**
* Enables a full-screen overlay in the browser when there are compiler errors.
*/
errors?: boolean;
/**
* Enables a full-screen overlay in the browser when there are compiler warnings.
*/
warnings?: boolean;
}
export interface ClientWebSocketURLClass {
/**
* Tells clients connected to devServer to use the provided hostname.
*/
hostname?: string;
/**
* Tells clients connected to devServer to use the provided password to authenticate.
*/
password?: string;
/**
* Tells clients connected to devServer to use the provided path to connect.
*/
pathname?: string;
/**
* Tells clients connected to devServer to use the provided port.
*/
port?: number | string;
/**
* Tells clients connected to devServer to use the provided protocol.
*/
protocol?: string;
/**
* Tells clients connected to devServer to use the provided username to authenticate.
*/
username?: string;
}
export enum HotEnum {
Only = "only",
}
export interface HTTPSObject {
/**
* Path to an SSL CA certificate or content of an SSL CA certificate.
*/
ca?: any;
/**
* Path to an SSL CA certificate or content of an SSL CA certificate.
*/
cacert?: any;
/**
* Path to an SSL certificate or content of an SSL certificate.
*/
cert?: any;
/**
* Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted
* CRLs (Certificate Revocation Lists).
*/
crl?: any;
/**
* Path to an SSL key or content of an SSL key.
*/
key?: any;
/**
* Passphrase for a pfx file.
*/
passphrase?: string;
/**
* Path to an SSL pfx file or content of an SSL pfx file.
*/
pfx?: any;
/**
* Request for an SSL certificate.
*/
requestCert?: boolean;
}
export interface OpenObject {
/**
* Open specified browser.
*/
app?: AppClass | string;
/**
* Opens specified page in browser.
*/
target?: string[] | string;
}
export interface AppClass {
arguments?: string[] | boolean | number | number | { [key: string]: any } | null | string;
name?: string[] | string;
}
export interface StaticObject {
/**
* Directory for static contents.
*/
directory?: string;
/**
* The static files will be available in the browser under this public path.
*/
publicPath?: string[] | string;
/**
* Tells dev server to use serveIndex middleware when enabled.
*/
serveIndex?: boolean | { [key: string]: any };
staticOptions?: { [key: string]: any };
/**
* Watches for files in static content directory.
*/
watch?: boolean | { [key: string]: any };
}
export interface WatchFilesObject {
options?: { [key: string]: any };
paths?: string[] | string;
}
}
import { Configuration } from 'webpack';
declare module 'webpack' {
/**
* Can be used to configure the behaviour of webpack-dev-server when
* the webpack config is passed to webpack-dev-server CLI.
*/
interface Configuration {
devServer?: WebpackDevServer.Configuration;
}
}