import { ShiftRecursive, UnionToTupleCombination } from '../../arrays-and-tuples/infrastructure'; import { cast } from '../../generals/infrastructure'; import { KeyOfObject, modify, prettify } from '../infrastructure'; type _ModifyByTuple = V extends [] ? Result : V extends [infer Current, ...infer Rest] ? _ModifyByTuple]>> : never; type _ModifyByKeyPlusCombinations, combinations extends unknown[] = _combinations | ShiftRecursive<_combinations, 1>, Result = combinations extends combinations ? { readonly [_ in K]: combinations; } & _ModifyByTuple : never> = prettify<{ readonly [_ in K]?: undefined; } & T | Result>; /** * Allow modify interfaces or object types without the restrictions of use `extends` or `&` operator * Creates a Union Discrimated Type with the overrides + the keys pased for modify the object * Also create the combinations of override the mainType with two or more types in the overrides. */ export type modifyByKeyPlusCombinations = _ModifyByKeyPlusCombinations; export {};