2022-10-09 17:12:03 +08:00
|
|
|
import type { CSSProperties } from 'vue'
|
2023-12-19 09:04:07 +08:00
|
|
|
import { RawAxiosRequestHeaders } from 'axios'
|
2022-10-09 17:12:03 +08:00
|
|
|
declare global {
|
|
|
|
declare interface Fn<T = any> {
|
|
|
|
(...arg: T[]): T
|
|
|
|
}
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type Nullable<T> = T | null
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2023-07-09 11:19:44 +08:00
|
|
|
declare type RemoveReadonly<T> = {
|
|
|
|
-readonly [P in keyof T]: T[P]
|
|
|
|
}
|
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type ComponentRef<T> = InstanceType<T>
|
2021-12-12 09:34:02 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type LocaleType = 'zh-CN' | 'en'
|
2022-01-03 09:41:34 +08:00
|
|
|
|
2023-05-10 10:12:31 +08:00
|
|
|
declare type TimeoutHandle = ReturnType<typeof setTimeout>
|
|
|
|
declare type IntervalHandle = ReturnType<typeof setInterval>
|
|
|
|
|
2023-05-31 16:24:28 +08:00
|
|
|
declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
|
|
|
|
|
|
|
|
declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
|
|
|
|
|
2023-11-30 11:34:39 +08:00
|
|
|
declare type AxiosContentType =
|
2022-10-09 17:12:03 +08:00
|
|
|
| 'application/json'
|
|
|
|
| 'application/x-www-form-urlencoded'
|
|
|
|
| 'multipart/form-data'
|
2024-01-10 09:43:33 +08:00
|
|
|
| 'text/plain'
|
2022-01-08 18:38:20 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
|
2022-01-09 10:57:50 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
2022-01-09 10:57:50 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare interface AxiosConfig {
|
|
|
|
params?: any
|
|
|
|
data?: any
|
|
|
|
url?: string
|
|
|
|
method?: AxiosMethod
|
2023-12-19 09:04:07 +08:00
|
|
|
headers?: RawAxiosRequestHeaders
|
2022-10-09 17:12:03 +08:00
|
|
|
responseType?: AxiosResponseType
|
|
|
|
}
|
2022-06-23 22:37:49 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare interface IResponse<T = any> {
|
2023-11-30 11:34:39 +08:00
|
|
|
code: number
|
2022-10-09 17:12:03 +08:00
|
|
|
data: T extends any ? T : T & any
|
|
|
|
}
|
2023-06-26 17:55:12 +08:00
|
|
|
|
|
|
|
declare interface ThemeTypes {
|
|
|
|
elColorPrimary?: string
|
|
|
|
leftMenuBorderColor?: string
|
|
|
|
leftMenuBgColor?: string
|
|
|
|
leftMenuBgLightColor?: string
|
|
|
|
leftMenuBgActiveColor?: string
|
|
|
|
leftMenuCollapseBgActiveColor?: string
|
|
|
|
leftMenuTextColor?: string
|
|
|
|
leftMenuTextActiveColor?: string
|
|
|
|
logoTitleTextColor?: string
|
|
|
|
logoBorderColor?: string
|
|
|
|
topHeaderBgColor?: string
|
|
|
|
topHeaderTextColor?: string
|
|
|
|
topHeaderHoverColor?: string
|
|
|
|
topToolBorderColor?: string
|
|
|
|
}
|
2024-06-05 16:26:46 +08:00
|
|
|
|
|
|
|
declare interface ImportMetaEnv {
|
|
|
|
readonly VITE_NODE_ENV: string
|
|
|
|
readonly VITE_APP_TITLE: string
|
|
|
|
readonly VITE_API_BASE_PATH: string
|
|
|
|
readonly VITE_BASE_PATH: string
|
|
|
|
readonly VITE_DROP_DEBUGGER: string
|
|
|
|
readonly VITE_DROP_CONSOLE: string
|
|
|
|
readonly VITE_SOURCEMAP: string
|
|
|
|
readonly VITE_OUT_DIR: string
|
|
|
|
readonly VITE_USE_BUNDLE_ANALYZER: string
|
|
|
|
readonly VITE_USE_ALL_ELEMENT_PLUS_STYLE: string
|
|
|
|
readonly VITE_USE_MOCK: string
|
|
|
|
readonly VITE_USE_CSS_SPLIT: string
|
|
|
|
readonly VITE_USE_ONLINE_ICON: string
|
|
|
|
readonly VITE_ICON_PREFIX: string
|
2024-06-20 15:31:54 +08:00
|
|
|
readonly VITE_HIDE_GLOBAL_SETTING: string
|
2024-06-05 16:26:46 +08:00
|
|
|
}
|
2022-06-23 22:37:49 +08:00
|
|
|
}
|