/// <reference types="node" />
/**
 * @packageDocumentation
 * @module @textile/threads-client/models
 */
import { grpc } from '@improbable-eng/grpc-web';
import { WriteTransactionRequest, WriteTransactionReply } from '@textile/threads-client-grpc/api_pb';
import { Config } from './config';
import { Instance, InstanceList, QueryJSON } from './query';
import { Transaction } from './Transaction';
/**
 * WriteTransaction performs a mutating bulk transaction on the underlying store.
 */
export declare class WriteTransaction extends Transaction<WriteTransactionRequest, WriteTransactionReply> {
    protected readonly config: Config;
    protected readonly client: grpc.Client<WriteTransactionRequest, WriteTransactionReply>;
    protected readonly dbID: Buffer;
    protected readonly modelName: string;
    constructor(config: Config, client: grpc.Client<WriteTransactionRequest, WriteTransactionReply>, dbID: Buffer, modelName: string);
    /**
     * start begins the transaction. All operations between start and end will be applied as a single transaction upon a call to end.
     */
    start(): Promise<void>;
    /**
     * create creates a new model instance in the given store.
     * @param values An array of model instances as JSON/JS objects.
     */
    create<T = any>(values: any[]): Promise<string[] | undefined>;
    /**
     * save saves changes to an existing model instance in the given store.
     * @param values An array of model instances as JSON/JS objects. Each model instance must have a valid existing `ID` property.
     */
    save(values: any[]): Promise<void>;
    /**
     * delete deletes an existing model instance from the given store.
     * @param IDs An array of instance ids to delete.
     */
    delete(IDs: string[]): Promise<void>;
    /**
     * has checks whether a given instance exists in the given store.
     * @param IDs An array of instance ids to check for.
     */
    has(IDs: string[]): Promise<boolean>;
    /**
     * find queries the store for entities matching the given query parameters. See Query for options.
     * @param query The object that describes the query. See Query for options. Alternatively, see QueryJSON for the basic interface.
     */
    find<T = any>(query: QueryJSON): Promise<InstanceList<T>>;
    /**
     * findByID queries the store for the id of an instance.
     * @param ID The id of the instance to search for.
     */
    findByID<T = any>(ID: string): Promise<Instance<T> | undefined>;
}
