import { Builtin } from "../built-in"; import { IsTuple } from "../is-tuple"; export type DeepUndefinable = Type extends Builtin ? Type | undefined : Type extends Map ? Map, DeepUndefinable> : Type extends ReadonlyMap ? ReadonlyMap, DeepUndefinable> : Type extends WeakMap ? DeepUndefinable extends object ? WeakMap, DeepUndefinable> : never : Type extends Set ? Set> : Type extends ReadonlySet ? ReadonlySet> : Type extends WeakSet ? DeepUndefinable extends object ? WeakSet> : never : Type extends ReadonlyArray ? Type extends IsTuple ? { [Key in keyof Type]: DeepUndefinable | undefined; } : Type extends Array ? Array> : ReadonlyArray> : Type extends Promise ? Promise> : Type extends {} ? { [Key in keyof Type]: DeepUndefinable; } : Type | undefined;