@karmaniverous/entity-tools
    Preparing search index...

    Type Alias MutuallyExclusive<T>

    MutuallyExclusive: T extends [infer Head, ...(infer Tail)]
        ? [Head] extends [string]
            ? Tail extends string[]
                ? [Head] extends [never]
                    ? MutuallyExclusive<Tail>
                    : AllDisjoint<Head & string, Tail> extends true
                        ? MutuallyExclusive<Tail>
                        : AllDisjoint<Head & string, Tail>
                : true
            : true
        : true

    Returns true if there is no intersection between the elements of T.

    Type Parameters

    • T extends string[]

      The tuple of string types to check for mutual exclusivity.

    true if there is no intersection between the elements of T, otherwise a custom error type.

    type ReturnsTrue = MutuallyExclusive<['a', 'b' | 'c', 'd']>;
    // true

    type ReturnsError = MutuallyExclusive<['a', 'b' | 'c', 'c']>;
    // { __error__: 'overlaps on c' }