DistributedOmit | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Type Alias DistributedOmit<X, Y>

    DistributedOmit: X extends object ? Omit<X, keyof X & Y> : never

    Applies Omit to all types in a union. Allows all keys that are not present in any object in the union. Warning: You might not be able to use all keys of the union if TypeScript has narrowed the union to a specific type. Eg:

    type A = { x: number; t: "a"; a: number } | { x: number; t: "b"; b: number };
    const a: A = { t: "a", a: 1 };
    const b = omit(a, ["b"]); // No overload matches this call. <snip> Type '"b"' is not assignable to type '"a" | "t" | "d"'.

    Type Parameters

    Type of the supplied object

    Type of the property keys to leave out

    Type with only the specified keys left out (distributed over the union if present)