We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
declare interface MockMethod { url: string; method?: MethodType; timeout?: number; statusCode?: number; response?: ((this: RespThisType, opt: { url: Recordable; body: Recordable; query: Recordable; headers: Recordable; }) => any); rawResponse?: (this: RespThisType, req: IncomingMessage, res: ServerResponse) => void; } response的联合类型any会导致this指向约束失效,当response是个函数时,在这个函数中调用this.res时,会报res不存在于MockMethod类型中 建议取消any的联合类型
The text was updated successfully, but these errors were encountered:
No branches or pull requests
declare interface MockMethod {
url: string;
method?: MethodType;
timeout?: number;
statusCode?: number;
response?: ((this: RespThisType, opt: {
url: Recordable;
body: Recordable;
query: Recordable;
headers: Recordable;
}) => any);
rawResponse?: (this: RespThisType, req: IncomingMessage, res: ServerResponse) => void;
}
response的联合类型any会导致this指向约束失效,当response是个函数时,在这个函数中调用this.res时,会报res不存在于MockMethod类型中
建议取消any的联合类型
The text was updated successfully, but these errors were encountered: