Class: ReadOnlyItemList<T>
ReadOnlyItemList represents an ordered list of API objects that are all children of the same parent node.
Items in a bare ReadOnlyItemList cannot be added, removed, or reordered. The ItemList subclass adds more capabilities, and is most frequently encountered as ArtboardNode.children or GroupNode.children.
Extends
unknown<HzApiInputType>
Extended by
Type Parameters
T extends ListItemConstructors
Constructor
new ReadOnlyItemList<T>(): ReadOnlyItemList<T>;
Returns
ReadOnlyItemList<T>
Inherited from
TemplatizedProxyLiveObject<HzApiInputType>.constructor
Accessors
length
Get Signature
get length(): number;
Number of items in this list.
Returns
number
first
Get Signature
get first(): T | undefined;
First item in this list, or undefined if list is empty.
Returns
T | undefined
last
Get Signature
get last(): T | undefined;
Last item in this list, or undefined if list is empty.
Returns
T | undefined
Methods
indexOf()
indexOf(item): number;
Get index of item in list.
Parameters
itemTReturns
number
index number, or -1 if item isn't in this list.
item()
item(index): T | undefined;
Returns item at the given index, or undefined if index is out of range.
Parameters
indexnumberReturns
T | undefined
[iterator]()
iterator: Iterator<T>;
Iterates over all the items in this list. Mutations that occur mid-iteration are not reflected by the iterator.
Returns
Iterator<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[]