Edit in GitHubLog an issue

@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

NameType
T
extends ListItem

Hierarchy

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

NameTypeDescription
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[]

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.