@@ -12,9 +12,11 @@ export = wdm;
1212 */
1313/** @typedef {import("http").IncomingMessage } IncomingMessage */
1414/** @typedef {import("http").ServerResponse & ExtendedServerResponse } ServerResponse */
15+ /** @typedef {any } EXPECTED_ANY */
16+ /** @typedef {Function } EXPECTED_FUNCTION */
1517/**
1618 * @callback NextFunction
17- * @param {any = } err error
19+ * @param {EXPECTED_ANY = } err error
1820 * @returns {void }
1921 */
2022/**
@@ -175,6 +177,8 @@ declare namespace wdm {
175177 ExtendedServerResponse ,
176178 IncomingMessage ,
177179 ServerResponse ,
180+ EXPECTED_ANY ,
181+ EXPECTED_FUNCTION ,
178182 NextFunction ,
179183 WatchOptions ,
180184 Watching ,
@@ -232,29 +236,29 @@ declare function hapiWrapper<
232236 * @template {ServerResponse} [ResponseInternal=ServerResponse]
233237 * @param {Compiler | MultiCompiler } compiler compiler
234238 * @param {Options<RequestInternal, ResponseInternal>= } options options
235- * @returns {(ctx: any , next: Function ) => Promise<void> | void } kow wrapper
239+ * @returns {(ctx: EXPECTED_ANY , next: EXPECTED_FUNCTION ) => Promise<void> | void } kow wrapper
236240 */
237241declare function koaWrapper <
238242 RequestInternal extends IncomingMessage = import ( "http" ) . IncomingMessage ,
239243 ResponseInternal extends ServerResponse = ServerResponse ,
240244> (
241245 compiler : Compiler | MultiCompiler ,
242246 options ?: Options < RequestInternal , ResponseInternal > | undefined ,
243- ) : ( ctx : any , next : Function ) => Promise < void > | void ;
247+ ) : ( ctx : EXPECTED_ANY , next : EXPECTED_FUNCTION ) => Promise < void > | void ;
244248/**
245249 * @template {IncomingMessage} [RequestInternal=IncomingMessage]
246250 * @template {ServerResponse} [ResponseInternal=ServerResponse]
247251 * @param {Compiler | MultiCompiler } compiler compiler
248252 * @param {Options<RequestInternal, ResponseInternal>= } options options
249- * @returns {(ctx: any , next: Function ) => Promise<void> | void } hono wrapper
253+ * @returns {(ctx: EXPECTED_ANY , next: EXPECTED_FUNCTION ) => Promise<void> | void } hono wrapper
250254 */
251255declare function honoWrapper <
252256 RequestInternal extends IncomingMessage = import ( "http" ) . IncomingMessage ,
253257 ResponseInternal extends ServerResponse = ServerResponse ,
254258> (
255259 compiler : Compiler | MultiCompiler ,
256260 options ?: Options < RequestInternal , ResponseInternal > | undefined ,
257- ) : ( ctx : any , next : Function ) => Promise < void > | void ;
261+ ) : ( ctx : EXPECTED_ANY , next : EXPECTED_FUNCTION ) => Promise < void > | void ;
258262type Schema = import ( "schema-utils/declarations/validate" ) . Schema ;
259263type Compiler = import ( "webpack" ) . Compiler ;
260264type MultiCompiler = import ( "webpack" ) . MultiCompiler ;
@@ -276,7 +280,9 @@ type ExtendedServerResponse = {
276280} ;
277281type IncomingMessage = import ( "http" ) . IncomingMessage ;
278282type ServerResponse = import ( "http" ) . ServerResponse & ExtendedServerResponse ;
279- type NextFunction = ( err ?: any | undefined ) => void ;
283+ type EXPECTED_ANY = any ;
284+ type EXPECTED_FUNCTION = Function ;
285+ type NextFunction = ( err ?: EXPECTED_ANY | undefined ) => void ;
280286type WatchOptions = NonNullable < Configuration [ "watchOptions" ] > ;
281287type Watching = Compiler [ "watching" ] ;
282288type MultiWatching = ReturnType < MultiCompiler [ "watch" ] > ;
0 commit comments