/** * @license * Copyright (c) 2025 Handsoncode. All rights reserved. */ import { ArraySize } from '../../ArraySize'; import { ProcedureAst } from '../../parser'; import { InterpreterState } from '../InterpreterState'; import { InterpreterValue } from '../InterpreterValue'; import { FunctionPlugin, FunctionPluginTypecheck, ImplementedFunctions } from './FunctionPlugin'; export declare class ArrayPlugin extends FunctionPlugin implements FunctionPluginTypecheck { static implementedFunctions: ImplementedFunctions; arrayformula(ast: ProcedureAst, state: InterpreterState): InterpreterValue; arrayformulaArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; arrayconstrain(ast: ProcedureAst, state: InterpreterState): InterpreterValue; arrayconstrainArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; filter(ast: ProcedureAst, state: InterpreterState): InterpreterValue; filterArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; /** * Corresponds to VSTACK(array1, [array2], ...) * * Stacks the input arrays vertically, one on top of another, into a single array. * The result has as many rows as the inputs combined and as many columns as the * widest input. Cells of narrower inputs are padded on the right with the #N/A * error, matching the behaviour of Excel and Google Sheets. * * @param ast * @param state */ vstack(ast: ProcedureAst, state: InterpreterState): InterpreterValue; /** * Calculates the spilled array size of VSTACK: the width is the widest input * and the height is the sum of all input heights. * * @param ast * @param state */ vstackArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; /** * Corresponds to HSTACK(array1, [array2], ...) * * Stacks the input arrays horizontally, side by side, into a single array. * The result has as many columns as the inputs combined and as many rows as the * tallest input. Cells of shorter inputs are padded at the bottom with the #N/A * error, matching the behaviour of Excel and Google Sheets. * * @param ast * @param state */ hstack(ast: ProcedureAst, state: InterpreterState): InterpreterValue; /** * Calculates the spilled array size of HSTACK: the width is the sum of all * input widths and the height is the tallest input. * * @param ast * @param state */ hstackArraySize(ast: ProcedureAst, state: InterpreterState): ArraySize; /** * Resolves the array size of every argument of a stacking function, enabling * array arithmetic for the arguments when the function's metadata requests it. * * @param ast * @param state * @param functionName - the stacking function whose metadata drives the array-arithmetic flag */ private stackSubChecks; /** * Returns a copy of the given row resized to exactly `width` cells: longer * rows are truncated and shorter rows are padded on the right with #N/A. Used * by VSTACK to align every stacked row to the widest input. * * @param row - the source row to resize * @param width - the target number of cells */ private padRowToWidth; }