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

    Interface ParameterTypeJSON

    Describes the parameter to a function, including its name, type, whether it's required, and if it's a rest parameter.

    interface ParameterTypeJSON {
        acceptError?: boolean;
        arrayDepth?: number;
        defaultValue?: Scalar;
        description?: string;
        enum?: EnumJSON;
        lambda?: ScalarType | "*" | "raw";
        lambdaArity?: number;
        lazy?: boolean;
        name: string;
        noFilter?: boolean;
        noLift?: boolean;
        omittable?: boolean;
        omittedValue?: Scalar;
        optional?: boolean;
        range?: "*" | "p" | "r" | "m";
        repeating?: ParameterTypeJSON[];
        reportType?: boolean;
        rest?: boolean;
        scalar?: string;
        valueOrRange?: boolean;
    }

    Hierarchy (View Summary)

    Index
    acceptError?: boolean

    A BARE error at this parameter — an error instead of a value or a range — is delivered to the body RAW rather than propagated: the engine's auto-reject is off at this slot, and the body narrows if it cares. Generated from the AcceptError<T> marker. A failed COERCION to the declared type is delivered the same way, as the #VALUE! it would have raised, so a body that rethrows what it receives answers exactly as the engine would have — and one that reads its arguments in its own order can (IFS(TRUE,1,"x",2) is 1: the pair is never reached).

    OMITTED is the default (ErrorPolicy.ts): the error propagates with its identity (a scalar argument), becomes an error member of the output (a lifted member), or short-circuits on the first error in argument order (a flattened list) — the body never runs. A FormulaError.Known-typed parameter receives without the marker, because the type declares it. On a TYPED range (IRange<number>) the marker also lets error members ride through the typed read raw — COUNT's profile. Errors INSIDE a range are otherwise never the marker's business: a valid range is handed over whole.

    arrayDepth?: number

    Defines the number of array signatures after a parameter.

    • 0: No array signature. The value is scalar or a single cell.
    • 1: Will flatten.
    • 2: Nest.
    • 3: Array of arrays of arrays (e.g. for 3D ranges or arrays of tables)

    0 if no range is defined, otherwise 1.

    defaultValue?: Scalar

    The value the parameter's own initializer supplies when the argument is ABSENT.

    Descriptive rather than applied: an absent argument is never pushed, so the initializer supplies the value itself. It is recorded so help text, tooltips and completions can say "defaults to 3" without reading the source. The exception is a lazy slot, which has no initializer to run — Lazy<T, V> declares the default here and the engine applies it.

    Present for a literal initializer only. One computed from another argument (numberS2: number = numberS) has no value to record and leaves this undefined.

    Concerns the ABSENT position specifically; omittedValue covers what an argument supplied EMPTY means, which is frequently a different value.

    description?: string

    A short description of the value's purpose or expected usage.

    enum?: EnumJSON

    The closed set of values the parameter accepts. Generated from a parameter typed as a TypeScript enum, as an alias paired with a same-name as const object, or as a union of number or string literals. scalar carries the members' type.

    Parameters that share a declared enum share one EnumJSON, by EnumJSON.id.

    lambda?: ScalarType | "*" | "raw"

    Indicates that the value is a lambda function, and what the lambda RETURNS — which is also what the marshalled callable coerces each result to:

    • a ScalarType: that scalar.
    • *: any SCALAR — each result still coerces to ONE scalar (a 1×1 range/reference unwraps, an error embeds as a value, a larger shape is #CALC! for the whole call).
    • raw: a declared any return (Lambda<Args, any>) — results pass to the body uncoerced. REDUCE is the case: its accumulator threads raw, which is what makes an array/reference accumulator legal.

    If specified, the function supports lambda inputs.

    lambdaArity?: number

    The lambda's declared parameter count, from the Lambda<Args, R> tuple.

    Enforced by the marshaller at the call — a callable that cannot take exactly this many arguments is #VALUE! for the whole call, before any element runs (an eta-reduced function name defers to its own dispatch). Absent when the declaration leaves arity open (Lambda<any[], R>): a lambda slot in a repeating group then requires one parameter per OTHER argument of the call; anywhere else the arity is unchecked.

    lazy?: boolean

    The argument's subtree may be handed over UNEVALUATED, as an ILazy handle the body either returns unread or forces with getValue(). Generated from the Lazy<T> marker.

    A declaration, not a request: the engine defers where it can and DECLINES where it cannot (an absent argument, an async subtree, a lift that needs every arm), handing over a handle that is already full. Either way the body sees a handle and nothing else, which is why the marker is a contract rather than something inferred from what the body happens to read.

    Only a RESULT position carries it — IF's branches, CHOOSE's arms, IFERROR's fallback. A condition, an index or a case value is eager, so AND(FALSE,A1) still reads A1 and is still a circular reference.

    defaultValue is APPLIED at a lazy slot rather than merely recorded: the parameter cannot carry an initializer of its own (= false does not typecheck against a handle), so Lazy<T, V> declares it and the engine supplies it for an absent argument.

    Lazy

    name: string

    The name of the parameter.

    noFilter?: boolean

    The members reaching this repeating scalar parameter are COERCED rather than filtered, and one that cannot be coerced is #VALUE! for the whole call. Generated from the NoFilter<T> marker.

    Numeric text parses, a blank inside a multi-cell range reads 0, and a boolean or non-numeric text member refuses — Excel's Analysis-ToolPak reading of a repeating slot, where the native family skips all three (GCD({6,"8",12}) is 2 where SUM would answer over 6 and 12 alone). Only a repeating slot has members, so the marker applies nowhere else; a non-repeating scalar's counterpart is noLift.

    noLift?: boolean

    A multi-cell REFERENCE at this scalar parameter is #VALUE! rather than a broadcast. Generated from the NoLift<T> marker.

    Per parameter, because Excel is: NETWORKDAYS.INTL refuses a reference at its date slots and lifts one at weekend. An ARRAY at the slot still lifts, a one-cell reference is an ordinary argument, and a repeating slot absorbs a container as members, so the marker only ever applies to a non-repeating scalar parameter.

    omittable?: boolean

    An argument supplied EMPTY (FIXED(1.5,)) does not coerce to the parameter's type. Generated from the Omittable<T> marker.

    Undeclared, an omitted argument reaches the body as 0 / false / "" — the right default for most functions, and what VLOOKUP(x,r,2,) means by an exact match. Declared, the argument arrives as omittedValue where one is given, and otherwise as undefined, letting the parameter's own initializer supply it so that an omitted argument means what an absent one means.

    A blank CELL in the same position is unaffected and continues to coerce: it is a value the caller supplied, where an omitted argument is the caller supplying none.

    omittedValue?: Scalar

    What an argument supplied EMPTY means, where that differs from the absent default. Generated from the second type argument of Omittable<T, V>.

    Left undeclared where the two coincide, which is the common case — the parameter's own initializer then serves both positions. It is declared where a function distinguishes them: MATCH(3,{2}) is 1 while MATCH(3,{2},) is #N/A, giving matchType the declaration Omittable<number, 0> = 1.

    Implies omittable. Unlike defaultValue, which only records what the initializer would supply, this value is applied by the engine.

    optional?: boolean

    Indicates whether the parameter is required.

    true
    
    range?: "*" | "p" | "r" | "m"

    Indicates that the value is a range (multi-cell) structure.

    • p: A RangeReference, representing a pointer to sheet coordinates.
    • r: A Range, representing the actual values in the range.
    • m: A materialized array (Scalar[] or Scalar[][]) that has been extracted from the range.
    • *: Any value — a scalar or a range. Declared any, and the same *-means-any spelling as scalar and lambda.

    If specified, the function supports multi-cell or structured range inputs.

    A * parameter is handed the whole argument, whatever it is. It is a VALUE position rather than a range one, which matters when another parameter causes the call to broadcast: a * parameter follows that broadcast and receives one element per position, where an r/p parameter would receive the whole range on every call. It never causes a broadcast itself.

    IF(logical, valueIfTrue, valueIfFalse) is the canonical shape — the branches are *, so a single condition returns the chosen branch untouched while an array condition selects element by element.

    repeating?: ParameterTypeJSON[]

    The SLOTS of a repeating parameter group, generated from the Repeating<T> marker.

    Present iff this parameter IS a group; its own scalar/range/arrayDepth are then unset and the slots carry the types. The array length is the group's PERIOD. Cannot be combined with rest.

    reportType?: boolean

    The declared type is ADVISORY: the engine delivers it when it can and hands the body the raw argument when it cannot, instead of answering #VALUE! at the slot. Generated from the ReportType<T> marker.

    The type still reaches the function help, the wizard and the linter — it is what the slot means to a caller. It stops being a gate, so the BODY owns every answer the engine would otherwise have given: a union reaches it as IRange[], a value or an error reaches it as itself. See IFunctionArguments.getKindAt and IFunctionArguments.getAreaCountAt for the discriminators.

    rest?: boolean

    Indicates whether the parameter is a rest parameter (accepts multiple arguments).

    • A rest parameter can only be the last parameter in a function.
    • If rest is true, the parameter is also considered optional.
    scalar?: string

    Indicates that the value is a single, scalar cell-compatible value.

    This corresponds to a ScalarType such as Number, Boolean, or String. ScalarType.Null is permitted only for event handler return types.

    valueOrRange?: boolean

    The parameter takes EITHER a value or a range — declared as a two-member union of a bare range type and a scalar type (IRange | Scalar, IReferenceRange | number) — and the marshaller picks the arm by the ARGUMENT's kind: a value, a bare error or a one-cell reference is the scalar arm (dereferenced, coerced to scalar, its fault raised in argument order like any scalar slot's); a multi-cell reference, an array or a reference union is the range arm, handed over whole. The slot never lifts.

    Excel reads a one-cell argument at some array slots as THE ARGUMENT rather than as a one-cell container: SORT(<#N/A cell>,1,1,<#DIV/0! cell>) is #N/A where TAKE(<#N/A cell>,<#DIV/0! cell>) is #DIV/0!. The engine's default for a range slot is TAKE's; this flag is SORT's. scalar and range each carry their arm, a pair that without this flag reads as a TYPED range (IRange<number>).