From 246900923a71b872cda37003c08fae3046d250d9 Mon Sep 17 00:00:00 2001 From: winixt Date: Tue, 15 Nov 2022 15:30:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20request=20ts=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-plugin-request/types.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/fes-plugin-request/types.d.ts b/packages/fes-plugin-request/types.d.ts index 1d3c2526..d7bb4176 100644 --- a/packages/fes-plugin-request/types.d.ts +++ b/packages/fes-plugin-request/types.d.ts @@ -7,14 +7,16 @@ type ResponseInterceptor = (value: AxiosResponse) => AxiosResponse | [(value: Ax interface RequestPluginOption { mergeRequest?: boolean; + dataHandler?(data: any, response: AxiosResponse): any; + errorHandler?(error: AxiosError | {type: string, msg: string, [key: string]: string}): void; cache?: boolean | { type: 'ram' | 'sessionStorage' | 'localStorage', cacheTime: number; } } -export function request(url: string, data: null | Record, options: AxiosRequestConfig & RequestPluginOption ): Promise -export function useRequest(url: string, data: null | Record, options: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref; errorRef: Ref; dataRef: Ref} +export function request(url: string, data?: null | Record, options?: AxiosRequestConfig & RequestPluginOption ): Promise +export function useRequest(url: string, data?: null | Record, options?: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref; errorRef: Ref; dataRef: Ref} declare module "@fesjs/fes" { interface PluginRuntimeConfig { request?: {