Node structure that adheres to this type
Optional keys in the node structure
Additional properties and methods
Optional
defaultGenerators?: { [K in keyof TNode]?: () => TNode[K] }Default generators defined so far.
Registers action methods for nodes of this type
Actions are methods that can modify the node state and are automatically wrapped in MobX actions for proper state tracking.
Record of action methods
An object of action methods
The same NodeType with added action methods that accept a node as their first parameter
Registers computed methods for nodes of this type
Computed methods derive values from the node state and are automatically memoized by MobX for performance optimization.
Record of computed properties
Function that receives a node and returns an object of computed accessor methods
The same NodeType with added computed methods that accept a node as their first parameter
Define default values for keys in TOptional. When omitted, those properties are filled with the results of these generators.
Record of default value generators
Registers getter methods for nodes of this type
Getters are methods that derive values from the node state without modifying it.
Record of getter methods
An object of getter methods
The same NodeType with added getter methods that accept a node as their first parameter
Generates setter methods for specified properties
Names of properties to create setters for
The same NodeType with added setter methods
Adds volatile state properties to nodes of this type
Volatile state is not persisted in snapshots and is local to each node instance.
Object where each key defines a getter function for volatile state
The same NodeType with added accessor methods for the volatile state
Base node type definition with core functionality