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 the module to the collection.
A unique identifier for the module. This can be either a name, a fully qualified path, or a url (e.g., a file name, a Git url with commit ID).
The module to add. This will generally come from IScript.createModule.
Optionaloptions: IModuleCollection.AddOptions
The options for adding the module.
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.
Convenience method for filtering by name. This is functionally equivalent to getItems({ name });
The name to search for This is case insensitive.
Returns functions that match the filter criteria.
If no filter criteria is provided, all items will be returned.
Optionaloptions: IModuleCollection.GetItemsOptions
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.
Returns the items as a fresh array, in iteration order.
Represents a collection of functions. This is analogous to a file.
Remarks
Keyed by the module's id, not ordered: iteration order is unspecified. The unfiltered walk (
for…of,getCount(),toArray()) is whatgetItems()returns with no options — the default language's modules; pass{ language: null }togetItemsfor every language.