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

51 lines
1.2 KiB
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 16:02:28 +08:00
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | '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-11-13 13:16:11 +08:00
declare interface PageParam {
2022-11-13 13:16:11 +08:00
pageSize?: number
pageNo?: number
}
2022-11-13 13:16:11 +08:00
declare interface Tree {
id: number
name: string
children?: Tree[] | any[]
}
2022-07-18 19:06:37 +08:00
}