export declare function errorMessage(err: unknown): string; export declare function toArgs(body: unknown): Record; /** The request's JSON body. Rejects a body over `maxBytes`, which is * 10 MB unless the caller serves a route that takes more. * * `drainBytes` says what happens to the rest of a body that is too large. * With 0, the request is destroyed at once, and a client that is still * sending sees a dropped connection. With more, up to that many further * bytes are read and thrown away, so the client can finish sending and * read the caller's reply. Past that, the request is destroyed. */ export declare function parseJsonBody(req: { on: (event: string, cb: (...args: any[]) => void) => void; destroy?: () => void; }, maxBytes?: number, drainBytes?: number): Promise;