UNPKG

@holgerengels/compute-engine

Version:

Symbolic computing and numeric evaluations for JavaScript and Node.js

43 lines (42 loc) 1.32 kB
/* 0.26.0-alpha2 */ /** * * The Compute Engine is a symbolic computation engine that can be used to * manipulate and evaluate mathematical expressions. * * Use an instance of {@linkcode ComputeEngine} to create boxed expressions * with {@linkcode ComputeEngine.parse} and {@linkcode ComputeEngine.box}. * * Use a {@linkcode BoxedExpression} object to manipulate and evaluate * mathematical expressions. * * @module "compute-engine" * */ import type { OneOf } from '../common/one-of'; import type { FunctionDefinition, SemiBoxedExpression, SymbolDefinition } from './boxed-expression/public'; export * from './boxed-expression/public'; /** * A table mapping identifiers to their definition. * * Identifiers should be valid MathJSON identifiers. In addition, the * following rules are recommended: * * - Use only latin letters, digits and `-`: `/[a-zA-Z0-9-]+/` * - The first character should be a letter: `/^[a-zA-Z]/` * - Functions and symbols exported from a library should start with an uppercase letter `/^[A-Z]/` * * @category Definitions * */ export type IdentifierDefinition = OneOf<[ SymbolDefinition, FunctionDefinition, SemiBoxedExpression ]>; /** * @category Definitions * */ export type IdentifierDefinitions = Readonly<{ [id: string]: IdentifierDefinition; }>;