FlowVue/types/global.d.ts

54 lines
1.2 KiB
TypeScript
Raw Normal View History

export {}
declare global {
2023-03-27 10:32:17 +08:00
interface Fn<T = any> {
(...arg: T[]): T
}
2023-03-27 10:32:17 +08:00
type Nullable<T> = T | null
2023-03-27 10:32:17 +08:00
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
2023-03-27 10:32:17 +08:00
type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
2023-03-27 10:32:17 +08:00
type ComponentRef<T> = InstanceType<T>
2023-03-27 10:32:17 +08:00
type LocaleType = 'zh-CN' | 'en'
declare type TimeoutHandle = ReturnType<typeof setTimeout>
declare type IntervalHandle = ReturnType<typeof setInterval>
2023-03-27 10:32:17 +08:00
type AxiosHeaders =
| 'application/json'
| 'application/x-www-form-urlencoded'
| 'multipart/form-data'
2023-03-27 10:32:17 +08:00
type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT'
2023-03-27 10:32:17 +08:00
type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
2023-03-27 10:32:17 +08:00
interface AxiosConfig {
params?: any
data?: any
url?: string
method?: AxiosMethod
headersType?: string
responseType?: AxiosResponseType
}
2023-03-27 10:32:17 +08:00
interface IResponse<T = any> {
code: string
data: T extends any ? T : T & any
}
2023-03-27 10:32:17 +08:00
interface PageParam {
pageSize?: number
pageNo?: number
}
2023-03-27 10:32:17 +08:00
interface Tree {
id: number
name: string
children?: Tree[] | any[]
}
}