UNPKG

748 BTypeScriptView Raw
1/// <reference types="node" />
2import { IncomingMessage, ServerResponse } from 'http';
3declare type PayloadOptions = {
4 private: true;
5} | {
6 private: boolean;
7 stateful: true;
8} | {
9 private: boolean;
10 stateful: false;
11 revalidate: number | false;
12};
13export declare function setRevalidateHeaders(res: ServerResponse, options: PayloadOptions): void;
14export declare function sendPayload(req: IncomingMessage, res: ServerResponse, payload: any, type: 'html' | 'json', { generateEtags, poweredByHeader, }: {
15 generateEtags: boolean;
16 poweredByHeader: boolean;
17}, options?: PayloadOptions): void;
18export declare function sendEtagResponse(req: IncomingMessage, res: ServerResponse, etag: string | undefined): boolean;
19export {};