import { type AbstractType } from "@dao-xyz/borsh";
import type { Index, IndexEngineInitProperties, IndexedResult, Shape } from "@peerbit/indexer-interface";
import * as types from "@peerbit/indexer-interface";
import { QueryPlanner } from "./query-planner.js";
import { type Table } from "./schema.js";
import type { Database } from "./types.js";
export declare class SQLLiteIndex<T extends Record<string, any>> implements Index<T, any> {
    readonly properties: {
        scope: string[];
        db: Database;
        schema: AbstractType<any>;
        start?: () => Promise<void> | void;
        stop?: () => Promise<void> | void;
    };
    primaryKeyArr: string[];
    primaryKeyString: string;
    planner: QueryPlanner;
    private scopeString?;
    private _rootTables;
    private _tables;
    private _cursor;
    private cursorPruner;
    iteratorTimeout: number;
    closed: boolean;
    id: string;
    constructor(properties: {
        scope: string[];
        db: Database;
        schema: AbstractType<any>;
        start?: () => Promise<void> | void;
        stop?: () => Promise<void> | void;
    }, options?: {
        iteratorTimeout?: number;
    });
    get tables(): Map<string, Table>;
    get rootTables(): Table[];
    get cursor(): Map<string, {
        fetch: (amount: number) => Promise<IndexedResult[]>;
        expire: number;
    }>;
    init(properties: IndexEngineInitProperties<T, any>): this;
    start(): Promise<void>;
    private clearStatements;
    stop(): Promise<void>;
    drop(): Promise<void>;
    private resolveDependencies;
    get(id: types.IdKey, options?: {
        shape: Shape;
    }): Promise<IndexedResult<T> | undefined>;
    put(value: T, _id?: any): Promise<void>;
    iterate<S extends Shape | undefined>(request?: types.IterateOptions, options?: {
        shape?: S;
        reference?: boolean;
    }): types.IndexIterator<T, S>;
    private clearupIterator;
    getSize(): Promise<number>;
    del(query: types.DeleteOptions): Promise<types.IdKey[]>;
    sum(query: types.SumOptions): Promise<number | bigint>;
    count(request?: types.CountOptions): Promise<number>;
    get cursorCount(): number;
}
export declare class SQLiteIndices implements types.Indices {
    readonly properties: {
        scope?: string[];
        db: Database;
        parent?: SQLiteIndices;
    };
    private _scope;
    private scopes;
    private indices;
    private closed;
    constructor(properties: {
        scope?: string[];
        db: Database;
        parent?: SQLiteIndices;
    });
    init<T extends Record<string, any>, NestedType>(properties: IndexEngineInitProperties<T, NestedType>): Promise<Index<T, NestedType>>;
    scope(name: string): Promise<types.Indices>;
    start(): Promise<void>;
    stop(): Promise<void>;
    drop(): Promise<void>;
}
//# sourceMappingURL=engine.d.ts.map