Wocart

@wocart/theme v4.1.0


@wocart/theme / index / ThemeDefinition

Interface: ThemeDefinition

The catalog a theme ships — the unit the renderer and validator consume.

Properties

areas?

optional areas?: readonly AreaSpec[]

The parts every page shares, each a document of sections (area:<key>).


components

components: Record<string, ComponentDefinition>


content?

optional content?: Readonly<Record<LocaleCode, Readonly<Record<string, string>>>>

The theme's own text, one pack per language: what a contentKey field shows until the merchant edits it, and the store-wide labels a merchant may override. Declared, every contentKey must exist in every pack, and the manifest carries the packs so an editor shows inherited text.


key

key: string


locales?

optional locales?: readonly string[]

The languages this theme's content packs cover (BCP 47), e.g. ["ar", "fr", "en"]. Declared, the validator requires every translated label to cover all of them, and the manifest tells an editor which languages the theme can serve. Absent means "not declared".


preview?

optional preview?: boolean

true: the theme serves a preview route at THEME_PREVIEW_PATH, so an editor can show a draft on the live storefront. Absent: no preview.


settings?

optional settings?: readonly SettingsGroup[]

The theme's global settings: what a merchant may change about the whole theme (its font, its colors, which menu the header shows), declared with the same fields sections use, in named groups. Optional and additive. A store's values are read with resolveThemeSettings; a writer checks them with checkThemeSettings. Setting keys are unique across all groups.


style?

optional style?: ThemeStyle

The sizes this theme gives the platform's style steps and widths. A style field offers only what is given here; the SDK's stylesheet (themeStylesEndpoint) is made from it.


surfaces?

optional surfaces?: readonly SurfaceSpec[]

The surfaces this theme can render, declared as data. Optional and additive: a theme that declares none is treated as declaring none, and no existing page-document behavior changes — parsePageData / validatePageData never consult this list. Surface enforcement (rejecting a document whose surface the theme does not serve) is a later, separately tested concern; the manifest carries the declaration now so an editor can offer only valid surfaces.


version

version: string