Type Editor / @type-editor/history / state/create-rope-sequence
state/create-rope-sequence
Classes
| Class | Description |
|---|---|
Internal node in the rope sequence tree structure. Combines two child rope sequences (left and right) without copying their elements. | |
Leaf node in the rope sequence tree structure. Contains an array of actual elements with no child nodes. |
Variables
| Variable | Description |
|---|---|
A shared empty rope sequence instance for optimization purposes. Use this instead of creating new empty rope sequences. |
Functions
| Function | Description |
|---|---|
Create a rope sequence from an array or return the rope if already a rope sequence. This is a factory function that efficiently handles both array and rope sequence inputs. If the input is already a rope sequence, it returns it unchanged. If it's an array, it creates a new Leaf node, or returns an empty rope if the array is empty. Example typescript |