Skip to content

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.

optional metadata?: 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.

// Only add extra fields - base metadata (rank, season, etc.) is preserved
metadata: { wikiFileUrl: "christmas.md" }

optional overrideDates?: 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.

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

Custom metadata type extending Record<string, unknown>

TCategory extends string = string

TExclude extends keyof BaseEventProperties<TMetadata, TCategory> = never

Fields to exclude from customization (default: never)

// Allow all fields except id
const customConfig: CustomEventConfig<{ localName: string }> = {
title: "Easter Sunday",
keywords: ["easter", "resurrection"],
metadata: { localName: "Pâques" },
url: "https://example.com/easter",
};
// Force reschedule to different dates
const customConfig: CustomEventConfig = {
overrideDates: {
"2026-02-18": "2026-02-20", // Move Ash Wednesday
},
};
// Restrict certain fields from customization
type RestrictedConfig = CustomEventConfig<MyMetadata, "status" | "reminders">;
// Now status and reminders cannot be customized