Home > types-kit > PartialDeep
Make all properties (includes deep properties) in T optional.
Signature:
export type PartialDeep<T> = {
[P in keyof T]?: PartialDeep<T[P]>
}References: PartialDeep
interface Props {
a: {
d: number
};
b: number;
c: number;
};
// Expect: { a?: { d?: number }; b?: number; c?: number; }
type NewProps = PartialDeep<Props>;