import { AnyRecord } from "../any-record"; import { Builtin } from "../built-in"; export type DeepPick = Type extends Builtin ? Type : Type extends Map ? Filter extends Map ? Map> : Type : Type extends ReadonlyMap ? Filter extends ReadonlyMap ? ReadonlyMap> : Type : Type extends WeakMap ? Filter extends WeakMap ? WeakMap> : Type : Type extends Set ? Filter extends Set ? Set> : Type : Type extends ReadonlySet ? Filter extends ReadonlySet ? ReadonlySet> : Type : Type extends WeakSet ? Filter extends WeakSet ? WeakSet> : Type : Type extends Array ? Filter extends Array ? Array> : Type : Type extends Promise ? Filter extends Promise ? Promise> : Type : Filter extends AnyRecord ? { [Key in keyof Type as Key extends keyof Filter ? Key : never]: Filter[Key & keyof Filter] extends true ? Type[Key] : Key extends keyof Filter ? DeepPick : never; } : never;