@truenas/api-client
    Preparing search index...

    Type Alias EventUnion<D, E>

    EventUnion:
        | EventArm<D, E, "added">
        | EventArm<D, E, "changed">
        | EventArm<D, E, "removed">
        | UndeclaredArm<D, E>

    What subscribing to E emits: a union discriminated on msg.

    The arms differ in more than their payload — a removal carries an id and no fields in 55 of the 56 collections that declare one — so narrowing on msg is what makes the payload safe to reach.

    Type Parameters