@versatiles/server
Version:
10 lines (9 loc) • 408 B
TypeScript
import type { ServerResponse } from 'http';
import type { ResponseConfig, ResponseContent } from './types.js';
export declare class Response {
#private;
constructor(response: ServerResponse);
sendJSONString(json: string, config: ResponseConfig): Promise<void>;
sendContent(response: ResponseContent, config: ResponseConfig): Promise<void>;
sendError(err: unknown, code?: number): void;
}