import Decimal from "decimal.js"; import { TASONTypeInfo } from "../TASONTypeInfo"; export interface INumber { readonly value: T; toString(): string; } export interface INumberConstructor, N> { readonly MIN_VALUE: N; readonly MAX_VALUE: N; readonly BYTE_SIZE: number; readonly UNSIGNED: boolean; new (value: string): T; } type AllowRadix = 2 | 8 | 16 | 10; declare abstract class NumberBase implements INumber { readonly value: T; abstract parseValue(value: string, radix: AllowRadix): T; /** 检查数值是否溢出并截断。不同于CPU运算时整数类型的溢出,此处截断不根据二进制表示处理。 * 例如 `Int16.MAX_VALUE` = 32767,那么32768会溢出,截断为32767而不是-32767。 */ abstract clampValue(value: T): [boolean, T]; constructor(value: string, clamp?: boolean); toString(): string; valueOf(): T; private get _SubClass(); sizeOf(): number; equals(other: INumber): boolean; } export declare class UInt8 extends NumberBase { clampValue(value: number): [boolean, number]; parseValue(value: string, radix: AllowRadix): number; static readonly MIN_VALUE: number; static readonly MAX_VALUE: number; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Int16 extends NumberBase { clampValue(value: number): [boolean, number]; parseValue(value: string, radix: AllowRadix): number; static readonly MIN_VALUE: number; static readonly MAX_VALUE: number; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Int32 extends NumberBase { clampValue(value: number): [boolean, number]; parseValue(value: string, radix: AllowRadix): number; static readonly MIN_VALUE: number; static readonly MAX_VALUE: number; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Int64 extends NumberBase { clampValue(value: bigint): [boolean, bigint]; parseValue(value: string, radix: AllowRadix): bigint; static readonly MIN_VALUE: bigint; static readonly MAX_VALUE: bigint; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Float32 extends NumberBase { clampValue(value: number): [boolean, number]; parseValue(value: string, radix: AllowRadix): number; static readonly MIN_VALUE: number; static readonly MAX_VALUE: number; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Float64 extends NumberBase { clampValue(value: number): [boolean, number]; parseValue(value: string, radix: AllowRadix): number; static readonly MIN_VALUE: number; static readonly MAX_VALUE: number; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare class Decimal128 extends NumberBase { clampValue(value: Decimal): [boolean, Decimal]; parseValue(value: string): Decimal; equals(other: INumber): boolean; static readonly MIN_VALUE: Decimal; static readonly MAX_VALUE: Decimal; static readonly BYTE_SIZE: number; static readonly UNSIGNED: boolean; } export declare const Numbers: { UInt8: INumberConstructor; Int16: INumberConstructor; Int32: INumberConstructor; Int64: INumberConstructor; Float32: INumberConstructor; Float64: INumberConstructor; Decimal128: INumberConstructor; }; declare const _default: { UInt8: TASONTypeInfo>; Int16: TASONTypeInfo>; Int32: TASONTypeInfo>; Int64: TASONTypeInfo>; Float32: TASONTypeInfo>; Float64: TASONTypeInfo>; Decimal128: TASONTypeInfo>; } & { BigInt: TASONTypeInfo; }; export default _default;