export declare type BodyType = 'base64' | 'text' | 'json'; export interface HttpEventRequest { /** * HTTP method. */ readonly method: string; /** * URL path */ readonly path: string; /** * Query string */ readonly queryString: string; /** * Map of query string parameters. */ readonly queryStringParams: Record; /** * Map of headers. */ readonly headers: Record; /** * Body type, either 'base64', 'text', or 'json'. If the body is empty then this property will be undefined. */ readonly bodyType?: BodyType; /** * Body content, content is determined by 'bodyType', if the bodyType is 'base64' then the content will be a base64 string, if 'text' then the content will be a string and if 'json' then the content will be a parsed JSON object. If the body is empty then this propery will be undefined. */ readonly body?: T; /** * Source IP of the request. */ readonly sourceIp: string; } export interface HttpEventResponse { /** * Response status code. */ status: number; /** * Response headers. */ headers?: Record; /** * Response body, either as text or base64 encoded string (for binary data). */ body?: string; /** * Whether the body is encoded as base64 string. */ isBase64?: boolean; } /** * Checks if the request body is in base64 format. */ export declare const isBase64: (request: HttpEventRequest) => request is Required>; /** * Checks if the request body is text. */ export declare const isText: (request: HttpEventRequest) => request is Required>; /** * Checks if the request body is parsed JSON object. */ export declare const isJSON: (request: HttpEventRequest) => request is Required>; /** * Builds response for plain text. * @param text plain text. */ export declare const buildPlainTextResponse: (text: any) => HttpEventResponse; /** * Builds response for HTML content. * @param html html content. */ export declare const buildHTMLResponse: (html: string) => HttpEventResponse; /** * Builds response for JSON content. * @param json JSON string or object to stringify. */ export declare const buildJSONResponse: (json: unknown) => HttpEventResponse; //# sourceMappingURL=http.d.ts.map