mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
18 lines
491 B
TypeScript
18 lines
491 B
TypeScript
/// <reference path="koa-compose.d.ts" />
|
|
|
|
import compose = require('koa-compose');
|
|
|
|
var fn1: compose.Middleware = function(context: any, next: () => Promise<void>): Promise<any> {
|
|
return Promise
|
|
.resolve(console.log('in fn1'))
|
|
.then(() => next());
|
|
};
|
|
|
|
var fn2: compose.Middleware = function(context: any, next: () => Promise<void>): Promise<any> {
|
|
return Promise
|
|
.resolve(console.log('in fn2'))
|
|
.then(() => next());
|
|
};
|
|
|
|
|
|
var fn = compose([fn1, fn2]); |