EventConfig
EventConfig<
TMetadata,TCategory> =CoreEventConfig<TMetadata,TCategory> |BaseEventProperties<TMetadata,TCategory> &object
Generic event config - extended by plugins. Use the generic parameter to enforce metadata types.
The open (plugin) arm carries the full BaseEventProperties — so every
event config, core or plugin, is guaranteed an id and title. It has no
[key: string]: unknown index signature, so a plugin’s own interface
(LunarEvent, OffsetEvent, …) stays assignable without an as cast.
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" } };