mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-12 11:55:26 +08:00
f84065dcd3
fix: types error
18 lines
740 B
TypeScript
18 lines
740 B
TypeScript
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
|
export const tuple = <T extends string[]>(...args: T) => args;
|
|
|
|
export const tupleNum = <T extends number[]>(...args: T) => args;
|
|
|
|
/**
|
|
* https://stackoverflow.com/a/59187769
|
|
* Extract the type of an element of an array/tuple without performing indexing
|
|
*/
|
|
export type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer E)[] ? E : never;
|
|
|
|
/**
|
|
* https://github.com/Microsoft/TypeScript/issues/29729
|
|
*/
|
|
export type LiteralUnion<T extends U, U> = T | (U & {});
|