import { _NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY } from './calc'; declare global { type StrNumberValue = string | typeof StrNumber.NEGATIVE_INFINITY | typeof StrNumber.POSITIVE_INFINITY | typeof StrNumber.NaN; type StrNumberType = number | StrNumberValue | StrNumber; } /** * 私有value属性名 */ declare const privateValueKey: unique symbol; /** * 类名:StrNumber * @description * 这是一个数字计算类,用于解决js浮点数运算精度丢失和大数运算的问题 * 封装了常用的加减乘除计算方法,还包括toFixed方法 * 实例支持链式调用计算方法,计算方法也可以在静态方法中调用 */ declare class StrNumber { static POSITIVE_INFINITY: import("./StrNumberFlag").default; static NEGATIVE_INFINITY: import("./StrNumberFlag").default; static NaN: import("./StrNumberFlag").default; static add: (a: StrNumberType, b: StrNumberType) => StrNumberValue; static minus: (a: StrNumberType, b: StrNumberType) => StrNumberValue; static times: (a: StrNumberType, b: StrNumberType) => StrNumberValue; static into: (a: StrNumberType, b: StrNumberType) => StrNumberValue; static calc: (str: string) => StrNumberValue; static toFixed: (value: StrNumberType, digits: number) => string; static isInfinite: (value: StrNumberType) => value is typeof NEGATIVE_INFINITY | typeof POSITIVE_INFINITY; static isFinite: (value: StrNumberType) => value is string; static isNaN: (value: StrNumberType) => value is typeof _NaN; static aIsEqualToB: (a: StrNumberType, b: StrNumberType) => boolean; static aIsMoreThanB: (a: StrNumberType, b: StrNumberType) => boolean; static aIsLessThanB: (a: StrNumberType, b: StrNumberType) => boolean; /** * 私有value属性 * 给value属性做存值 */ private [privateValueKey]; value: StrNumberValue; constructor(value?: StrNumberType); private calc; /** * 加 */ add(...value: StrNumberType[]): StrNumber; /** * 减 */ minus(...value: StrNumberType[]): StrNumber; /** * 乘 */ times(...value: StrNumberType[]): StrNumber; /** * 除 */ into(...value: StrNumberType[]): StrNumber; /** * 小于 */ isLessThan(value: StrNumberType): boolean; /** * 等于 */ isEqualTo(value: StrNumberType): boolean; /** * 大于 */ isMoreThan(value: StrNumberType): boolean; /** * 保留固定小数位数 * @param digits 小数位数 */ toFixed(digits: number): string; /** * 支持原生String方法转换字符串 */ toString(): string; /** * 原始值转换为数字 */ valueOf(): number; } export default StrNumber;