import { _IncNonneg } from "../number/int"; import { Omit, Optional, Pick } from "."; /** * @private */ type _PickN = NRequired extends N ? {} : { [K in keyof T]: Pick & _PickN, N, _IncNonneg>; }[keyof T]; /** * picks exactly `N` properties of `T`. * * @since 0.0.2 */ export type PickN = _PickN; /** * picks exactly one property of `T`. * useful when, for instance, exactly one of two mutually exclusive options must be defined. * * @since 0.0.2 */ export type PickOne = PickN; /** * @private */ type _PickNOrMore = NRequired extends N ? Optional : { [K in keyof T]: Pick & _PickNOrMore, N, _IncNonneg>; }[keyof T]; /** * picks at least `N` properties of `T`. * * makes all properties in `T` optional, but requires at least `N` properties to be defined. * * essentially `Partial`, but with at least `N` of its keys defined (i.e. `PickNOrMore` is functionally equivalent to `Partial`) * * @since 0.0.2 */ export type PickNOrMore = _PickNOrMore; /** * pick at least one property of `T` * * @since 0.0.2 */ export type PickOneOrMore = PickNOrMore; export {}; //# sourceMappingURL=pick-n.d.ts.map