DefinitelyTyped/types/co-body/index.d.ts
Andy 954ee278de
Update TypeScript Versions to be at least as high as dependencies' versions (#21288)
* Update `TypeScript Version`s to be at least as high as dependencies' versions

* Run through again
2017-11-08 09:12:14 -08:00

40 lines
1.1 KiB
TypeScript

// Type definitions for co-body
// Project: https://github.com/cojs/co-body
// Definitions by: Joshua DeVinney <https://github.com/geoffreak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node"/>
/// <reference types="koa"/>
/// <reference types="qs"/>
import * as http from 'http';
import * as Koa from 'koa';
import * as qs from 'qs';
declare namespace CoBody {
type Context = http.IncomingMessage | Koa.Context;
export interface Parse {
(context: Context, options?: Options): Promise<any>;
text: (context: Context, options?: Options) => Promise<any>;
form: (context: Context, options?: Options) => Promise<any>;
json: (context: Context, options?: Options) => Promise<any>;
}
export interface Options {
limit?: number | string;
strict?: boolean;
queryString?: qs.IParseOptions;
jsonTypes?: string[];
returnRawBody?: boolean;
formTypes?: string[];
textTypes?: string[];
encoding?: string;
length?: number;
}
}
declare var CoBody: CoBody.Parse;
export = CoBody;