Spec

data class Spec(val version: Int, val style: Map<String, Style>, val breakpoints: List<Breakpoint>, val layout: Node, val handlers: Map<String, <Error class: unknown class>>? = null)

Top-level joy-dom document: the typed mirror of the spec JSON's root object.

Decode one with fromJson; the result feeds the layout/render pipeline (dom-layout resolves it into a render tree consumed by the platform renderers).

Parameters

version

document schema version. Always 1.

style

the style record: CSS selector string (div, .class, #id) → Style block.

breakpoints

media-query-conditioned style/node overrides, evaluated against the viewport.

handlers

the handlers region: event name → action, kept as raw JSON. A node's event prop names an entry here, and the action interpreter (dom-mutation) decodes it at dispatch time — the renderer never interprets one, so the typed action model stays out of the serialization layer. Absent on a document that owns no behaviour.

layout

root Node of the document's element tree.

Throws

IllegalArgumentException

if version is not 1.

Constructors

Link copied to clipboard
constructor(version: Int, style: Map<String, Style>, breakpoints: List<Breakpoint>, layout: Node, handlers: Map<String, <Error class: unknown class>>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val handlers: Map<String, <Error class: unknown class>>? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun Spec.toJson(pretty: Boolean = false): String

Serializes this Spec to spec JSON.