UNPKG

@whook/whook

Version:

Build strong and efficient REST web services.

18 lines (17 loc) 977 B
import { type OpenAPI } from 'ya-open-api-types'; import { Readable, type Transform } from 'node:stream'; import { type WhookDecoders, type WhookEncoders, type WhookParsers, type WhookStringifiers } from '../services/httpRouter.js'; import { type WhookOpenAPIOperation } from '../types/openapi.js'; import { type WhookResponse } from '../types/http.js'; import { type WhookRequestBody } from '../types/http.js'; import { type WhookBodySpec } from '../libs/router.js'; export declare function getBody({ DECODERS, PARSERS, API, bufferLimit, }: { DECODERS?: WhookDecoders<Transform>; PARSERS?: WhookParsers; API: OpenAPI; bufferLimit: number; }, operation: WhookOpenAPIOperation, inputStream: Readable, bodySpec: WhookBodySpec): Promise<WhookRequestBody | undefined>; export declare function sendBody({ ENCODERS, STRINGIFIERS, }: { ENCODERS?: WhookEncoders<Transform>; STRINGIFIERS?: WhookStringifiers; }, response: WhookResponse): Promise<WhookResponse>;