TuilEvent
interface exported by @mwillbanks/tuil-events.
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
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
id | string | Yes | The id member uses the string contract. | — |
type | TType | Yes | The type member uses the TType contract. | — |
payload | TPayload | Yes | The payload member uses the TPayload contract. | — |
timestamp | number | Yes | The timestamp member uses the number contract. | — |
source | EventSource | undefined | No | The source member uses the EventSource | undefined contract. | EventSource |
target | EventTarget | undefined | No | The target member uses the EventTarget | undefined contract. | EventTarget |
metadata | Readonly<Record<string, unknown>> | Yes | The metadata member uses the Readonly<Record<string, unknown>> contract. | — |
priority | EventPriority | Yes | The priority member uses the EventPriority contract. | EventPriority |
phase | EventPhase | Yes | The phase member uses the EventPhase contract. | EventPhase |
currentTarget | string | undefined | No | The currentTarget member uses the string | undefined contract. | — |
defaultPrevented | boolean | Yes | The defaultPrevented member uses the boolean contract. | — |
propagationStopped | boolean | Yes | The propagationStopped member uses the boolean contract. | — |
preventDefault | () => void | Yes | The preventDefault member uses the () => void contract. | — |
stopPropagation | () => void | Yes | The 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.
Related types
Source
View the secondary source reference