UNPKG

hyperformula

Version:

HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas

79 lines (78 loc) 2.61 kB
/** * @license * Copyright (c) 2021 Handsoncode. All rights reserved. */ import { ProcedureAst } from '../../parser'; import { InterpreterState } from '../InterpreterState'; import { InterpreterValue } from '../InterpreterValue'; import { ArgumentTypes, FunctionPlugin, FunctionPluginTypecheck } from './FunctionPlugin'; export declare class SumifPlugin extends FunctionPlugin implements FunctionPluginTypecheck<SumifPlugin> { static implementedFunctions: { SUMIF: { method: string; parameters: ({ argumentType: ArgumentTypes; optionalArg?: undefined; } | { argumentType: ArgumentTypes; optionalArg: boolean; })[]; }; COUNTIF: { method: string; parameters: { argumentType: ArgumentTypes; }[]; }; AVERAGEIF: { method: string; parameters: ({ argumentType: ArgumentTypes; optionalArg?: undefined; } | { argumentType: ArgumentTypes; optionalArg: boolean; })[]; }; SUMIFS: { method: string; parameters: { argumentType: ArgumentTypes; }[]; repeatLastArgs: number; }; COUNTIFS: { method: string; parameters: { argumentType: ArgumentTypes; }[]; repeatLastArgs: number; }; }; /** * Corresponds to SUMIF(Range, Criterion, SumRange) * * Range is the range to which criterion is to be applied. * Criterion is the criteria used to choose which cells will be included in sum. * SumRange is the range on which adding will be performed. * * @param ast * @param state */ sumif(ast: ProcedureAst, state: InterpreterState): InterpreterValue; sumifs(ast: ProcedureAst, state: InterpreterState): InterpreterValue; averageif(ast: ProcedureAst, state: InterpreterState): InterpreterValue; /** * Corresponds to COUNTIF(Range, Criterion) * * Range is the range to which criterion is to be applied. * Criterion is the criteria used to choose which cells will be included in sum. * * Returns number of cells on which criteria evaluates to true. * * @param ast * @param state */ countif(ast: ProcedureAst, state: InterpreterState): InterpreterValue; countifs(ast: ProcedureAst, state: InterpreterState): InterpreterValue; }