vue-pro/yudao-ui-admin-vue3/types/global.d.ts

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-07-18 19:06:37 +08:00
declare interface Fn<T = any> {
(...arg: T[]): T
}
declare type Nullable<T> = T | null
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
declare type ElememtPlusSize = 'default' | 'small' | 'large'
declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
declare type ComponentRef<T> = InstanceType<T>
declare type LocaleType = 'zh-CN' | 'en'
declare type AxiosHeaders =
| 'application/json'
| 'application/x-www-form-urlencoded'
| 'multipart/form-data'
2022-07-19 22:33:54 +08:00
declare type AxiosMethod = 'GET' | 'POST' | 'DELETE' | 'PUT'
2022-07-18 19:06:37 +08:00
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
2022-07-19 22:33:54 +08:00
declare interface AxiosConfig {
2022-07-18 19:06:37 +08:00
params?: any
data?: any
url?: string
method?: AxiosMethod
headersType?: string
responseType?: AxiosResponseType
}
2022-07-19 22:33:54 +08:00
declare interface IResponse<T = any> {
code?: number
data: T extends any ? T : T & any
2022-07-18 19:06:37 +08:00
}