/** * Use this to type "one of" from list: * export type colorKeyType = ObjectFromList; */ export type ObjectFromList, V = string> = { [K in T extends ReadonlyArray ? U : never]: V; }; /** Idk, forget how to use this */ export type Omit = Pick>; /** Also search for tsFix in comments */ export type tsFix = any; /** Alternative to ` & ` operator, forget why its better sometimes */ export type Merge = Omit> & N; // /** Like Merge, but also merges nested object types instead of just replacing the whole thing */ // export type MergeDeep< // A extends Record, // B extends DeepPartialAny // > = { // [K in keyof A]: B[K] extends never // ? A[K] // : B[K] extends Record // ? MergeDeep // : B[K]; // } & (A extends Record ? Omit : A); // /** Makes each property optional and turns each leaf property into any, allowing for type overrides by narrowing any. */ // type DeepPartialAny = { // [P in keyof T]?: T[P] extends Record // ? DeepPartialAny // : any; // };