Skip to content

SerializedCollection

The serialized form CalendaryInstance.toCollection / buildCollection emit — a Collection whose events are always plain configs, never builders, matching the .cdy JSON shape. Builders are an input authoring convenience; serialization compiles them away, so the output type carries no Buildable and a consumer can read events[i].title without narrowing.

optional $schema?: string

Optional JSON Schema URL for editor/AI validation + autocomplete of the .cdy document. Point it at the published schema: "https://calendaryjs.dev/schema/cdy.json". The core ignores it at runtime.

Collection.$schema


optional collection?: string

Collection name; used as the group id when id is omitted.

Collection.collection


optional color?: string

Group color, applied to every event that lacks its own (event-level wins).

Collection.color


events: EventConfig[]


optional id?: string

Group id (defaults to collection, else "collection").

Collection.id


optional name?: string

Group display name.

Collection.name


optional plugins?: string[]

Plugin package names the events need — validated on load.

Collection.plugins


optional priority?: number

Base priority for every event this collection loads that lacks its own (event-level wins). Overridable at load time via load(cdy, { priority }).

Collection.priority


optional version?: string

Collection version (semver-ish, informational).

Collection.version