import typedFunction from 'typed-function'; import { ArgumentsError } from '../error/ArgumentsError.js'; import { DimensionError } from '../error/DimensionError.js'; import { IndexError } from '../error/IndexError.js'; import { factory } from '../utils/factory.js'; import type { FactoryFunction, LegacyFactory } from '../utils/factory.js'; import { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isPartitionedMap, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../utils/is.js'; import { isObjectWrappingMap } from '../utils/map.js'; import type { ConfigOptions, MathJsConfig } from './config.js'; export type { MathJsConfig }; import type { ImportOptions } from './function/import.js'; /** * Type for the mathjs instance */ export interface MathJsInstance { isNumber: typeof isNumber; isComplex: typeof isComplex; isBigNumber: typeof isBigNumber; isBigInt: typeof isBigInt; isFraction: typeof isFraction; isUnit: typeof isUnit; isString: typeof isString; isArray: typeof isArray; isMatrix: typeof isMatrix; isCollection: typeof isCollection; isDenseMatrix: typeof isDenseMatrix; isSparseMatrix: typeof isSparseMatrix; isRange: typeof isRange; isIndex: typeof isIndex; isBoolean: typeof isBoolean; isResultSet: typeof isResultSet; isHelp: typeof isHelp; isFunction: typeof isFunction; isDate: typeof isDate; isRegExp: typeof isRegExp; isObject: typeof isObject; isMap: typeof isMap; isPartitionedMap: typeof isPartitionedMap; isObjectWrappingMap: typeof isObjectWrappingMap; isNull: typeof isNull; isUndefined: typeof isUndefined; isAccessorNode: typeof isAccessorNode; isArrayNode: typeof isArrayNode; isAssignmentNode: typeof isAssignmentNode; isBlockNode: typeof isBlockNode; isConditionalNode: typeof isConditionalNode; isConstantNode: typeof isConstantNode; isFunctionAssignmentNode: typeof isFunctionAssignmentNode; isFunctionNode: typeof isFunctionNode; isIndexNode: typeof isIndexNode; isNode: typeof isNode; isObjectNode: typeof isObjectNode; isOperatorNode: typeof isOperatorNode; isParenthesisNode: typeof isParenthesisNode; isRangeNode: typeof isRangeNode; isRelationalNode: typeof isRelationalNode; isSymbolNode: typeof isSymbolNode; isChain: typeof isChain; config: (config?: Partial) => ConfigOptions; import: (factories: FactoriesInput, options?: ImportOptions) => void; create: (factories?: FactoriesInput, config?: Partial) => MathJsInstance; factory: typeof factory; typed: typeof typedFunction & { isTypedFunction?: (value: unknown) => boolean; }; ArgumentsError: typeof ArgumentsError; DimensionError: typeof DimensionError; IndexError: typeof IndexError; expression: { transform: Record; mathWithTransform: { config: (config?: Partial) => ConfigOptions; [key: string]: unknown; }; }; type?: Record; on: (event: string, callback: (...args: unknown[]) => void) => MathJsInstance; off: (event: string, callback: (...args: unknown[]) => void) => MathJsInstance; once: (event: string, callback: (...args: unknown[]) => void) => MathJsInstance; emit: (event: string, ...args: unknown[]) => MathJsInstance; [key: string]: unknown; } /** * Input type for factories */ export type FactoriesInput = Record | Array | FactoryFunction | LegacyFactory; export type { ImportOptions }; /** * Create a mathjs instance from given factory functions and optionally config * * Usage: * * const mathjs1 = create({ createAdd, createMultiply, ...}) * const config = { number: 'BigNumber' } * const mathjs2 = create(all, config) * * @param factories An object with factory functions. * The object can contain nested objects, * all nested objects will be flattened. * @param config Available options: * {number} relTol * Minimum relative difference between two * compared values, used by all comparison functions. * {number} absTol * Minimum absolute difference between two * compared values, used by all comparison functions. * {string} matrix * A string 'Matrix' (default) or 'Array'. * {string} number * A string 'number' (default), 'BigNumber', or 'Fraction' * {number} precision * The number of significant digits for BigNumbers. * Not applicable for Numbers. * {boolean} predictable * Predictable output type of functions. When true, * output type depends only on the input types. When * false (default), output type can vary depending * on input values. For example `math.sqrt(-4)` * returns `complex('2i')` when predictable is false, and * returns `NaN` when true. * {string} randomSeed * Random seed for seeded pseudo random number generator. * Set to null to randomly seed. * @returns Returns a bare-bone math.js instance containing * functions: * - `import` to add new functions * - `config` to change configuration * - `on`, `off`, `once`, `emit` for events */ export declare function create(factories?: FactoriesInput, config?: Partial): MathJsInstance; //# sourceMappingURL=create.d.ts.map