Skip to content

Commit 603dfbe

Browse files
author
Aleksey Druzhinin
committed
chore: fix missing ts
1 parent 51e500a commit 603dfbe

File tree

1 file changed

+110
-130
lines changed

1 file changed

+110
-130
lines changed

types/index.d.ts

+110-130
Original file line numberDiff line numberDiff line change
@@ -115,148 +115,128 @@ export = wdm;
115115
* @param {Options<RequestInternal, ResponseInternal>} [options]
116116
* @returns {API<RequestInternal, ResponseInternal>}
117117
*/
118-
declare function wdm<
119-
RequestInternal extends import("http").IncomingMessage,
120-
ResponseInternal extends ServerResponse
121-
>(
122-
compiler: Compiler | MultiCompiler,
123-
options?: Options<RequestInternal, ResponseInternal> | undefined
118+
declare function wdm<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse>(
119+
compiler: Compiler | MultiCompiler,
120+
options?: Options<RequestInternal, ResponseInternal> | undefined
124121
): API<RequestInternal, ResponseInternal>;
125122
declare namespace wdm {
126-
export {
127-
Schema,
128-
Compiler,
129-
MultiCompiler,
130-
Configuration,
131-
Stats,
132-
MultiStats,
133-
ExtendedServerResponse,
134-
IncomingMessage,
135-
ServerResponse,
136-
NextFunction,
137-
WatchOptions,
138-
Watching,
139-
MultiWatching,
140-
OutputFileSystem,
141-
Logger,
142-
Callback,
143-
Context,
144-
Headers,
145-
Options,
146-
Middleware,
147-
GetFilenameFromUrl,
148-
WaitUntilValid,
149-
Invalidate,
150-
Close,
151-
AdditionalMethods,
152-
API,
153-
};
123+
export {
124+
Schema,
125+
Compiler,
126+
MultiCompiler,
127+
Configuration,
128+
Stats,
129+
MultiStats,
130+
ExtendedServerResponse,
131+
IncomingMessage,
132+
ServerResponse,
133+
NextFunction,
134+
WatchOptions,
135+
Watching,
136+
MultiWatching,
137+
OutputFileSystem,
138+
Logger,
139+
Callback,
140+
Context,
141+
Headers,
142+
Options,
143+
Middleware,
144+
GetFilenameFromUrl,
145+
WaitUntilValid,
146+
Invalidate,
147+
Close,
148+
AdditionalMethods,
149+
API,
150+
};
154151
}
155-
type ServerResponse = import("http").ServerResponse & ExtendedServerResponse;
156-
type Compiler = import("webpack").Compiler;
157-
type MultiCompiler = import("webpack").MultiCompiler;
158-
type Options<
159-
RequestInternal extends import("http").IncomingMessage,
160-
ResponseInternal extends ServerResponse
161-
> = {
162-
mimeTypes?:
163-
| {
164-
[key: string]: string;
165-
}
166-
| undefined;
167-
writeToDisk?: boolean | ((targetPath: string) => boolean) | undefined;
168-
methods?: string | undefined;
169-
headers?: Headers<RequestInternal, ResponseInternal>;
170-
publicPath?: NonNullable<Configuration["output"]>["publicPath"];
171-
stats?: Configuration["stats"];
172-
serverSideRender?: boolean | undefined;
173-
outputFileSystem?: OutputFileSystem | undefined;
174-
index?: string | boolean | undefined;
152+
type ServerResponse = import('http').ServerResponse & ExtendedServerResponse;
153+
type Compiler = import('webpack').Compiler;
154+
type MultiCompiler = import('webpack').MultiCompiler;
155+
type Options<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> = {
156+
mimeTypes?:
157+
| {
158+
[key: string]: string;
159+
}
160+
| undefined;
161+
writeToDisk?: boolean | ((targetPath: string) => boolean) | undefined;
162+
methods?: string | undefined;
163+
headers?: Headers<RequestInternal, ResponseInternal>;
164+
publicPath?: NonNullable<Configuration['output']>['publicPath'];
165+
stats?: Configuration['stats'];
166+
serverSideRender?: boolean | undefined;
167+
outputFileSystem?: OutputFileSystem | undefined;
168+
index?: string | boolean | undefined;
169+
historyApiFallback?: boolean;
175170
};
176-
type API<
177-
RequestInternal extends import("http").IncomingMessage,
178-
ResponseInternal extends ServerResponse
179-
> = Middleware<RequestInternal, ResponseInternal> &
180-
AdditionalMethods<RequestInternal, ResponseInternal>;
181-
type Schema = import("schema-utils/declarations/validate").Schema;
182-
type Configuration = import("webpack").Configuration;
183-
type Stats = import("webpack").Stats;
184-
type MultiStats = import("webpack").MultiStats;
171+
type API<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> = Middleware<
172+
RequestInternal,
173+
ResponseInternal
174+
> &
175+
AdditionalMethods<RequestInternal, ResponseInternal>;
176+
type Schema = import('schema-utils/declarations/validate').Schema;
177+
type Configuration = import('webpack').Configuration;
178+
type Stats = import('webpack').Stats;
179+
type MultiStats = import('webpack').MultiStats;
185180
type ExtendedServerResponse = {
186-
locals?:
187-
| {
188-
webpack?:
189-
| {
190-
devMiddleware?:
191-
| Context<import("http").IncomingMessage, ServerResponse>
192-
| undefined;
193-
}
194-
| undefined;
195-
}
196-
| undefined;
181+
locals?:
182+
| {
183+
webpack?:
184+
| {
185+
devMiddleware?: Context<import('http').IncomingMessage, ServerResponse> | undefined;
186+
}
187+
| undefined;
188+
}
189+
| undefined;
197190
};
198-
type IncomingMessage = import("http").IncomingMessage;
191+
type IncomingMessage = import('http').IncomingMessage;
199192
type NextFunction = (err?: any) => void;
200-
type WatchOptions = NonNullable<Configuration["watchOptions"]>;
201-
type Watching = Compiler["watching"];
202-
type MultiWatching = ReturnType<Compiler["watch"]>;
203-
type OutputFileSystem = Compiler["outputFileSystem"] & {
204-
createReadStream?: typeof import("fs").createReadStream;
205-
statSync?: import("fs").StatSyncFn;
206-
lstat?: typeof import("fs").lstat;
207-
readFileSync?: typeof import("fs").readFileSync;
193+
type WatchOptions = NonNullable<Configuration['watchOptions']>;
194+
type Watching = Compiler['watching'];
195+
type MultiWatching = ReturnType<Compiler['watch']>;
196+
type OutputFileSystem = Compiler['outputFileSystem'] & {
197+
createReadStream?: typeof import('fs').createReadStream;
198+
statSync?: import('fs').StatSyncFn;
199+
lstat?: typeof import('fs').lstat;
200+
existsSync?: typeof import('fs').existsSync;
201+
readFileSync?: typeof import('fs').readFileSync;
208202
};
209-
type Logger = ReturnType<Compiler["getInfrastructureLogger"]>;
210-
type Callback = (
211-
stats?: import("webpack").Stats | import("webpack").MultiStats | undefined
212-
) => any;
213-
type Context<
214-
RequestInternal extends import("http").IncomingMessage,
215-
ResponseInternal extends ServerResponse
216-
> = {
217-
state: boolean;
218-
stats: Stats | MultiStats | undefined;
219-
callbacks: Callback[];
220-
options: Options<RequestInternal, ResponseInternal>;
221-
compiler: Compiler | MultiCompiler;
222-
watching: Watching | MultiWatching;
223-
logger: Logger;
224-
outputFileSystem: OutputFileSystem;
203+
type Logger = ReturnType<Compiler['getInfrastructureLogger']>;
204+
type Callback = (stats?: import('webpack').Stats | import('webpack').MultiStats | undefined) => any;
205+
type Context<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> = {
206+
state: boolean;
207+
stats: Stats | MultiStats | undefined;
208+
callbacks: Callback[];
209+
options: Options<RequestInternal, ResponseInternal>;
210+
compiler: Compiler | MultiCompiler;
211+
watching: Watching | MultiWatching;
212+
logger: Logger;
213+
outputFileSystem: OutputFileSystem;
225214
};
226-
type Headers<
227-
RequestInternal extends import("http").IncomingMessage,
228-
ResponseInternal extends ServerResponse
229-
> =
230-
| Record<string, string | number>
231-
| {
232-
key: string;
233-
value: number | string;
234-
}[]
235-
| ((
236-
req: RequestInternal,
237-
res: ResponseInternal,
238-
context: Context<RequestInternal, ResponseInternal>
239-
) => void | undefined | Record<string, string | number>)
240-
| undefined;
241-
type Middleware<
242-
RequestInternal extends import("http").IncomingMessage,
243-
ResponseInternal extends ServerResponse
244-
> = (
245-
req: RequestInternal,
246-
res: ResponseInternal,
247-
next: NextFunction
215+
type Headers<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> =
216+
| Record<string, string | number>
217+
| {
218+
key: string;
219+
value: number | string;
220+
}[]
221+
| ((
222+
req: RequestInternal,
223+
res: ResponseInternal,
224+
context: Context<RequestInternal, ResponseInternal>
225+
) => void | undefined | Record<string, string | number>)
226+
| undefined;
227+
type Middleware<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> = (
228+
req: RequestInternal,
229+
res: ResponseInternal,
230+
next: NextFunction
248231
) => Promise<void>;
249232
type GetFilenameFromUrl = (url: string) => string | undefined;
250233
type WaitUntilValid = (callback: Callback) => any;
251234
type Invalidate = (callback: Callback) => any;
252235
type Close = (callback: (err: Error | null | undefined) => void) => any;
253-
type AdditionalMethods<
254-
RequestInternal extends import("http").IncomingMessage,
255-
ResponseInternal extends ServerResponse
256-
> = {
257-
getFilenameFromUrl: GetFilenameFromUrl;
258-
waitUntilValid: WaitUntilValid;
259-
invalidate: Invalidate;
260-
close: Close;
261-
context: Context<RequestInternal, ResponseInternal>;
236+
type AdditionalMethods<RequestInternal extends import('http').IncomingMessage, ResponseInternal extends ServerResponse> = {
237+
getFilenameFromUrl: GetFilenameFromUrl;
238+
waitUntilValid: WaitUntilValid;
239+
invalidate: Invalidate;
240+
close: Close;
241+
context: Context<RequestInternal, ResponseInternal>;
262242
};

0 commit comments

Comments
 (0)