Skip to content
HomePagesHomePages template kit

defineSchema

Declare a section's schema from `label` + per-kind slot builders.

Declare a section’s schema from label + per-kind slot builders. Returns the authored { meta, slots } shape CI serializes, with SectionProps<typeof schema> byte-identical to the hand-written as const form.

Import from @homepages/template-kit.

function defineSchema<const Slots extends Record<string, Slot>, const Display extends DisplayInput = Record<string, never>, const Layout extends SectionLayoutOf<Slots> = readonly []>(input: DefineSchemaInput<Slots, Display, Layout>): DefinedSchema<Slots, Display, Layout>
Name Type Required Description
input DefineSchemaInput<Slots, Display, Layout> required

DefinedSchema<Slots, Display, Layout>