import { Prettify } from "./prettify"; /** * Make passed properties in the passed argument required * @example * ```ts * // { a: number; b?: string; c?: boolean } * type T0 = RequiredOnly<{ a?: number; b?: string; c?: boolean }, "a">; * ``` */ export type RequiredOnly = Prettify< Pick> & { [P in K]-?: T[P]; } >; /** * Make all properties in the passed argument required except for the passed properties * @example * ```ts * // { a?: number; b: string; c: boolean } * type T0 = RequiredExcept<{ a?: number; b?: string; c?: boolean }, "a">; * ``` */ export type RequiredExcept = Prettify< Pick & { [P in Exclude]-?: T[P]; } >;