EventConfig
EventConfig<
TMetadata,TCategory> =CoreEventConfig<TMetadata,TCategory> | {[key:string]:unknown;metadata?:TMetadata;type:string; }
Generic event config - extended by plugins. Use the generic parameter to enforce metadata types.
Type Parameters
Section titled “Type Parameters”TMetadata
Section titled “TMetadata”TMetadata extends Record<string, unknown> = Record<string, unknown>
Custom metadata type extending Record<string, unknown>
TCategory
Section titled “TCategory”TCategory extends string = string
Example
Section titled “Example”// Basic usage (any metadata)const event: EventConfig = { type: "const", id: "x", ... };
// With typed metadatainterface MyMetadata { rank: string; color: string; }const event: EventConfig<MyMetadata> = { ... metadata: { rank: "high", color: "red" } };