@types/koa-json
Version:
TypeScript definitions for koa-json
50 lines (37 loc) • 1.26 kB
Markdown
# Installation
> `npm install --save @types/koa-json`
# Summary
This package contains type definitions for koa-json (https://github.com/koajs/json).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-json.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-json/index.d.ts)
````ts
/* =================== USAGE ===================
import * as Koa from 'koa';
import * as json from 'koa-json';
const app = new Koa();
app.use(json());
=============================================== */
import * as Koa from "koa";
declare function json(opts?: {
/**
* default to pretty response [true]
*/
pretty?: boolean | undefined;
/**
* optional query-string param for pretty responses [none]
*/
param?: string | undefined;
/**
* JSON spaces [2]
*/
spaces?: number | undefined;
}): Koa.Middleware;
declare namespace json {}
export = json;
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 09:09:38 GMT
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa)
# Credits
These definitions were written by [Alex Friedman](https://github.com/brooklyndev).