Edit in GitHubLog an issue

@add-on-hlapi-sdk / PageList

Class: PageList

PageList represents an ordered list of PageNodes, all of which are children of the root node of the document's "scenegraph" artwork tree. A page contains one or more artboards, representing "scenes" in a linear timeline sequence. Those artboards in turn contain all the visual content of the document.

PageList also provides APIs for adding/removing pages from the document. PageList is never empty: it is illegal to remove the last remaining page from the list.

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

Inherited from

ReadOnlyItemList.first


last

get last(): undefined | T

Last item in this list, or undefined if list is empty.

Returns

undefined | T

Inherited from

ReadOnlyItemList.last


length

get length(): number

Number of items in this list.

Returns

number

Inherited from

ReadOnlyItemList.length

Methods

[iterator]

[iterator](): Iterator<PageNode, any, undefined>

Iterates over all the items in this list. Mutations that occur mid-iteration are not reflected by the iterator.

Returns

Iterator<PageNode, any, undefined>

Inherited from

ReadOnlyItemList.[iterator]


addPage

addPage(geometry): PageNode

Create a new page containing a single empty artboard, and add it to the end of the list. The artboard is configured with the same defaults as in addArtboard. The page's artboard becomes the default target for newly inserted content (insertionParent) and the viewport switches to display this artboard.

Parameters

NameTypeDescription
geometry
The size of the new page.

Returns

PageNode


item

item(index): undefined | PageNode

Returns item at the given index, or undefined if index is out of range.

Parameters

NameTypeDescription
index
number
Zero-based index

Returns

undefined | PageNode

Inherited from

ReadOnlyItemList.item


toArray

toArray(): readonly PageNode[]

All items in the list, as a static array. Mutations that occur later are not reflected in an array returned earlier.

Returns

readonly PageNode[]

Inherited from

ReadOnlyItemList.toArray

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