2.0.23 • Published 6 months ago

@types/koa-json v2.0.23

Weekly downloads
10,100
License
MIT
Repository
github
Last release
6 months ago

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

// 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/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

/* =================== 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: Fri, 09 Jul 2021 02:32:32 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by Alex Friedman.