Create a type that requires at least one of the given keys. The remaining keys are kept as is.
import type {RequireAtLeastOne} from 'type-fest';type Responder = { text?: () => string; json?: () => string; secure?: boolean;};const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = { json: () => '{"message": "ok"}', secure: true}; Copy
import type {RequireAtLeastOne} from 'type-fest';type Responder = { text?: () => string; json?: () => string; secure?: boolean;};const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = { json: () => '{"message": "ok"}', secure: true};
Create a type that requires at least one of the given keys. The remaining keys are kept as is.