import { Loose } from './Loose.js'; import './UnionMerge.js'; import './OmitNever.js'; import './Pretty.js'; import './Function.js'; /** * Make all or some properties in T required and non-nullable. * This utility is similar to the built-in `Required` utility in TypeScript * but allows specifying a subset of properties to be required * instead of requiring all properties. * * @template T The type to make some properties required. * @template K The subset of properties to make required. * @example Required<{ a?: string, b?: string }, 'a'> // { a: string, b?: string } */ type Required = Loose<{ [P in Exclude]: T[P]; } & { [P in K]-?: T[P]; }>; export type { Required };