The item at the given index, or undefined if there is none — wb.getWorksheets()[0].
ReadonlyisFor runtime type checking.
ReadonlyisFor runtime type checking.
ReadonlylengthThe number of items — the same as getCount.
Iterates the collection's items.
The unfiltered walk — for (const sheet of wb.getWorksheets()). 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.
Add a custom function to the collection.
Either TypeScript source, a pre-built IFunction, or IFunctionCollection.AddOptions.
The registered function. When source is supplied and defines multiple functions, all are registered and the first (primary) one is returned.
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 true if the predicate accepts every item, including when there are none.
Called once per item in iteration order until it returns false.
Returns the items the predicate accepts, in iteration order.
Called once per item.
Returns the first item the predicate accepts, or undefined if it accepts none.
Called once per item in iteration order until it returns true.
Returns the index of the first item the predicate accepts, or -1 if it accepts none.
Called once per item in iteration order until it returns true.
Calls the function once per item, in iteration order.
Called once per item.
The function with this name, hidden or not.
The name to search for This is case insensitive.
Optionaloptions: IFunctionCollection.GetByNameOptions
With options.sheet, returns a NEW instance bound to that sheet, for calling the function
as a regular API outside the calculation graph — reference arguments and address strings
resolve against the bound sheet with no evaluation current, and the instance is safe to
hold across awaits. Without options, the shared registry instance is returned (the one the
engine evaluates with); its reference resolution requires an active evaluation.
A defined name whose body is LAMBDA(…) answers too, when no function has the name: a function
whose isLambda() is true, with the lambda's parameters and, as its summary, the name's comment
(or its formula, without one).
getItems and search list these under the category Lambda. options.sheet only
chooses which sheet's names are visible — a named lambda cannot be bound or called outside its name.
The categories the collection's functions declare, each with how many functions carry it.
Optionaloptions: GetCategoryOptions
The categories, ordered by name. Never contains an empty category — a category exists because a function is in it.
The category is a display string owned by the descriptor (Math & Trig, Date & Time, …), so
this is a descriptor-reading call with the same lazy cost as a text search — and, being
per-language, it re-derives when the language changes. It exists so a function picker can build
its category list from what is actually registered (custom functions included) rather than from
a hard-coded table that silently drifts.
How many functions getItems returns for the same options.
Optionaloptions: IFunctionCollection.GetItemsOptions
The functions in the collection, ordered by canonical name.
Optionaloptions: IFunctionCollection.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.
getItems, with the filters that read a function's IFunction.IDescriptor.
Optionaloptions: IFunctionCollection.SearchOptions
Without SearchOptions.text or SearchOptions.category, returns exactly what
getItems returns for the same options.
By relevance when there is text, by canonical name otherwise.
With text, relevance is: an exact name, then a name prefix, then a name substring, then the
same three for the LOCALIZED name (each one tier behind its canonical counterpart), and finally
a summary substring. Matching is case-insensitive "contains" — never fuzzy.
text and category read each function's descriptor, which loads (once, lazily, per language)
the descriptor chunk of every module — pennies for a search box, but not something to put on a
hot path.
Returns true if the predicate accepts at least one item.
Called once per item in iteration order until it returns true.
Collections of IFunction.
Remarks
Keyed by name, not ordered: iteration order is unspecified.