CustomEventConfig
CustomEventConfig<
TMetadata,TCategory,TExclude> =Partial<Omit<BaseEventProperties<TMetadata,TCategory>,"id"|"metadata"|TExclude>> &object
Custom event configuration for overriding event properties. Used by generator packages to allow customization of generated events.
Type Declaration
Section titled “Type Declaration”metadata?
Section titled “metadata?”
optionalmetadata?:Partial<TMetadata>
Partial metadata to merge with the base event’s metadata. Only specify the fields you want to add or override. The base metadata fields will be preserved.
Example
Section titled “Example”// Only add extra fields - base metadata (rank, season, etc.) is preservedmetadata: { wikiFileUrl: "christmas.md" }overrideDates?
Section titled “overrideDates?”
optionaloverrideDates?:OverrideDatesMap
Force reschedule dates unconditionally. Unlike onConflict which handles conflicts, this always moves events. Key is the original computed date, value is the new date.
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
TExclude
Section titled “TExclude”TExclude extends keyof BaseEventProperties<TMetadata, TCategory> = never
Fields to exclude from customization (default: never)
Example
Section titled “Example”// Allow all fields except idconst customConfig: CustomEventConfig<{ localName: string }> = { title: "Easter Sunday", keywords: ["easter", "resurrection"], metadata: { localName: "Pâques" }, url: "https://example.com/easter",};
// Force reschedule to different datesconst customConfig: CustomEventConfig = { overrideDates: { "2026-02-18": "2026-02-20", // Move Ash Wednesday },};
// Restrict certain fields from customizationtype RestrictedConfig = CustomEventConfig<MyMetadata, "status" | "reminders">;// Now status and reminders cannot be customized