import { Decimal } from 'decimal.js'; import { Type } from '../types/datatype'; import { Constant } from './constants'; import { FcalFunction } from './function'; import { SymbolTable } from './symboltable'; declare type ValInputType = string | number | Decimal | Type; declare type EnvInputType = { [index: string]: ValInputType; } | Map; /** * Represents runtime variable environment * It represents state of fcal */ declare class Environment { readonly functions: FcalFunction.List; readonly symbolTable: SymbolTable; readonly constants: Constant; values: Map; /** * Creates new environment * @param {FcalFunction.List}functions list of functions * @param {SymbolTable} symbolTable symbol table * @param {Constant} constants constants */ constructor(functions: FcalFunction.List, symbolTable: SymbolTable, constants: Constant); /** * Get the value of variable * @param {String} key variable name * @throws {FcalError} Error if variable is not available */ get(key: string, start?: number, end?: number): Type; /** * create or assign a variable with value * @param {string} key variable name * @param {ValInputType} value value */ set(key: string, value: ValInputType): void; /** * import values from Object or Map * @param {Object | Map} values */ use(values: EnvInputType): void; } export { Environment, EnvInputType };