Browse Source
* type: remove tuple * type: remove tuple * type: remove tuple * fix * fix * fix type * fix type * fix type * fix type * fix type * Update ColorPicker.tsx * Update components/badge/utils.tsx Co-authored-by: MadCcc <1075746765@qq.com> * fix type * fix type * fix type * fix * fix * fix type * fix type * fix type * update snap * update snap Co-authored-by: MadCcc <1075746765@qq.com>pull/39524/head
lijianan
2 years ago
committed by
GitHub
19 changed files with 45 additions and 62 deletions
@ -1,13 +1,2 @@ |
|||
// 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 F)[] ? F : never; |
|||
|
|||
/** https://github.com/Microsoft/TypeScript/issues/29729 */ |
|||
export type LiteralUnion<T extends U, U> = T | (U & {}); |
|||
|
Loading…
Reference in new issue