UNPKG

@tsed/platform-http

Version:
26 lines (25 loc) 969 B
/// <reference types="node" resolution-mode="require"/> import { EventEmitter } from "node:events"; export declare class FakeResponse extends EventEmitter { headers: Record<string, unknown>; locals: Record<string, unknown>; statusCode: number; data: any; constructor(opts?: {}); append(field: string, val: string | string[]): this; status(code: number): this; contentType(content: string): void; contentLength(content: number): void; cookie(name: string, value: string, options?: TsED.SetCookieOpts): this; clearCookie(name: string, options?: TsED.SetCookieOpts): this; redirect(status: number, path: string): void; location(path: string): void; get(key: string): unknown; getHeaders(): Record<string, unknown>; set(key: string, value: any): this; setHeader(key: string, value: any): this; send(data: any): void; json(data: any): void; write(chunk: any): void; end(data: any): void; }