@tai-kun/surrealdb
Version:
The SurrealDB SDK for JavaScript
45 lines • 1.75 kB
TypeScript
import { RangeBase as Base } from "@tai-kun/surrealdb/decodeonly-datatypes";
import BoundExcluded from "./bound-excluded";
import BoundIncluded from "./bound-included";
import { CBOR_TAG_RANGE, type Encodable } from "./spec";
type BoundIncludedBase = new (source: any) => BoundIncluded;
type BoundExcludedBase = new (source: any) => BoundExcluded;
type Bound<TTypes extends RangeTypes> = InstanceType<TTypes["BoundIncluded"]> | InstanceType<TTypes["BoundExcluded"]>;
export type RangeTypes<TBoundIncluded extends BoundIncludedBase = BoundIncludedBase, TBoundExcluded extends BoundExcludedBase = BoundExcludedBase> = {
readonly BoundIncluded: TBoundIncluded;
readonly BoundExcluded: TBoundExcluded;
};
export type RangeSource<TTypes extends RangeTypes = RangeTypes> = readonly [
begin: Bound<TTypes> | null,
end: Bound<TTypes> | null
];
/**
* @experimental
*/
export declare class RangeBase<TTypes extends RangeTypes = RangeTypes> extends Base<TTypes> implements Encodable {
toString(): string;
toCBOR(): [
tag: typeof CBOR_TAG_RANGE,
value: [
begin: Bound<TTypes> | null,
end: Bound<TTypes> | null
]
];
toJSON(): string;
toSurql(): string;
toPlainObject(): {
begin: Bound<TTypes> | null;
end: Bound<TTypes> | null;
};
}
/**
* [API Reference](https://tai-kun.github.io/surrealdb.js/v2/api/data/range)
* @experimental
*/
export declare class Range extends RangeBase<RangeTypes<typeof BoundIncluded, typeof BoundExcluded>> {
static readonly BoundIncluded: typeof BoundIncluded;
static readonly BoundExcluded: typeof BoundExcluded;
constructor(source: RangeSource<typeof Range>);
}
export {};
//# sourceMappingURL=range.d.ts.map