tuil
ReferencePackages@mwillbanks/tuil-eventsAPI

TuilEvent

interface exported by @mwillbanks/tuil-events.

View rawEdit

interface

Public interface exported by @mwillbanks/tuil-events.

export interface TuilEvent<TType extends string = string, TPayload = unknown> {
  readonly id: string;
  readonly type: TType;
  readonly payload: TPayload;
  readonly timestamp: number;
  readonly source?: EventSource;
  readonly target?: EventTarget;
  readonly metadata: Readonly<Record<string, unknown>>;
  readonly priority: EventPriority;
  readonly phase: EventPhase;
  readonly currentTarget?: string;
  readonly defaultPrevented: boolean;
  readonly propagationStopped: boolean;
  preventDefault(): void;
  stopPropagation(): void;
}

Members

MemberTypeRequiredDescriptionRelated types
idstringYesThe id member uses the string contract.
typeTTypeYesThe type member uses the TType contract.
payloadTPayloadYesThe payload member uses the TPayload contract.
timestampnumberYesThe timestamp member uses the number contract.
sourceEventSource | undefinedNoThe source member uses the EventSource | undefined contract.EventSource
targetEventTarget | undefinedNoThe target member uses the EventTarget | undefined contract.EventTarget
metadataReadonly<Record<string, unknown>>YesThe metadata member uses the Readonly<Record<string, unknown>> contract.
priorityEventPriorityYesThe priority member uses the EventPriority contract.EventPriority
phaseEventPhaseYesThe phase member uses the EventPhase contract.EventPhase
currentTargetstring | undefinedNoThe currentTarget member uses the string | undefined contract.
defaultPreventedbooleanYesThe defaultPrevented member uses the boolean contract.
propagationStoppedbooleanYesThe propagationStopped member uses the boolean contract.
preventDefault() => voidYesThe preventDefault member uses the () => void contract.
stopPropagation() => voidYesThe stopPropagation member uses the () => void contract.

Parameters

This declaration has no public members.

Returns

This declaration does not return a value.

Throws

No thrown errors are documented for this declaration.

Source

View the secondary source reference

Package

@mwillbanks/tuil-events

On this page