mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-03 12:17:38 +08:00
fix: 修复 request ts 类型提示问题
This commit is contained in:
parent
a3847f167a
commit
246900923a
6
packages/fes-plugin-request/types.d.ts
vendored
6
packages/fes-plugin-request/types.d.ts
vendored
@ -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<string, any>, options: AxiosRequestConfig & RequestPluginOption ): Promise<any>
|
||||
export function useRequest(url: string, data: null | Record<string, any>, options: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref<boolean>; errorRef: Ref<Error>; dataRef: Ref<any>}
|
||||
export function request(url: string, data?: null | Record<string, any>, options?: AxiosRequestConfig & RequestPluginOption ): Promise<any>
|
||||
export function useRequest(url: string, data?: null | Record<string, any>, options?: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref<boolean>; errorRef: Ref<Error>; dataRef: Ref<any>}
|
||||
declare module "@fesjs/fes" {
|
||||
interface PluginRuntimeConfig {
|
||||
request?: {
|
||||
|
Loading…
Reference in New Issue
Block a user