import type { BaseNode, Document } from "../Node.js";
import type { BaseRetriever } from "../Retriever.js";
import type { ServiceContext } from "../ServiceContext.js";
import type { StorageContext } from "../storage/StorageContext.js";
import type { BaseDocumentStore } from "../storage/docStore/types.js";
import type { BaseIndexStore } from "../storage/indexStore/types.js";
import type { BaseSynthesizer } from "../synthesizers/types.js";
import type { QueryEngine } from "../types.js";
import { IndexStruct } from "./IndexStruct.js";
import { IndexStructType } from "./json-to-index-struct.js";
export declare class KeywordTable extends IndexStruct {
    table: Map<string, Set<string>>;
    type: IndexStructType;
    addNode(keywords: string[], nodeId: string): void;
    deleteNode(keywords: string[], nodeId: string): void;
    toJson(): Record<string, unknown>;
}
export interface BaseIndexInit<T> {
    serviceContext?: ServiceContext;
    storageContext: StorageContext;
    docStore: BaseDocumentStore;
    indexStore?: BaseIndexStore;
    indexStruct: T;
}
/**
 * Indexes are the data structure that we store our nodes and embeddings in so
 * they can be retrieved for our queries.
 */
export declare abstract class BaseIndex<T> {
    serviceContext?: ServiceContext;
    storageContext: StorageContext;
    docStore: BaseDocumentStore;
    indexStore?: BaseIndexStore;
    indexStruct: T;
    constructor(init: BaseIndexInit<T>);
    /**
     * Create a new retriever from the index.
     * @param retrieverOptions
     */
    abstract asRetriever(options?: any): BaseRetriever;
    /**
     * Create a new query engine from the index. It will also create a retriever
     * and response synthezier if they are not provided.
     * @param options you can supply your own custom Retriever and ResponseSynthesizer
     */
    abstract asQueryEngine(options?: {
        retriever?: BaseRetriever;
        responseSynthesizer?: BaseSynthesizer;
    }): QueryEngine;
    /**
     * Insert a document into the index.
     * @param document
     */
    insert(document: Document): Promise<void>;
    abstract insertNodes(nodes: BaseNode[]): Promise<void>;
    abstract deleteRefDoc(refDocId: string, deleteFromDocStore?: boolean): Promise<void>;
}
