Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class BorderRadius(val topLeft: Length? = null, val topRight: Length? = null, val bottomRight: Length? = null, val bottomLeft: Length? = null)

Corner radii (border-radius) as four explicit corners.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Breakpoint(val conditions: List<MediaQuery>, val nodes: Map<String, NodeProps>, val style: Map<String, Style>)

A single responsive breakpoint: overrides applied when its conditions match the viewport.

Link copied to clipboard
sealed interface ChildNode

One entry in a node's children array.

Link copied to clipboard
sealed interface Color

A resolved color value.

Link copied to clipboard
Link copied to clipboard
data class Event(val type: String = "event", val name: String, val params: Map<String, <Error class: unknown class>>? = null)

An event-handler binding on a node prop (onclick, onfocus, onblur, onchange).

Link copied to clipboard
sealed interface FlexBasis
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed interface FontWeight
Link copied to clipboard
Link copied to clipboard
data class Length(val value: Double, val unit: Length.Unit)
Link copied to clipboard
sealed interface MediaQuery
Link copied to clipboard
data class Node(val type: String, val props: NodeProps? = null, val children: List<ChildNode>? = null, val extras: Map<String, <Error class: unknown class>> = emptyMap()) : Map<String, <Error class: unknown class>>

A node in the layout tree. The Map view exposes extras only — unknown keys sitting next to type/props/children — so node["custom-key"] reads a custom attribute while the reserved keys stay typed (type, props, children).

Link copied to clipboard
data class NodeProps(val id: String? = null, val className: List<String>? = null, val style: Style? = null, val onClick: Event? = null, val onFocus: Event? = null, val onBlur: Event? = null, val onChange: Event? = null, val extras: Map<String, <Error class: unknown class>> = emptyMap()) : Map<String, <Error class: unknown class>>

A node's props object. The Map view exposes extras only — unknown prop keys — so props["data-test"] reads a custom prop while the reserved keys stay typed (id, className, style, onClick, onFocus, onBlur, onChange).

Link copied to clipboard
Link copied to clipboard
data class ObjectPosition(val horizontal: ObjectPosition.Horizontal, val vertical: ObjectPosition.Vertical)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Spacing(val top: Length, val right: Length, val bottom: Length, val left: Length)

Box-model spacing (padding/margin) as four explicit sides.

Link copied to clipboard
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.

Link copied to clipboard
data class Style(val position: Position? = null, val display: Display? = null, val boxSizing: BoxSizing? = null, val zIndex: Int? = null, val overflow: Overflow? = null, val top: Length? = null, val left: Length? = null, val bottom: Length? = null, val right: Length? = null, val flexDirection: FlexDirection? = null, val flexGrow: Double? = null, val flexShrink: Double? = null, val flexBasis: FlexBasis? = null, val justifyContent: JustifyContent? = null, val alignItems: AlignItems? = null, val alignSelf: AlignSelf? = null, val flexWrap: FlexWrap? = null, val gap: Length? = null, val rowGap: Length? = null, val columnGap: Length? = null, val order: Int? = null, val width: Length? = null, val maxWidth: Length? = null, val minWidth: Length? = null, val height: Length? = null, val maxHeight: Length? = null, val minHeight: Length? = null, val backgroundColor: Color? = null, val opacity: Double? = null, val padding: Spacing? = null, val margin: Spacing? = null, val borderWidth: Length? = null, val borderColor: Color? = null, val borderStyle: BorderStyle? = null, val borderRadius: BorderRadius? = null, val fontFamily: String? = null, val fontSize: Length? = null, val fontWeight: FontWeight? = null, val fontStyle: FontStyle? = null, val color: Color? = null, val textDecoration: TextDecoration? = null, val textAlign: TextAlign? = null, val textTransform: TextTransform? = null, val lineHeight: Double? = null, val letterSpacing: Length? = null, val objectFit: ObjectFit? = null, val objectPosition: ObjectPosition? = null, val textOverflow: TextOverflow? = null, val whiteSpace: WhiteSpace? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

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

Serializes this Node to spec JSON.

fun Spec.toJson(pretty: Boolean = false): String

Serializes this Spec to spec JSON.