///
import * as grpc from 'grpc';
import { Rangable, Range } from './range';
import * as RPC from './rpc';
import { NSApplicator, PromiseWrap } from './util';
/**
* Comparators can be passed to various operations in the ComparatorBuilder.
*/
export declare const comparator: {
'==': RPC.CompareResult;
'===': RPC.CompareResult;
'>': RPC.CompareResult;
'<': RPC.CompareResult;
'!=': RPC.CompareResult;
'!==': RPC.CompareResult;
};
export interface ICompareTarget {
value: RPC.CompareTarget;
key: keyof RPC.ICompare;
}
export interface IOperation {
op(): Promise;
}
/**
* compareTarget are the types of things that can be compared against.
*/
export declare const compareTarget: {
[key in keyof typeof RPC.CompareTarget]: keyof RPC.ICompare;
};
/**
* RangeBuilder is a primitive builder for range queries on the kv store.
* It's extended by the Single and MultiRangeBuilders, which contain
* the concrete methods to execute the built query.
*/
export declare abstract class RangeBuilder extends PromiseWrap implements IOperation {
protected readonly namespace: NSApplicator;
protected request: RPC.IRangeRequest;
protected callOptions: grpc.CallOptions | undefined;
constructor(namespace: NSApplicator);
/**
* revision is the point-in-time of the key-value store to use for the range.
*/
revision(rev: number | string): this;
/**
* serializable sets the range request to use serializable member-local reads.
*/
serializable(serializable: boolean): this;
/**
* minModRevision sets the minimum modified revision of keys to return.
*/
minModRevision(minModRevision: number | string): this;
/**
* maxModRevision sets the maximum modified revision of keys to return.
*/
maxModRevision(maxModRevision: number | string): this;
/**
* minCreateRevision sets the minimum create revision of keys to return.
*/
minCreateRevision(minCreateRevision: number | string): this;
/**
* maxCreateRevision sets the maximum create revision of keys to return.
*/
maxCreateRevision(maxCreateRevision: number | string): this;
/**
* Sets the GRPC call options for this request.
*/
options(options: grpc.CallOptions | undefined): this;
/**
* Returns the request op for this builder, used in transactions.
*/
op(): Promise;
}
/**
* SingleRangeBuilder is a query builder that looks up a single key.
*/
export declare class SingleRangeBuilder extends RangeBuilder {
private readonly kv;
constructor(kv: RPC.KVClient, namespace: NSApplicator, key: string | Buffer);
/**
* Runs the built request and parses the returned key as JSON,
* or returns `null` if it isn't found.
*/
json(): Promise