import { Evaluator } from '../evaluator'; import { DataType, IValue, nil, Reg, _IType, _RelationBase, _Transaction } from '../interfaces-private'; export declare function regGen(): Reg; export declare abstract class TypeBase implements _IType, _RelationBase { readonly reg: Reg; get type(): 'type'; constructor(); private _asArray?; private _asList?; abstract primary: DataType; get name(): string; /** Compute a custom unicty hash for a non null value */ doGetHash?(value: TRaw): string | number; /** Can be casted to */ doCanCast?(to: _IType): boolean | nil; /** Can be built to from (inverse of doCanCast()) */ doCanBuildFrom?(from: _IType): boolean | nil; /** * @see this.prefer() doc */ doPrefer?(type: _IType): _IType | null; /** * @see this.canConvertImplicit() doc */ doCanConvertImplicit?(to: _IType): boolean; /** Perform conversion from this type to given type */ doCast?(value: Evaluator, to: _IType): Evaluator | nil; /** Perform conversion given type to this type (inverse of doCast()) */ doBuildFrom?(value: Evaluator, from: _IType): Evaluator | nil; doEquals(a: TRaw, b: TRaw): boolean; doGt(a: TRaw, b: TRaw): boolean; doLt(a: TRaw, b: TRaw): boolean; toString(): string; equals(a: TRaw, b: TRaw): boolean | null; gt(a: TRaw, b: TRaw): boolean | null; lt(a: TRaw, b: TRaw): boolean | null; ge(a: TRaw, b: TRaw): boolean | null; le(a: TRaw, b: TRaw): boolean | null; /** * When performing 'a+b', will be given 'b' type, * this returns the prefered resulting type, or null if they are not compatible */ prefer(to: _IType): _IType | nil; /** * Can constant literals be converted implicitely * (without a cast... i.e. you can use both values as different values of a case expression, for instance) **/ canConvertImplicit(to: _IType): boolean | nil; /** Can be explicitely casted to */ canCast(to: _IType): boolean | nil; /** Perform cast */ cast(_a: IValue, _to: _IType): IValue; /** Perform implicit conversion */ convertImplicit(_a: IValue, _to: _IType): IValue; private _convert; asArray(): _IType; asList(): _IType; hash(value: any): string | number | null; drop(t: _Transaction): void; } //# sourceMappingURL=datatype-base.d.ts.map