Skip Navigation
Type MethodMethod

parse(_:warningHandler:)

Parses theme settings from JSON data.

static func parse(
    _ data: Data,
    warningHandler: (any ThemeParsingWarningHandler)? = nil
) throws -> ThemeSettings.Root

Parameters

data

The JSON data to parse.

warningHandler

Receives warnings about unknown keys, or nil to ignore them.

Return Value

The parsed theme settings.

Discussion

This uses the same parser and validation as the build-time theme compiler: unknown keys and feature switches are reported to the warning handler.