feat: type抽离
parent
a62929a8da
commit
8b4fa1aa21
@ -0,0 +1,52 @@
|
||||
export type ComponentName =
|
||||
| 'Radio'
|
||||
| 'RadioButton'
|
||||
| 'Checkbox'
|
||||
| 'CheckboxButton'
|
||||
| 'Input'
|
||||
| 'Autocomplete'
|
||||
| 'InputNumber'
|
||||
| 'Select'
|
||||
| 'Cascader'
|
||||
| 'Switch'
|
||||
| 'Slider'
|
||||
| 'TimePicker'
|
||||
| 'DatePicker'
|
||||
| 'Rate'
|
||||
| 'ColorPicker'
|
||||
| 'Transfer'
|
||||
| 'Divider'
|
||||
| 'TimeSelect'
|
||||
| 'SelectV2'
|
||||
| 'InputPassword'
|
||||
| 'Editor'
|
||||
|
||||
export type ColProps = {
|
||||
span?: number
|
||||
xs?: number
|
||||
sm?: number
|
||||
md?: number
|
||||
lg?: number
|
||||
xl?: number
|
||||
tag?: string
|
||||
}
|
||||
|
||||
export type ComponentOptions = {
|
||||
label?: string
|
||||
value?: FormValueType
|
||||
disabled?: boolean
|
||||
key?: string | number
|
||||
children?: ComponentOptions[]
|
||||
options?: ComponentOptions[]
|
||||
} & Recordable
|
||||
|
||||
export type ComponentOptionsAlias = {
|
||||
labelField?: string
|
||||
valueField?: string
|
||||
}
|
||||
|
||||
export type ComponentProps = {
|
||||
optionsAlias?: ComponentOptionsAlias
|
||||
options?: ComponentOptions[]
|
||||
optionsSlot?: boolean
|
||||
} & Recordable
|
||||
@ -0,0 +1,4 @@
|
||||
import { ElementPlusSize } from './elementPlus'
|
||||
export interface ConfigGlobalTypes {
|
||||
size?: ElementPlusSize
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
export type contextMenuSchema = {
|
||||
disabled?: boolean
|
||||
divided?: boolean
|
||||
icon?: string
|
||||
label: string
|
||||
command?: (item: contextMenuSchema) => void
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
declare interface DescriptionsSchema {
|
||||
export interface DescriptionsSchema {
|
||||
span?: number // 占多少分
|
||||
field: string // 字段名
|
||||
label?: string // label名
|
||||
@ -0,0 +1,3 @@
|
||||
export type ElementPlusSize = 'default' | 'small' | 'large'
|
||||
|
||||
export type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
|
||||
@ -1,4 +1,4 @@
|
||||
declare interface IconTypes {
|
||||
export interface IconTypes {
|
||||
size?: number
|
||||
color?: string
|
||||
icon: string
|
||||
@ -1,4 +1,4 @@
|
||||
declare interface TipSchema {
|
||||
export interface TipSchema {
|
||||
label: string
|
||||
keys?: string[]
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
declare interface Language {
|
||||
export interface Language {
|
||||
el: Recordable
|
||||
name: string
|
||||
}
|
||||
|
||||
declare interface LocaleDropdownType {
|
||||
export interface LocaleDropdownType {
|
||||
lang: LocaleType
|
||||
name?: string
|
||||
elLocale?: Language
|
||||
@ -1,4 +1,4 @@
|
||||
declare interface QrcodeLogo {
|
||||
export interface QrcodeLogo {
|
||||
src?: string
|
||||
logoSize?: number
|
||||
bgColor?: string
|
||||
@ -1,3 +0,0 @@
|
||||
declare interface ConfigGlobalTypes {
|
||||
size?: ElememtPlusSize
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
declare type contextMenuSchema = {
|
||||
disabled?: boolean
|
||||
divided?: boolean
|
||||
icon?: string
|
||||
label: string
|
||||
command?: (item: contextMenuSchema) => viod
|
||||
}
|
||||
@ -1,40 +1,39 @@
|
||||
declare interface Fn<T = any> {
|
||||
(...arg: T[]): T
|
||||
}
|
||||
|
||||
declare type Nullable<T> = T | null
|
||||
import type { CSSProperties } from 'vue'
|
||||
declare global {
|
||||
declare interface Fn<T = any> {
|
||||
(...arg: T[]): T
|
||||
}
|
||||
|
||||
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
||||
declare type Nullable<T> = T | null
|
||||
|
||||
declare type ElememtPlusSize = 'default' | 'small' | 'large'
|
||||
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
||||
|
||||
declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
|
||||
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
||||
|
||||
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
||||
declare type ComponentRef<T> = InstanceType<T>
|
||||
|
||||
declare type ComponentRef<T> = InstanceType<T>
|
||||
declare type LocaleType = 'zh-CN' | 'en'
|
||||
|
||||
declare type LocaleType = 'zh-CN' | 'en'
|
||||
declare type AxiosHeaders =
|
||||
| 'application/json'
|
||||
| 'application/x-www-form-urlencoded'
|
||||
| 'multipart/form-data'
|
||||
|
||||
declare type AxiosHeaders =
|
||||
| 'application/json'
|
||||
| 'application/x-www-form-urlencoded'
|
||||
| 'multipart/form-data'
|
||||
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
|
||||
|
||||
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
|
||||
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
||||
|
||||
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
||||
|
||||
declare interface AxiosConfig {
|
||||
params?: any
|
||||
data?: any
|
||||
url?: string
|
||||
method?: AxiosMethod
|
||||
headersType?: string
|
||||
responseType?: AxiosResponseType
|
||||
}
|
||||
declare interface AxiosConfig {
|
||||
params?: any
|
||||
data?: any
|
||||
url?: string
|
||||
method?: AxiosMethod
|
||||
headersType?: string
|
||||
responseType?: AxiosResponseType
|
||||
}
|
||||
|
||||
declare interface IResponse<T = any> {
|
||||
code: string
|
||||
data: T extends any ? T : T & any
|
||||
declare interface IResponse<T = any> {
|
||||
code: string
|
||||
data: T extends any ? T : T & any
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue