diff --git a/src/@types/koa-json-body.d.ts b/src/@types/koa-json-body.d.ts new file mode 100644 index 0000000000..5aa8179c5b --- /dev/null +++ b/src/@types/koa-json-body.d.ts @@ -0,0 +1,15 @@ +declare module 'koa-json-body' { + import { Middleware } from 'koa'; + + interface IKoaJsonBodyOptions { + strict: boolean; + limit: string; + fallback: boolean; + } + + function koaJsonBody(opt?: IKoaJsonBodyOptions): Middleware; + + namespace koaJsonBody {} // Hack + + export = koaJsonBody; +} diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 20a8ee9794..0c0ae6c529 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -1,6 +1,6 @@ import { ObjectID } from 'mongodb'; import * as Router from 'koa-router'; -const json = require('koa-json-body'); +import * as json from 'koa-json-body'; import * as httpSignature from 'http-signature'; import { createHttpJob } from '../queue';