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

    Interface DeclarationJSON

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

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

    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.
    maxArguments?: number

    The largest number of arguments a call may carry, from Repeating<T, Max> on the variadic parameter. Omitted at the default of 255.

    Excel keeps one such number per NAME and compares it against the whole call's argument count in its front end, so a call past it is refused AT ENTRY rather than answered — which is why the cap lives on the declaration and not in a body. It is not derivable from the shape: STDEV takes 255 arguments and STDEV.S, the same function under its dotted name, takes 254.

    255
    
    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.
    parameters?: ParameterTypeJSON[]

    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).

    returnType?: ReturnTypeJSON

    Metadata describing the type and dimensionality of the return value.