15 lines
758 B
TypeScript
15 lines
758 B
TypeScript
|
/// <reference types="node" />
|
||
|
import { IncomingMessage as I, ServerResponse as S } from 'node:http';
|
||
|
type Req = Pick<I, 'method'>;
|
||
|
type Res = Pick<S, 'setHeader' | 'removeHeader' | 'end' | 'getHeader' | 'statusCode'>;
|
||
|
/**
|
||
|
* Sets the response HTTP status code to statusCode and send its string representation as the response body.
|
||
|
*
|
||
|
* If an unsupported status code is specified, the HTTP status is still set to statusCode and the string version of the code is sent as the response body.
|
||
|
*
|
||
|
* @param req Request
|
||
|
* @param res Response
|
||
|
*/
|
||
|
export declare const sendStatus: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (statusCode: number) => Response_1;
|
||
|
export {};
|
||
|
//# sourceMappingURL=sendStatus.d.ts.map
|