import { Obj } from "./objects"; import { Nullable } from "./nullable-non-nullable"; /** * Shorthand for `Partial>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsOptional = { [TKey in TKeys]+?: TObj[TKey]; }; /** * Shorthand for `Required>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsRequired = { [TKey in TKeys]-?: TObj[TKey]; }; /** * Shorthand for `Readonly>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsReadonly = { +readonly [TKey in TKeys]: TObj[TKey]; }; /** * Shorthand for `Mutable>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsMutable = { -readonly [TKey in TKeys]: TObj[TKey]; }; /** * Shorthand for `NullableProps>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsNullableProps = { [TKey in TKeys]?: Nullable; }; /** * Shorthand for `NonNullableProps>`, but better optimized (into one mapped object type). * @param TObj Object type to pick properties from. * @param TKeys Union type of keys to pick. */ export type PickAsNonNullableProps = { [TKey in TKeys]-?: NonNullable; };