Files
starface-outlook-sync-addin/node_modules/@fluentui/merge-styles/lib/DeepPartial.d.ts
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

15 lines
679 B
TypeScript

/**
* TypeScript type to return a deep partial object (each property can be undefined, recursively.)
* @deprecated - This type will hit infinite type instantiation recursion. Please use {@link DeepPartialV2}
*/
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends object ? DeepPartial<T[P]> : T[P];
};
interface IDeepPartialArray<T> extends Array<DeepPartialV2<T>> {
}
type DeepPartialObject<T> = {
[Key in keyof T]?: DeepPartialV2<T[Key]>;
};
export type DeepPartialV2<T> = T extends Function ? T : T extends Array<infer U> ? IDeepPartialArray<U> : T extends object ? DeepPartialObject<T> : T;
export {};