Node

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).

Parameters

type

element type: a built-in (div, img, p, h1h6, span) or a custom component type string the renderer registers a component for.

props

this node's prop object, or null when absent.

children

child nodes, or null when absent (distinct from an empty list).

extras

unknown sibling keys preserved verbatim; must not contain a reserved key.

Throws

IllegalArgumentException

if extras contains any of type, props, children.

Constructors

Link copied to clipboard
constructor(type: String, props: NodeProps? = null, children: List<ChildNode>? = null, extras: Map<String, <Error class: unknown class>> = emptyMap())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val children: List<ChildNode>? = null
Link copied to clipboard
open override val entries: Set<Map.Entry<String, <Error class: unknown class>>>
Link copied to clipboard
val extras: Map<String, <Error class: unknown class>>
Link copied to clipboard
open override val keys: Set<String>
Link copied to clipboard
val props: NodeProps? = null
Link copied to clipboard
open override val size: Int
Link copied to clipboard
Link copied to clipboard
open override val values: Collection<<Error class: unknown class>>

Functions

Link copied to clipboard
open override fun containsKey(key: String): Boolean
Link copied to clipboard
open override fun containsValue(value: <Error class: unknown class>): Boolean
Link copied to clipboard
open operator override fun get(key: String): <Error class: unknown class>?
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun Node.toJson(pretty: Boolean = false): String

Serializes this Node to spec JSON.