JavaScript / TypeScript API

nerdamer/core

Expressions, equations, numeric values, conversion helpers, errors, and other core building blocks.

Direct npm import. The items on this page are JavaScript / TypeScript exports from nerdamer/core. For functions used inside nerdamer('...'), see Nerdamer Notation.
33 exports

Functions

Classes

AssignmentError: unknownClass

Thrown when code attempts to assign to a reserved or otherwise non-assignable parser name.

CoeffObject: unknownClass

Stores coefficients indexed by the power or multidegree collected from an expression.

Converter: unknownClass

Formats Nerdamer values as TeX or normalized text and imports supported TeX input.

DimensionError: unknownClass

Thrown when vector, matrix, or structured-entity dimensions are incompatible.

DivisionByZeroError: unknownClass

Thrown for exact division by zero. Small nonzero numerical values are not treated as zero.

Equation: unknownClass

Represents a symbolic equality between two expression sides.

Expression: unknownClass

Represents a symbolic expression in Nerdamer's canonical expression tree.

MathError: unknownClass

General mathematical precondition error for cases without a more specific error type.

MissingReferenceError: unknownClass

Thrown when a named converter or pattern reference cannot be resolved.

NaNError: unknownClass

Thrown when a required numeric conversion produces `NaN`.

NotImplementedError: unknownClass

Used for recognized operations that have not been implemented yet.

OperatorError: unknownClass

Used for invalid parser-operator definitions and operator dispatch failures.

ParserError: unknownClass

General parser error for construction, evaluation, and registered-function failures.

ParserSyntaxError: unknownClass

Parser syntax error kept separate from lower-level tokenization failures.

PolynomialError: unknownClass

Thrown when input cannot be represented as a polynomial under the requested contract.

Rational: unknownClass

Represents an exact rational value as a `bigint` numerator and denominator.

UndefinedError: unknownClass

Used when a mathematical operation has no defined value in the handled domain.

UnexpectedDataType: unknownClass

Thrown when an operation receives a Nerdamer entity of the wrong runtime type.

UnexpectedInputError: unknownClass

Used when input parses successfully but does not have the form an operation requires.

UnexpectedTokenError: unknownClass

Thrown when tokenization encounters invalid adjacency, punctuation, or bracket structure.

UnsupportedOperationError: unknownClass

Thrown when an operation is known but unsupported for the supplied form or domain.

ZeroToZeroPowerError: unknownClass

Thrown for the indeterminate symbolic form `0^0`.

Interface

APIs

ExpressionInput: number | string | Rational | Expression | bigint | DecimalAPI

Values accepted by Nerdamer's expression-oriented parsing APIs.

JsFunction(...args: number[]): number | booleanAPI

Native JavaScript function produced or consumed by numerical compilation APIs. Arguments and numeric results use JavaScript `number` arithmetic rather than Nerdamer's exact rational or arbitrary-precision symbolic representation. Boolean results support compiled comparison expressions.

NerdamerInput: ExpressionInput | Vector | ValuesSet | Collection | Matrix | Dictionary | EquationAPI

Values accepted across Nerdamer's root API and direct object model. This extends ExpressionInput with the structured parser entities and equations that can be passed back into supported operations. Individual functions may accept a narrower subset and should document that restriction locally.

OptionValue: string | boolean | number | string[] | OptionsObjectAPI

Values currently accepted by Nerdamer's broad settings objects.

ParserConstants: Record<string, (): string | string>API

Constant definitions accepted by the parser's constant registry. String definitions are parsed when the constant is encountered. Function definitions are deferred factories that return parser text, allowing constants such as `pi` and `e` to reflect the active numerical precision. The registry itself is process-wide; this type does not imply isolated parser state.

ParserEntity: Expression | Vector | ValuesSet | Collection | Matrix | Equation | DictionaryAPI

Values that can be produced by Nerdamer's parser.

ParserValuesObject: Record<string, NerdamerInput>API

Named values substituted while parsing or evaluating an input expression. Keys are parser variable names. This compatibility type accepts the same broad value union as the root API, but not every substitution path can consume every structured entity. The receiving operation's documentation defines the narrower contract when one applies.

StructuredEntityType: Matrix | Vector | Collection | DictionaryAPI

Structured parser entities that participate in aggregate operations. The union describes Nerdamer's supported matrix, vector, ordered collection, and keyed dictionary containers. It deliberately excludes value sets and equations, whose semantics are not ordinary elementwise structured operations.