ecspresso
    Preparing search index...

    Type Alias EventNameMatching<ET, Payload>

    EventNameMatching: {
        [K in keyof ET & string]: ET[K] extends Payload ? K : never
    }[keyof ET & string]

    Extract event names from an EventTypes record whose payload extends the given shape. Eliminates the need for each plugin to define its own mapped filter type.

    Type Parameters

    • ET extends Record<string, any>
    • Payload
    interface MyEventData { entityId: number }
    type MyEventName<ET> = EventNameMatching<ET, MyEventData>;