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.
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.
Convenience method for filter by name. This is functionally equivalent to getItems({ name });
The name to search for This is case insensitive.
Optionaloptions: 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: IFunctionCollection.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.
The functions in the collection, narrowed by IFunctionCollection.GetItemsOptions.
Optionaloptions: IFunctionCollection.GetItemsOptionsSynchronous, and therefore deliberately narrower than IFunctionCollection.search: it
offers only the filters that read no IFunction.IDescriptor (name, type). Anything
that needs a descriptor — text, category, includeDeprecated — has to load them, which
is why it lives on search and returns a promise.
Unlike search, this does NOT resolve shadowing: a custom function sharing a built-in's name
is returned alongside it rather than in place of it.
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 functions that match the filter criteria.
If no filter criteria is provided, all items will be returned.
Optionaloptions: IFunctionCollection.SearchOptions
A search that reads DESCRIPTORS (SearchOptions.text / SearchOptions.category,
see below) returns results ordered — by relevance when there is text, alphabetically by
canonical name otherwise. Every other search returns them in registration order.
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.
name- and type-only searches are a cheap scan. text, category and an explicit
SearchOptions.includeDeprecated read each function's IFunction.IDescriptor,
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.