diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2019-02-01 21:08:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-01 21:08:58 +0900 |
| commit | bab1dc1d97222c1f388a46fc34a9b89997ec0552 (patch) | |
| tree | 6daefac8a1e2e2b62d315ad245c1ad7cec1452cb | |
| parent | Create type definition for 'nested-property' (#4004) (diff) | |
| download | sharkey-bab1dc1d97222c1f388a46fc34a9b89997ec0552.tar.gz sharkey-bab1dc1d97222c1f388a46fc34a9b89997ec0552.tar.bz2 sharkey-bab1dc1d97222c1f388a46fc34a9b89997ec0552.zip | |
Create type definition for 'koa-json-body' (#4056)
* Create type definition for 'koa-json-body'
* Follow lint
| -rw-r--r-- | src/@types/koa-json-body.d.ts | 15 | ||||
| -rw-r--r-- | src/server/activitypub.ts | 2 |
2 files changed, 16 insertions, 1 deletions
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'; |