/** Structural type of a BigNumber (`decimal.js`) value, as the type guards test it. */ export interface BigNumber { isBigNumber: boolean; constructor: { prototype: { isBigNumber: boolean; }; isDecimal?: (x: unknown) => boolean; }; } /** Structural type of a complex number with real part `re` and imaginary part `im`. */ export interface Complex { re: number; im: number; } /** Structural type of a fraction with numerator `n` and denominator `d`. */ export interface Fraction { n: number; d: number; } /** Structural type of a Unit value, identified by the `isUnit` prototype flag. */ export interface Unit { constructor: { prototype: { isUnit: boolean; }; }; } /** Structural type of a Matrix value, identified by the `isMatrix` prototype flag. */ export interface Matrix { isMatrix?: boolean; _size?: number[]; constructor: { prototype: { isMatrix: boolean; }; }; } /** Structural type of a DenseMatrix: a Matrix with the `isDenseMatrix` flag. */ export interface DenseMatrix extends Matrix { isDenseMatrix: boolean; } /** Structural type of a SparseMatrix: a Matrix with the `isSparseMatrix` flag. */ export interface SparseMatrix extends Matrix { isSparseMatrix: boolean; } /** Structural type of a Range with `start`, `end` and `step`. */ export interface Range { start: number; end: number; step: number; constructor: { prototype: { isRange: boolean; }; }; } /** Structural type of one dimension of an Index: a Range or a set of values. */ export interface IndexDimension { _data?: unknown[]; _size: number[]; isRange?: boolean; start?: number; end?: number; } /** Structural type of an Index, which holds one entry for each dimension. */ export interface Index { _dimensions: (IndexDimension | string)[]; _sourceSize?: (number | null)[]; constructor: { prototype: { isIndex: boolean; }; }; } /** Structural type of a ResultSet, which holds the results of an evaluation in `entries`. */ export interface ResultSet { entries: T[]; constructor: { prototype: { isResultSet: boolean; }; }; } /** Structural type of a Help object, identified by the `isHelp` prototype flag. */ export interface Help { constructor: { prototype: { isHelp: boolean; }; }; } /** Structural type of a Chain object, identified by the `isChain` prototype flag. */ export interface Chain { constructor: { prototype: { isChain: boolean; }; }; } /** Structural type of an expression-tree node, identified by the `isNode` flag. */ export interface Node { isNode: boolean; constructor: { prototype: { isNode: boolean; }; }; } /** Structural type of an expression-tree node with the `isAccessorNode` flag. */ export interface AccessorNode extends Node { isAccessorNode: boolean; } /** Structural type of an expression-tree node with the `isArrayNode` flag. */ export interface ArrayNode extends Node { isArrayNode: boolean; } /** Structural type of an expression-tree node with the `isAssignmentNode` flag. */ export interface AssignmentNode extends Node { isAssignmentNode: boolean; } /** Structural type of an expression-tree node with the `isBlockNode` flag. */ export interface BlockNode extends Node { isBlockNode: boolean; } /** Structural type of an expression-tree node with the `isConditionalNode` flag. */ export interface ConditionalNode extends Node { isConditionalNode: boolean; } /** Structural type of an expression-tree node with the `isConstantNode` flag. */ export interface ConstantNode extends Node { isConstantNode: boolean; } /** Structural type of an expression-tree node with the `isFunctionAssignmentNode` flag. */ export interface FunctionAssignmentNode extends Node { isFunctionAssignmentNode: boolean; } /** Structural type of an expression-tree node with the `isFunctionNode` flag. */ export interface FunctionNode extends Node { isFunctionNode: boolean; } /** Structural type of an expression-tree node with the `isIndexNode` flag. */ export interface IndexNode extends Node { isIndexNode: boolean; } /** Structural type of an expression-tree node with the `isObjectNode` flag. */ export interface ObjectNode extends Node { isObjectNode: boolean; } /** Structural type of an expression-tree node with the `isOperatorNode` flag. It also has the operator `op` and the arguments `args`. */ export interface OperatorNode extends Node { isOperatorNode: boolean; op: string; args: Node[]; } /** Structural type of an expression-tree node with the `isParenthesisNode` flag. */ export interface ParenthesisNode extends Node { isParenthesisNode: boolean; } /** Structural type of an expression-tree node with the `isRangeNode` flag. */ export interface RangeNode extends Node { isRangeNode: boolean; } /** Structural type of an expression-tree node with the `isRelationalNode` flag. */ export interface RelationalNode extends Node { isRelationalNode: boolean; } /** Structural type of an expression-tree node with the `isSymbolNode` flag. */ export interface SymbolNode extends Node { isSymbolNode: boolean; } /** Structural type of a map that holds its entries in two maps, `a` and `b`. */ export interface PartitionedMap { a: Map; b: Map; } /** Return true if `x` is a primitive number. */ export declare function isNumber(x: unknown): x is number; /** * Return true if `x` is a BigNumber. * * The test is by duck typing: `x` and its constructor prototype both have `isBigNumber` * set to true, or the constructor function `isDecimal` accepts `x`. */ export declare function isBigNumber(x: unknown): x is BigNumber; /** Return true if `x` is a primitive bigint. */ export declare function isBigInt(x: unknown): x is bigint; /** Return true if `x` is an object whose prototype has `isComplex` set to true. */ export declare function isComplex(x: unknown): x is Complex; /** Return true if `x` is an object whose prototype has `isFraction` set to true. */ export declare function isFraction(x: unknown): x is Fraction; /** Return true if `x` is an object whose constructor prototype has `isUnit` set to true. */ export declare function isUnit(x: unknown): x is Unit; /** Return true if `x` is a primitive string. */ export declare function isString(x: unknown): x is string; /** Return true if the value is an Array. This function is `Array.isArray`. */ export declare const isArray: (arg: any) => arg is any[]; /** Return true if `x` is an object whose constructor prototype has `isMatrix` set to true. */ export declare function isMatrix(x: unknown): x is Matrix; /** * Test whether a value is a collection: an Array or Matrix * @param {*} x * @returns {boolean} isCollection */ export declare function isCollection(x: unknown): x is unknown[] | Matrix; /** * Return true if `x` has `isDenseMatrix` set to true and its constructor prototype has * `isMatrix` set to true. */ export declare function isDenseMatrix(x: unknown): x is DenseMatrix; /** * Return true if `x` has `isSparseMatrix` set to true and its constructor prototype has * `isMatrix` set to true. */ export declare function isSparseMatrix(x: unknown): x is SparseMatrix; /** Return true if `x` is an object whose constructor prototype has `isRange` set to true. */ export declare function isRange(x: unknown): x is Range; /** Return true if `x` is an object whose constructor prototype has `isIndex` set to true. */ export declare function isIndex(x: unknown): x is Index; /** Return true if `x` is a primitive boolean. */ export declare function isBoolean(x: unknown): x is boolean; /** Return true if `x` is an object whose constructor prototype has `isResultSet` set to true. */ export declare function isResultSet(x: unknown): x is ResultSet; /** Return true if `x` is an object whose constructor prototype has `isHelp` set to true. */ export declare function isHelp(x: unknown): x is Help; /** Return true if `x` is a function. */ export declare function isFunction(x: unknown): x is (...args: unknown[]) => unknown; /** Return true if `x` is a `Date` instance (`instanceof` test). */ export declare function isDate(x: unknown): x is Date; /** Return true if `x` is a `RegExp` instance (`instanceof` test). */ export declare function isRegExp(x: unknown): x is RegExp; /** * Return true if `x` is a plain object. * * The constructor of `x` must be `Object`, and `x` must not be a Complex or a Fraction. */ export declare function isObject(x: unknown): x is Record; /** * Returns `true` if the passed object appears to be a Map (i.e. duck typing). * * Methods looked for are `get`, `set`, `keys` and `has`. * * @param {Map | object} object * @returns */ export declare function isMap(object: unknown): object is Map; /** * Return true if `object` is a map-like object whose `a` and `b` properties are also * map-like objects (see `isMap`). */ export declare function isPartitionedMap(object: unknown): object is PartitionedMap; /** Return true if `x` is `null`. */ export declare function isNull(x: unknown): x is null; /** Return true if `x` is `undefined`. */ export declare function isUndefined(x: unknown): x is undefined; /** * Return true if `x` has `isAccessorNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isAccessorNode(x: unknown): x is AccessorNode; /** * Return true if `x` has `isArrayNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isArrayNode(x: unknown): x is ArrayNode; /** * Return true if `x` has `isAssignmentNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isAssignmentNode(x: unknown): x is AssignmentNode; /** * Return true if `x` has `isBlockNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isBlockNode(x: unknown): x is BlockNode; /** * Return true if `x` has `isConditionalNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isConditionalNode(x: unknown): x is ConditionalNode; /** * Return true if `x` has `isConstantNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isConstantNode(x: unknown): x is ConstantNode; /** * Return true if `x` has `isFunctionAssignmentNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isFunctionAssignmentNode(x: unknown): x is FunctionAssignmentNode; /** * Return true if `x` has `isFunctionNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isFunctionNode(x: unknown): x is FunctionNode; /** * Return true if `x` has `isIndexNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isIndexNode(x: unknown): x is IndexNode; /** Return true if `x` and its constructor prototype both have `isNode` set to true. */ export declare function isNode(x: unknown): x is Node; /** * Return true if `x` has `isObjectNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isObjectNode(x: unknown): x is ObjectNode; /** * Return true if `x` has `isOperatorNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isOperatorNode(x: unknown): x is OperatorNode; /** * Return true if `x` has `isParenthesisNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isParenthesisNode(x: unknown): x is ParenthesisNode; /** * Return true if `x` has `isRangeNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isRangeNode(x: unknown): x is RangeNode; /** * Return true if `x` has `isRelationalNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isRelationalNode(x: unknown): x is RelationalNode; /** * Return true if `x` has `isSymbolNode` set to true and its constructor prototype has * `isNode` set to true. */ export declare function isSymbolNode(x: unknown): x is SymbolNode; /** Return true if `x` is an object whose constructor prototype has `isChain` set to true. */ export declare function isChain(x: unknown): x is Chain; /** * Return the type name of `x`. * * For `null` the name is `'null'`, and for a BigNumber it is `'BigNumber'`. For another * object it is the constructor name, or `'Object'` if the constructor has no name. For a * primitive it is the `typeof` result, for example `'number'`. */ export declare function typeOf(x: unknown): string; //# sourceMappingURL=is.d.ts.map