Create type definition for 'koa-json-body' (#4056)

* Create type definition for 'koa-json-body'

* Follow lint
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-01 21:08:58 +09:00 committed by GitHub
parent 3b30ad5404
commit bab1dc1d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

15
src/@types/koa-json-body.d.ts vendored Normal file
View File

@ -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;
}

View File

@ -1,6 +1,6 @@
import { ObjectID } from 'mongodb'; import { ObjectID } from 'mongodb';
import * as Router from 'koa-router'; 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 * as httpSignature from 'http-signature';
import { createHttpJob } from '../queue'; import { createHttpJob } from '../queue';