Interface IEvent<TPayload>

The definioten of the event. This is different from the event emission.

interface IEvent<TPayload> {
    [symbolEvent]: true;
    [symbolFilePath]: string;
    id: string;
    meta?: IEventMeta;
    optional: (() => IOptionalDependency<IEvent<TPayload>>);
    payloadSchema?: IValidationSchema<TPayload>;
    tags: TagType[];
}

Type Parameters

  • TPayload = any

Hierarchy (view full)

Properties

[symbolEvent]: true

We use this event to discriminate between resources with just 'id' and 'events' as they collide. This is a workaround, should be redone using classes and instanceof.

[symbolFilePath]: string
id: string
meta?: IEventMeta
optional: (() => IOptionalDependency<IEvent<TPayload>>)

Return an optional dependency wrapper for this event.

payloadSchema?: IValidationSchema<TPayload>

Optional validation schema for runtime payload validation. When provided, event payload will be validated when emitted.

tags: TagType[]