Options
All
  • Public
  • Public/Protected
  • All
Menu

External module seng-event/lib/EventTypings

Index

Type aliases

DataForIsomorphicEvent

DataForIsomorphicEvent: DataForIsomorphicEvent<T, TTypes, TDataTypes>

Looks up the string literal type T in the tuple type TTypes, and returns the data type that can be found at the same index on TDataTypes

EventHandlerForEvent

EventHandlerForEvent: function

Event handler for an event with the given type

Type declaration

    • (event: TEvent): any
    • Parameters

      • event: TEvent

      Returns any

EventListenerMap

EventListenerMap: object

Map of EventListenerData which is stored on each EventDispatcher

Type declaration

ExtractEventIfTypeContains

ExtractEventIfTypeContains: ExtractEventIfTypeContains<TEvent, TType>

Takes a union of possible events TEvent, and extract only the events that contain a type property that can possibly be TType

ExtractEventOfType

ExtractEventOfType: UnpackIsomorphic<ExtractEventIfTypeContains<TEvent, TType>, TType>

Takes a union of event types, possible created with createEventClass or createIsomorphicEventClass, and extracts the correct typings based on the given type TType

ExtractEventTypeIfContains

ExtractEventTypeIfContains: ExtractEventTypeIfContains<TEvent, TType>

Returns the (union) type of the type property on an event if and only if that type contains the given TType

example

If TEvent is an AbstractEvent with type 'FOO'|'BAR', and TType is 'BAR', this will return 'FOO'|'BAR'

example

If TEvent is an AbstractEvent with type 'FOO'|'BAR', and TType is 'FOOBAR', this will return never

TypesForEvent

TypesForEvent: TEvent["type"]

Extract the typeof the type property of an AbstractEvent (which is possibly a union)

UnpackIsomorphic

UnpackIsomorphic: UnpackIsomorphic<TEvent, TType>

Takes an event TEvent. If TEvent extends IsomorphicBaseEvent, it will narrow down this IsomorphicBaseEvent to one which has the given TType

Generated using TypeDoc