Tree interface for convenient method chaining
Kind: global class
- Triply
- new Triply([props])
- .insertAfter([props], [ref]) ⇒
Triply
- .appendChild([props], [ref]) ⇒
Triply
- .push([props]) ⇒
Triply
- .remove() ⇒
Object
- .pop() ⇒
Object
- .insertBefore([props], [ref]) ⇒
Triply
- .open([props]) ⇒
Triply
- .close() ⇒
Triply
- .movePrevious() ⇒
Triply
- .moveNext() ⇒
Triply
- .movePreviousSibling() ⇒
Triply
- .moveNextSibling() ⇒
Triply
- .moveFirstChild() ⇒
Triply
- .moveLastChild() ⇒
Triply
- .mark(name) ⇒
Triply
- .unmark(name) ⇒
Triply
- .traverse()
- .next() ⇒
Object
|void
- .previous() ⇒
Object
|void
- .peek() ⇒
Object
|void
- .firstChild() ⇒
Object
|void
- .lastChild() ⇒
Object
|void
- .nextSibling() ⇒
Object
|void
- .previousSibling() ⇒
Object
|void
- .openBefore(props, [lastSib]) ⇒
Triply
- .moveRoot() ⇒
Triply
Create a new tree, using the provided object as the first node
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
triply.insertAfter([props], [ref]) ⇒ Triply
append a sibling after the provided reference or the insertion point
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
[ref] | Object |
Reference node |
triply.appendChild([props], [ref]) ⇒ Triply
append a child node to the provided reference or the insertion point
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
[ref] | Object |
Reference node |
triply.push([props]) ⇒ Triply
Alias for insertAfter
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
Remove the node at the insertion point returns the removed node so it can be reused
Kind: instance method of Triply
Returns: Object
- The removed node-formatted object
Alias for remove
Kind: instance method of Triply
Returns: Object
- The removed node-formatted object
triply.insertBefore([props], [ref]) ⇒ Triply
insert (new) node before insertion point
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
[ref] | Object |
Reference node |
triply.open([props]) ⇒ Triply
insert new child in current insertion point
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
Object / node-formatted |
triply.close() ⇒ Triply
move insertion point down one level (if possible)
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.movePrevious() ⇒ Triply
move insertion point back
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.moveNext() ⇒ Triply
move insertion point forward
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.movePreviousSibling() ⇒ Triply
move insertion point to previous sibling
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.moveNextSibling() ⇒ Triply
move insertion point to next sibling
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.moveFirstChild() ⇒ Triply
move insertion point to first child (if have)
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.moveLastChild() ⇒ Triply
move insertion point to last child (if have)
Kind: instance method of Triply
Returns: Triply
- The updated object
triply.mark(name) ⇒ Triply
store the insertion point into a bookmark
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Description |
---|---|---|
name | String | Number |
The name of the bookmark |
triply.unmark(name) ⇒ Triply
Restore the insertion point to the set bookmark
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Description |
---|---|---|
name | String | Number |
The name of the bookmark |
Traverse
Kind: instance method of Triply
Look at next node in traversal after insertion point, skipping closes
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at previous node in traversal before insertion point, skipping closes
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at the insertion point
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at the first child of the insertion point
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at the last child of the insertion point
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at the next sibling of the insertion point
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
Look at the previous sibling of the insertion point
Kind: instance method of Triply
Returns: Object
| void
- Node-formatted object (if any)
triply.openBefore(props, [lastSib]) ⇒ Triply
Create a new branch before the insertion point and add all its siblings up to lastSibling
Kind: instance method of Triply
Returns: Triply
- The updated object
Param | Type | Description |
---|---|---|
props | Object |
Initial object |
[lastSib] | Object |
The last sibling to add to the branch |
triply.moveRoot() ⇒ Triply
Move insertion point to root
Kind: instance method of Triply
Returns: Triply
- The updated object