From f15c66187edf977094f0ede1b9adf17f5d644a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=8F=AA=E5=89=8D=E7=AB=AF=E6=B1=AA?= <985313519@qq.com> Date: Wed, 17 Jan 2024 14:58:39 +0800 Subject: [PATCH] fix: types (#105) --- packages/vite-plugin-mock/src/types.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/vite-plugin-mock/src/types.ts b/packages/vite-plugin-mock/src/types.ts index d55e3bf..105142d 100644 --- a/packages/vite-plugin-mock/src/types.ts +++ b/packages/vite-plugin-mock/src/types.ts @@ -24,10 +24,12 @@ export declare interface MockMethod { method?: MethodType timeout?: number statusCode?: number - response?: ( - this: RespThisType, - opt: { url: Recordable; body: Recordable; query: Recordable; headers: Recordable }, - ) => any + response?: + | (( + this: RespThisType, + opt: { url: Recordable; body: Recordable; query: Recordable; headers: Recordable }, + ) => any) + | any rawResponse?: (this: RespThisType, req: IncomingMessage, res: ServerResponse) => void }