gohttpdUi/types/global.d.ts

88 lines
2.5 KiB
TypeScript
Raw Normal View History

2022-10-09 17:12:03 +08:00
import type { CSSProperties } from 'vue'
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'
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'
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-10-09 17:12:03 +08:00
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
2022-10-09 17:12:03 +08:00
declare interface AxiosConfig {
params?: any
data?: any
url?: string
method?: AxiosMethod
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> {
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
}
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
readonly VITE_HIDE_GLOBAL_SETTING: string
}
2022-06-23 22:37:49 +08:00
}