// 1 level depth type Nullable<T> = { [K in keyof T]: T[K] | null }; // deep by recurisve call type DeepNullable<T> = { [K in keyof T]: DeepNullable<T[K]> | null; };