From 5049870b6e2e8371509ac4984cc4f74674245d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Sun, 3 Feb 2019 23:01:03 +0900 Subject: [PATCH] Create type definition for 'koa-slow' (#4072) --- src/@types/koa-slow.d.ts | 14 ++++++++++++++ src/server/index.ts | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/@types/koa-slow.d.ts diff --git a/src/@types/koa-slow.d.ts b/src/@types/koa-slow.d.ts new file mode 100644 index 0000000000..bca6a8490b --- /dev/null +++ b/src/@types/koa-slow.d.ts @@ -0,0 +1,14 @@ +declare module 'koa-slow' { + import { Middleware } from 'koa'; + + interface ISlowOptions { + url?: RegExp + delay?: number + } + + function slow(options?: ISlowOptions): Middleware; + + namespace slow {} // Hack + + export = slow; +} diff --git a/src/server/index.ts b/src/server/index.ts index 57f1326f2f..be0a6f5c77 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -13,7 +13,7 @@ import * as mount from 'koa-mount'; import * as compress from 'koa-compress'; import * as koaLogger from 'koa-logger'; import * as requestStats from 'request-stats'; -//const slow = require('koa-slow'); +//import * as slow from 'koa-slow'; import activityPub from './activitypub'; import webFinger from './webfinger';