SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IFunction

    A self-describing, type-safe, executable function.

    Built-in and user-defined functions share this interface. It pairs the callable entry point (execute) with type metadata to guarantee type safety and auto-coerce arguments, plus locale-specific copy for UI display and validation.

    Formula authors encounter IFunction when calling another function by name at evaluation time via FormulaContext.getFunction, or when tooling introspects the function registry.

    UDF authoring guide for how to create and register functions.

    interface IFunction {
        get isIFunction(): true;
        execute<R = any>(...args: any[]): R;
        getContext(): string | null;
        getDeclaration(): IDeclaration;
        getDescriptor(locale?: string): Promise<IDescriptor>;
        getName(): string;
        isBuiltIn(): boolean;
        isLambda(): boolean;
    }
    Index
    • get isIFunction(): true

      Type guard property. Always true on any IFunction instance.

      Returns true

      Use this to distinguish an IFunction from other objects at runtime without relying on instanceof, which does not work across module boundaries.

    • Execute the function

      Type Parameters

      • R = any

      Parameters

      • ...args: any[]

      Returns R

    • Returns the execution environment this function belongs to.

      Returns string | null

      SheetXL exposes functions from multiple environments — the formula calculation engine and the macro/scripting runtime — through the same IFunction interface. The context identifier distinguishes them and determines which argument types and calling conventions apply. Returns null for standard formula functions.

    • Returns user-facing information about the function.

      Parameters

      • Optionallocale: string

      Returns Promise<IDescriptor>

    • The name of the function.

      Returns string

    • Indicates whether the function is a built-in function.

      Returns boolean

    • Indicates whether the function is a defined name whose body is LAMBDA(…).

      Returns boolean

      A named lambda is reachable by name like any other function, so signature help and function lookups can describe it: its parameters are the lambda's, and its summary is the name's comment, or the name's formula when it has no comment. A formula calls it through the NAME, never through execute, which answers #CALC!.