Wocart

@wocart/theme v4.1.0


@wocart/theme / index / resolveThemeSettings

Function: resolveThemeSettings()

resolveThemeSettings<T>(theme, stored, scope?): ThemeSettingsResult<InferSettings<T>>

The effective settings for rendering: every declared setting, from the store's value when the declaration accepts it, else from the theme's default. stored is the persisted object as it arrived (anything else — null, an array — reads as no values and is reported). Translated text uses scope.locales; text settings may default from scope.content. The values are typed from the declaration (InferSettings<typeof theme>): a setting with a default is always there, any other may be absent.

Type Parameters

T

T extends ThemeDefinition

Parameters

theme

T

stored

unknown

scope?

ResolutionScope

Returns

ThemeSettingsResult<InferSettings<T>>