FlowPacs/yudao-ui-admin-vue3/types/global.d.ts

40 lines
996 B
TypeScript
Raw Normal View History

2022-10-11 13:59:30 +08:00
import type { CSSProperties } from 'vue'
declare global {
declare interface Fn<T = any> {
(...arg: T[]): T
}
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type Nullable<T> = T | null
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type ComponentRef<T> = InstanceType<T>
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type LocaleType = 'zh-CN' | 'en'
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type AxiosHeaders =
| 'application/json'
| 'application/x-www-form-urlencoded'
| 'multipart/form-data'
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare interface AxiosConfig {
params?: any
data?: any
url?: string
method?: AxiosMethod
headersType?: string
responseType?: AxiosResponseType
}
2022-07-18 19:06:37 +08:00
2022-10-11 13:59:30 +08:00
declare interface IResponse<T = any> {
code: string
data: T extends any ? T : T & any
}
2022-07-18 19:06:37 +08:00
}