Skip to main content

Type Alias: RequireAllOrNoneFields<T>

RequireAllOrNoneFields<T> = { [K in keyof T]-?: NonNullable<T[K]> } | { [K in keyof T]?: undefined }

Defined in: src/types/typeUtils.ts:14

Models a group of fields that must either be provided together or omitted.

Type Parametersโ€‹

Tโ€‹

T extends object

Remarksโ€‹

The "all" branch requires every property to be present with a non-nullish value, while the "none" branch narrows the same properties to undefined. This mirrors the behavior of RequireAllOrNone from type-fest without introducing redundant intersection constituents that trip our lint rules.