import { Simplify } from "./Simplify.js"; //#region src/types/SetOptional.d.ts /** * Makes the given keys `K` of `T` optional, leaving the rest unchanged. * Like the built-in `Partial`, but scoped to specific keys. * * Distributes over unions, so a union stays a union. * * @template T - The object type to transform. * @template K - The keys to make optional. * * @example * type User = { id: number; name: string; email: string }; * type UserDraft = SetOptional; * // => { id: number; name: string; email?: string } */ type SetOptional = T extends unknown ? Simplify & Partial>> : never; //#endregion export { SetOptional };