UNPKG

@koa/bodyparser

Version:
24 lines (21 loc) 778 B
import { Options } from 'co-body'; import * as Koa from 'koa'; declare const supportedBodyTypes: readonly ["json", "form", "text", "xml"]; type BodyType = (typeof supportedBodyTypes)[number]; type BodyParserOptions = { parsedMethods?: string[]; patchNode?: boolean; detectJSON?: (ctx: Koa.Context) => boolean; onError?: (error: Error, ctx: Koa.Context) => void; enableRawChecking?: boolean; enableTypes?: BodyType[]; extendTypes?: { [K in BodyType]?: string[]; }; jsonStrict?: Options['strict']; jsonLimit?: Options['limit']; formLimit?: Options['limit']; textLimit?: Options['limit']; xmlLimit?: Options['limit']; } & Pick<Options, 'encoding'>; export { type BodyParserOptions, type BodyType, supportedBodyTypes };