// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead export const tuple = (...args: T) => args; export const tupleNum = (...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 extends (infer E)[] ? E : T extends readonly (infer F)[] ? F : never; /** https://github.com/Microsoft/TypeScript/issues/29729 */ export type LiteralUnion = T | (U & {});