SheetXL - v0.3.20
    Preparing search index...

    Interface DeclarationJSON

    Contains metadata about a function declaration, including its name, return type, parameters, and additional documentation.

    interface DeclarationJSON {
        behavior?: IFunction.BehaviorJSON;
        context?: string;
        name: string;
        parameters?: IFunction.ParameterTypeJSON[];
        returnType?: IFunction.ReturnTypeJSON;
    }
    Index

    Properties

    Additional metadata about the function's behavior or requirements.

    context?: string

    Describes the execution context required by the function.

    Contexts fall into two categories:

    • Macro contexts: Used by macro-style functions to access parts of the document or selection:

      • 'Workbook': The entire workbook
      • 'Sheet': A single sheet
      • 'Range': A selected sheet range
      • 'Ranges': Multiple selected ranges
    • Calculation context: Used by formula functions like OFFSET or INDIRECT that need access to evaluation position or sheet metadata during calculation. This context is available in headless or worker environments.

    • If omitted, the function is consider a FormulaFunction.
    • If a function has a context it will be passed as the first argument to execute.
    • If the context is IFunction.Calculation then the function must return a value.
    • If the context is not IFunction.Calculation then the function must return void or a cleanup function.
    name: string

    Named of the actual function in code.

    The unique identifier for the function. It has a number of rules:

    • The only characters allowed are: (A-Z, 0-9, _m .)
    • Character casing is ignored and will be converted to upper.
    • At least 2 characters.
    • Must start with a letter (A-Z).
    • Must be globally unique.
    • Must not be a reserved word.
    • Must not be a built-in function.

    An array of Parameter objects describing the function's parameters.

    If not specified, the function is assumed to be volatile (its output might change even if its inputs haven't).

    Metadata describing the type and dimensionality of the return value.