@add-on-hlapi-sdk / ReadOnlyItemList
Class: ReadOnlyItemList<T>
ReadOnlyItemList represents an ordered list of API objects, representing items that are all children of the same parent node. (The reverse is not necessarily true, however: this list might not include all children that exist in the parent node. See allChildren for details).
Items in a bare ReadOnlyItemList cannot be added, removed, or reordered. Subclasses like ItemList may add these capabilities, however.
Type parameters
| Name | Type |
|---|---|
T | extends ListItem |
Hierarchy
TemplatizedProxyLiveObject↳
ReadOnlyItemList↳↳
ArtboardList↳↳
ItemList↳↳
PageList
Table of contents
Accessors
Methods
Accessors
first
• get first(): undefined | T
First item in this list, or undefined if list is empty.
Returns
undefined | T
last
• get last(): undefined | T
Last item in this list, or undefined if list is empty.
Returns
undefined | T
length
• get length(): number
Number of items in this list.
Returns
number
Methods
[iterator]
▸ [iterator](): Iterator<T, any, undefined>
Iterates over all the items in this list. Mutations that occur mid-iteration are not reflected by the iterator.
Returns
Iterator<T, any, undefined>
item
▸ item(index): undefined | T
Returns item at the given index, or undefined if index is out of range.
Parameters
| Name | Type | Description |
|---|---|---|
index | number | Zero-based index |
Returns
undefined | T
toArray
▸ toArray(): readonly T[]
All items in the list, as a static array. Mutations that occur later are not reflected in an array returned earlier.
Returns
readonly T[]

