import * as net from 'net';
import { Document, InsertResult } from './document.js';
/**
 * Client for the AsanagiDB Compository (document store).
 *
 * Connects to asanadb via plain TCP on the configured host/port (default 127.0.0.1:8080).
 * Protocol: newline-delimited JSON. Node.js only (not browser-compatible).
 *
 * Documents returned by this client are pre-bound so you can call
 * {@link Document.save}, {@link Document.fetch}, {@link Document.update},
 * {@link Document.delete} on them without passing the client again.
 *
 * @example
 * const client = new AsanaDbClient();
 * await client.connect();
 * await client.useDatabase('mydb');
 *
 * const id = BigInt(Date.now());
 * const doc = new Document('Article', '_id', id)
 *   .add('title', 'Hello World')
 *   .add('body',  'My first Compository document.');
 * await client.insertOne(doc);
 *
 * const found = await client.findById(id);
 * console.log(found?.getString('title')); // Hello World
 * await client.close();
 */
export declare class AsanaDbClient {
    protected socket: net.Socket | null;
    protected pending: Array<(line: string) => void>;
    protected buffer: string;
    connect(host?: string, port?: number): Promise<void>;
    close(): Promise<void>;
    /** Switch the active database (tenant). */
    useDatabase(name: string): Promise<void>;
    /**
     * Store a Document. Uses {@link Document.clazz} as the vertex label and
     * {@link Document.id} as the vertex ID (when set).
     */
    insertOne(doc: Document): Promise<InsertResult>;
    /** Deep-fetch a Document by its internal vertex ID. Returns null if not found. */
    findById(id: bigint | number): Promise<Document | null>;
    /** Deep-fetch a Document by an indexed property key/value (e.g. the _key field). Returns null if not found. */
    findByKey(key: string, value: unknown): Promise<Document | null>;
    /** Replace an existing Document in-place by ID. */
    replaceOne(id: bigint | number, doc: Document): Promise<void>;
    /** Delete a Document by its internal vertex ID. */
    deleteOne(id: bigint | number): Promise<void>;
    /**
     * Return a shallow listing of all vertices. Each Document contains only
     * identifying fields (_id, _class, key field). Use {@link findById} for full content.
     */
    listAll(): Promise<Document[]>;
    protected send(request: Record<string, unknown>): Promise<unknown>;
}
//# sourceMappingURL=client.d.ts.map
