import { AskResponse } from 'quidproquo-core'; import { SeoEventResponse } from '../types'; import { HTTPEvent, HTTPEventResponse } from '../types/HTTPEvent'; export declare const rawFromJsonEventRequest: (httpJsonEvent: HTTPEvent) => string | undefined; export declare const fromJsonEventRequest: (httpJsonEvent: HTTPEvent) => T; export declare function askFromJsonEventRequest(httpJsonEvent: HTTPEvent): AskResponse; /** * Like `askFromJsonEventRequest`, but the parsed body is run through an app-supplied * validator before it is returned - so the `T` is actually checked, not just cast. * The validator throws (or returns the typed value); a validation throw becomes an * `Invalid` (422) response. Any schema library fits, e.g. zod: `(data) => schema.parse(data)`. */ export declare function askFromValidJsonEventRequest(httpJsonEvent: HTTPEvent, validate: (data: unknown) => T): AskResponse; export declare const readUriQueryParamFromEvent: (event: HTTPEvent, paramName: string) => string | undefined; export declare const toJsonEventResponse: (item: any, status?: number) => HTTPEventResponse; export declare const toHtmlResponse: (html: string, status?: number) => HTTPEventResponse; export declare const toTextResponse: (text: string, status?: number) => HTTPEventResponse; export declare const toMovedPermanentlyRedirectResponse: (location: string) => HTTPEventResponse; export declare const toMovedTemporarilyRedirectResponse: (location: string) => HTTPEventResponse; export declare const toCdnResponse: (status?: number) => SeoEventResponse;