schangxiang@126.com
2025-09-18 49a51c068d62084bc4c3e77c4be94a20de556c4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Type definitions for koa-compose 3.2
// Project: https://github.com/koajs/compose
// Definitions by: jKey Lu <https://github.com/jkeylu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
 
import * as Koa from "koa";
 
declare function compose<T, U, V, W>(
    middleware: [Koa.Middleware<T, U>, Koa.Middleware<V, W>]
): Koa.Middleware<T & V, U & W>;
 
declare function compose<T>(middleware: Array<compose.Middleware<T>>): compose.ComposedMiddleware<T>;
 
declare namespace compose {
    type Middleware<T> = (context: T, next: () => Promise<any>) => any;
    type ComposedMiddleware<T> = (context: T, next?: () => Promise<any>) => Promise<void>;
}
 
export = compose;