update: 去除没必要的declare

This commit is contained in:
puhui999 2023-03-27 10:32:17 +08:00
parent 3c6bf37879
commit 6e321c4946

26
types/global.d.ts vendored
View File

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