FunctionDecl
FunctionDecl defines a function name, overload set, and optionally a singleton definition for all overload instances.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FunctionDecl(
nameValue,options?):FunctionDecl
Constructor accepts the function name and plain TypeScript option-object configuration.
Parameters
Section titled “Parameters”nameValue
Section titled “nameValue”string
options?
Section titled “options?”FunctionDeclOptions = {}
Returns
Section titled “Returns”FunctionDecl
Methods
Section titled “Methods”addOverload()
Section titled “addOverload()”addOverload(
overload):void
AddOverload ensures that the new overload does not collide with an existing overload signature; however, if the function signatures are identical, the implementation may be rewritten as its difficult to compare functions by object identity.
Parameters
Section titled “Parameters”overload
Section titled “overload”Returns
Section titled “Returns”void
bindings()
Section titled “bindings()”bindings():
Overload[]
Bindings produces a set of function bindings, if any are defined.
Returns
Section titled “Returns”Overload[]
description()
Section titled “description()”description():
string
Description provides an overview of the function’s purpose.
Usage examples should be included on specific overloads.
Returns
Section titled “Returns”string
documentation()
Section titled “documentation()”documentation():
Doc
Documentation generates documentation about the Function and its overloads as a common.Doc object.
Returns
Section titled “Returns”hasLateBinding()
Section titled “hasLateBinding()”hasLateBinding():
boolean
HasLateBinding returns true if the function has late bindings. A function cannot mix late bindings with other bindings.
Returns
Section titled “Returns”boolean
hasSingletonBinding()
Section titled “hasSingletonBinding()”hasSingletonBinding():
boolean
HasSingletonBinding indicates whether the function has a singleton binding definition.
Returns
Section titled “Returns”boolean
isDeclarationDisabled()
Section titled “isDeclarationDisabled()”isDeclarationDisabled():
boolean
IsDeclarationDisabled indicates that the function declaration should not be exposed for expressions.
Returns
Section titled “Returns”boolean
merge()
Section titled “merge()”merge(
other):FunctionDecl
Merge combines an existing function declaration with another.
If a function is extended, by say adding new overloads to an existing function, then it is merged with the prior definition of the function at which point its overloads must not collide with pre-existing overloads and its bindings (singleton, or per-overload) must not conflict with previous definitions either.
Parameters
Section titled “Parameters”FunctionDecl
Returns
Section titled “Returns”FunctionDecl
name()
Section titled “name()”name():
string
Name returns the function name in human-readable terms, e.g. ‘contains’ of ‘math.least’
Returns
Section titled “Returns”string
overloadDecls()
Section titled “overloadDecls()”overloadDecls():
OverloadDecl[]
OverloadDecls returns the overload declarations in declaration order.
Returns
Section titled “Returns”subset()
Section titled “subset()”subset(
selector):FunctionDecl|undefined
Subset returns a new function declaration which contains only the overloads with the specified IDs. If the subset function contains no overloads, then undefined is returned to indicate the function is not functional.
Parameters
Section titled “Parameters”selector
Section titled “selector”Returns
Section titled “Returns”FunctionDecl | undefined