import { type Rangable, Range } from './range'; import * as RPC from './rpc'; import type { CallOptions } from '../base/options'; import { type NSApplicator, PromiseWrap } from '../base/util'; 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; } export declare const compareTarget: { [key in keyof typeof RPC.CompareTarget]: keyof RPC.ICompare; }; export declare abstract class RangeBuilder extends PromiseWrap implements IOperation { protected readonly namespace: NSApplicator; protected request: RPC.IRangeRequest; protected callOptions: CallOptions | undefined; constructor(namespace: NSApplicator); revision(rev: number | string): this; serializable(serializable: boolean): this; minModRevision(minModRevision: number | string): this; maxModRevision(maxModRevision: number | string): this; minCreateRevision(minCreateRevision: number | string): this; maxCreateRevision(maxCreateRevision: number | string): this; options(options: CallOptions | undefined): this; op(): Promise; } export declare class SingleRangeBuilder extends RangeBuilder { private readonly kv; constructor(kv: RPC.KVClient, namespace: NSApplicator, key: string | Buffer); json(): Promise; string(encoding?: BufferEncoding): Promise; number(): Promise; buffer(): Promise; exists(): Promise; exec(): Promise; protected createPromise(): Promise; } export declare class MultiRangeBuilder extends RangeBuilder> { private readonly kv; constructor(kv: RPC.KVClient, namespace: NSApplicator); prefix(value: string | Buffer): this; inRange(r: Rangable): this; all(): this; limit(count: number): this; sort(target: keyof typeof RPC.SortTarget, order: keyof typeof RPC.SortOrder): this; count(): Promise; keys(encoding?: BufferEncoding): Promise; keyBuffers(): Promise; json(): Promise>; strings(encoding?: BufferEncoding): Promise>; numbers(): Promise>; buffers(): Promise>; exec(): Promise; protected createPromise(): Promise>; private mapValues; } export declare class DeleteBuilder extends PromiseWrap { private readonly kv; private readonly namespace; private readonly request; private callOptions; constructor(kv: RPC.KVClient, namespace: NSApplicator); key(value: string | Buffer): this; prefix(value: string | Buffer): this; range(range: Range): this; all(): this; inRange(r: Rangable): this; getPrevious(): Promise; options(options: CallOptions | undefined): this; exec(): Promise; op(): Promise; protected createPromise(): Promise; } export declare class PutBuilder extends PromiseWrap { private readonly kv; private readonly namespace; private readonly request; private leaseFilter?; private callOptions; constructor(kv: RPC.KVClient, namespace: NSApplicator, key: string | Buffer); value(value: string | Buffer | number): this; lease(lease: number | string | Promise): this; ignoreLease(): this; options(options: CallOptions | undefined): this; getPrevious(): Promise; touch(): Promise; exec(): Promise; op(): Promise; protected createPromise(): Promise; private applyLease; } export declare class ComparatorBuilder { private readonly kv; private readonly namespace; private readonly request; private callOptions; constructor(kv: RPC.KVClient, namespace: NSApplicator); options(options: CallOptions | undefined): this; and(key: string | Buffer, column: keyof typeof RPC.CompareTarget, cmp: keyof typeof comparator, value: string | Buffer | number): this; then(...clauses: Array): this; else(...clauses: Array): this; commit(): Promise; mapOperations(ops: Array): Array>; }