devtypes - v1.1.0
    Preparing search index...

    Type Alias RequireAllOrNone<T, K>

    RequireAllOrNone: T & Required<Pick<T, K>> | RequireNone<T, K>

    Require all or none of a set of properties.

    Type Parameters

    • T

      Source object type

    • K extends keyof T

      Keys participating in the constraint

    1.1.0

    Either all specified properties must be present, or none of them.

    type Test = { a?: string; b?: number; c: boolean };
    type Result = RequireAllOrNone< Test, 'a' | 'b' >;
    // { a: string; b: number; c: boolean } | { c: boolean; a?: never; b?: never; }