UNPKG

node-web-mvc

Version:
31 lines (30 loc) 1.33 kB
import { OutgoingHttpHeader, ServerResponse } from 'http'; import WorkerIncomingMessage from './WorkerIncomingMessage'; import { OutgoingHttpHeaders } from 'http2'; export interface WorkerResponseValue { id: string; type: 'write' | 'write-head' | 'finish' | 'ignored' | 'error' | 'invoke'; invoke?: { target: string; method: string; args: any[]; }; error?: Error; statusCode?: number; encoding?: BufferEncoding; headers?: Record<string, string>; buffer?: Buffer; } export default class WorkerServerResponse extends ServerResponse { private isHeaderSent; private invoker; write(chunk: Uint8Array | string, arg1: any, cb?: (error: Error) => void): boolean; writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; end(chunk?: any, arg1?: any, cb?: any): this; setHeader(name: string, value: number | string | ReadonlyArray<string>): this; constructor(req: WorkerIncomingMessage); addListener(event: string, listener: (...args: any[]) => void): this; once(event: string, listener: (...args: any[]) => void): this; on(event: string, listener: (...args: any[]) => void): this; }