Skip to content

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.

TMetadata extends Record<string, unknown> = Record<string, unknown>

Custom metadata type extending Record<string, unknown>

TCategory extends string = string

// Basic usage (any metadata)
const event: EventConfig = { type: "const", id: "x", ... };
// With typed metadata
interface MyMetadata { rank: string; color: string; }
const event: EventConfig<MyMetadata> = { ... metadata: { rank: "high", color: "red" } };