forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoa-json.d.ts
40 lines (30 loc) · 986 Bytes
/
koa-json.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Type definitions for koa-json v2.x
// Project: https://github.com/koajs/json
// Definitions by: Alex Friedman <https://github.com/brooklyndev/>
// Definitions: https://github.com/brooklyndev/DefinitelyTyped
/* =================== USAGE ===================
import * as Koa from 'koa';
import * as json from 'koa-json';
const app = new Koa();
app.use(json());
=============================================== */
/// <reference path="../koa/koa.d.ts" />
declare module "koa-json" {
import * as Koa from "koa";
function json(opts?:{
/**
* default to pretty response [true]
*/
pretty?: boolean,
/**
* optional query-string param for pretty responses [none]
*/
param?: string,
/**
* JSON spaces [2]
*/
spaces?: number
}) : { (ctx: Koa.Context, next?: () => any): any } ;
namespace json {}
export = json;
}