UNPKG

@botol/dipo

Version:

## Simple Composite controller

15 lines (14 loc) 1.06 kB
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint; export declare type PartialDeep<T> = T extends Primitive ? Partial<T> : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType> : T extends object ? PartialObjectDeep<T> : unknown; interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> { } interface PartialSetDeep<T> extends Set<PartialDeep<T>> { } interface PartialReadonlyMapDeep<KeyType, ValueType> extends ReadonlyMap<PartialDeep<KeyType>, PartialDeep<ValueType>> { } interface PartialReadonlySetDeep<T> extends ReadonlySet<PartialDeep<T>> { } declare type PartialObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType]>; }; export {};