ngxsmk-datatable
Version:
A powerful, feature-rich Angular datatable component with virtual scrolling, built for Angular 17+
73 lines (72 loc) • 1.9 kB
TypeScript
import { FormulaConfig, FormulaExpression, FormulaContext, FormulaResult, FormulaValidation, ComputedColumn, FormulaFunction } from '../interfaces/formula.interface';
import * as i0 from "@angular/core";
/**
* Formula Service
* Excel-like formula calculations and computed columns
*/
export declare class FormulaService {
private config;
private builtInFunctions;
private customFunctions;
private formulaCache;
private computedColumns;
constructor();
/**
* Configure formula service
*/
configure(config: Partial<FormulaConfig>): void;
/**
* Register custom function
*/
registerFunction(name: string, fn: FormulaFunction): void;
/**
* Parse formula expression
*/
parseFormula(formula: string): FormulaExpression;
/**
* Calculate formula
*/
calculate(formula: string, context: FormulaContext): FormulaResult;
/**
* Validate formula
*/
validate(formula: string): FormulaValidation;
/**
* Register computed column
*/
registerComputedColumn(column: ComputedColumn): void;
/**
* Calculate computed column value
*/
calculateComputedColumn(field: string, row: any, allRows?: any[]): any;
/**
* Clear formula cache
*/
clearCache(): void;
/**
* Tokenize formula
*/
private tokenize;
/**
* Extract field dependencies from tokens
*/
private extractDependencies;
/**
* Compile formula to function
*/
private compileFormula;
/**
* Detect circular references
*/
private detectCircular;
/**
* Get cache key
*/
private getCacheKey;
/**
* Initialize built-in functions
*/
private initializeBuiltInFunctions;
static ɵfac: i0.ɵɵFactoryDeclaration<FormulaService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<FormulaService>;
}