/// import * as stream from 'stream'; import ActiveError from './error'; import { ErrorLog, BufferType } from './index'; /** * 处理相应类 */ export declare type Param = { callback?: string; cb?: string; error?: any; statusCode?: number; value?: Value; stream?: stream.Readable; mime?: string; download?: string | boolean; transfer?: string; appPath?: string; file?: string; appId?: string; errId?: string; }; export default class Response { /** * 创建错误对象 * @param id 错误Id * @param msg 错误信息 */ static Error(id: string, msg?: string): ActiveError; /** * 创建并抛出错误对象 * @param id 错误Id * @param msg 错误信息 */ static throw(id: string, msg?: string): never; /** * 创建错误对象 * @param id 错误Id * @param msg 错误信息 */ Error(id: string, msg?: string): ActiveError; /** * 创建并抛出错误对象 * @param id 错误Id * @param msg 错误信息 */ throw(id: string, msg?: string): never; _errId: string; _appId: string; _appPath: string; _error: any; _transfer: string; _download: string | boolean; _file: string; _value?: Value | object | stream.Readable; _statusCode: number; _callback: string; _mime: string; _render: string; constructor(arg: string); constructor(arg: Param); /** 错误用应用Id */ errId: string; /** 应用Id */ appId: string; /** 应用路径 */ appPath: string; /** 错误信息 */ error: any; /** 文件下载名 */ download: string | boolean; /** 302 跳转 目标地址 */ transfer: string; /** 要下载的文件的服务器地址 */ file: string; /** 相应体(普通对象或文本) */ value: Value | undefined; /** 相应体(流) */ stream: stream.Readable | undefined; /** 状态码 */ statusCode: number; /** 相应 MIME 类型 */ mime: string; /** * 通过输出函数输出错误信息 * @param echo 输出函数 */ echoError(echo: ErrorLog): void; readonly body: string | ArrayBuffer | stream.Readable | undefined; readonly filePath: string; readonly renderFile: string; render(path: string, data?: object, mime?: string): this; render(path: string, mime?: string): this; }