1 |
|
2 | import { ServerResponse, IncomingMessage } from 'http';
|
3 | export declare type NowRequestCookies = {
|
4 | [key: string]: string;
|
5 | };
|
6 | export declare type NowRequestQuery = {
|
7 | [key: string]: string | string[];
|
8 | };
|
9 | export declare type NowRequestBody = any;
|
10 | export declare type NowRequest = IncomingMessage & {
|
11 | query: NowRequestQuery;
|
12 | cookies: NowRequestCookies;
|
13 | body: NowRequestBody;
|
14 | };
|
15 | export declare type NowResponse = ServerResponse & {
|
16 | send: (body: any) => NowResponse;
|
17 | json: (jsonBody: any) => NowResponse;
|
18 | status: (statusCode: number) => NowResponse;
|
19 | redirect: (statusOrUrl: string | number, url?: string) => NowResponse;
|
20 | };
|
21 | export declare type NowApiHandler = (req: NowRequest, res: NowResponse) => void;
|