ReadonlyisFor runtime type checking.
ReadonlyisFor runtime type checking.
Iterates the collection's items.
The unfiltered walk — for (const sheet of wb.getSheets()). Every other iterable surface in
the SDK (ICellRange, ICellRegions, ICellRanges) reads this way, so a collection that did
not was a trap: for…of over one is the obvious line to write and it threw at runtime with
nothing in the types to warn first.
getItems remains the call that takes options — filtering, ordering, anything parameterized. This is sugar over the unfiltered case, not a replacement for it.
Adds a person, or returns the one already here with the same id or display name.
The person's properties, or a display name alone.
Add Listeners.
Optionaloptions: IListener.OptionsReturns the item at the given index, or undefined if there is none.
The position in iteration order. A negative index counts back from the end, as
Array.prototype.at does.
Returns the person with the given display name, or null if there is none.
The display name. Case sensitive, as Excel keeps it.
Returns the person with the given id, or null if there is none.
The person a new comment is authored by when none is named.
Excel uses the signed-in user; SheetXL has no user, so this is whoever setCurrent
named, and otherwise a person called Author, added on first use.
Returns the items in the collection.
Optionaloptions: ICollection.GetItemsOptionsThe optioned call — filtering, ordering, anything parameterized — and a snapshot: the array returned does not follow later changes to the collection. For the unfiltered items as a plain array prefer toArray.
Returns the index of the item in iteration order, or -1 if it is not in the collection.
The item to find.
Returns true once the collection has been closed.
A closed collection is empty and announces nothing further. Collections that are closed by
their owner (the workbook's names, functions and modules, when the workbook closes) announce
it once with ICollection.Events.onClose; the others are never closed and always
return false.
Names the person new comments are authored by.
A person, a person's properties, a display name, or null to forget the
choice. A person not yet in the collection is added.
Returns the items as a fresh array, in iteration order.
Holds the people a workbook knows: everyone who authored or is mentioned in a comment.
Remarks
Keyed by id. Adding a person whose id, or whose display name, is already here returns the existing one rather than a second copy, which is what lets a legacy note's author (a display name with no id) and a threaded comment's author (an id) land on one person.