ludu-admin-vue3/types/global.d.ts

51 lines
1.1 KiB
TypeScript
Raw Normal View History

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