type Primitive = string | number | boolean | null | undefined export type LiteralUnion = T | (K & Record) export interface Recursive { [key: string]: T | Recursive } export type Dict = Record export type RequiredBy = Partial> & Required> export type AnyFunction = (...args: T[]) => any export type Nullable = T | null | undefined export type Keys = keyof NonNullable type Subtract = T extends D ? 0 : T extends D | any ? Exclude : never /** * Get all the (nested) paths of an object until a certain depth * e.g. Paths<{a: {b: {c: 1}}}, '', 2> => 'a' | 'a.b' | 'a.b.c' */ type Paths = { [K in keyof T]: Depth extends 0 ? never : T[K] extends object ? K extends string ? `${Prefix}${K}` | Paths> : never : K extends string | number ? `${Prefix}${K}` : never }[keyof T] export type PathIn = Key extends string ? Paths : never export type PartialBy = Omit & Partial>