mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-12 12:35:06 +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 {
|
interface RequestPluginOption {
|
||||||
mergeRequest?: boolean;
|
mergeRequest?: boolean;
|
||||||
|
dataHandler?(data: any, response: AxiosResponse): any;
|
||||||
|
errorHandler?(error: AxiosError | {type: string, msg: string, [key: string]: string}): void;
|
||||||
cache?: boolean | {
|
cache?: boolean | {
|
||||||
type: 'ram' | 'sessionStorage' | 'localStorage',
|
type: 'ram' | 'sessionStorage' | 'localStorage',
|
||||||
cacheTime: number;
|
cacheTime: number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function request(url: string, data: null | Record<string, any>, options: AxiosRequestConfig & RequestPluginOption ): Promise<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>}
|
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" {
|
declare module "@fesjs/fes" {
|
||||||
interface PluginRuntimeConfig {
|
interface PluginRuntimeConfig {
|
||||||
request?: {
|
request?: {
|
||||||
|
Loading…
Reference in New Issue
Block a user