import type pg from "pg";
import { VectorStoreBase, type IEmbedModel, type VectorStoreNoEmbedModel, type VectorStoreQuery, type VectorStoreQueryResult } from "./types.js";
import type { BaseNode, Metadata } from "../../Node.js";
export declare const PGVECTOR_SCHEMA = "public";
export declare const PGVECTOR_TABLE = "llamaindex_embedding";
/**
 * Provides support for writing and querying vector data in Postgres.
 * Note: Can't be used with data created using the Python version of the vector store (https://docs.llamaindex.ai/en/stable/examples/vector_stores/postgres.html)
 */
export declare class PGVectorStore extends VectorStoreBase implements VectorStoreNoEmbedModel {
    storesText: boolean;
    private collection;
    private schemaName;
    private tableName;
    private connectionString;
    private dimensions;
    private db?;
    /**
     * Constructs a new instance of the PGVectorStore
     *
     * If the `connectionString` is not provided the following env variables are
     * used to connect to the DB:
     * PGHOST=your database host
     * PGUSER=your database user
     * PGPASSWORD=your database password
     * PGDATABASE=your database name
     * PGPORT=your database port
     *
     * @param {object} config - The configuration settings for the instance.
     * @param {string} config.schemaName - The name of the schema (optional). Defaults to PGVECTOR_SCHEMA.
     * @param {string} config.tableName - The name of the table (optional). Defaults to PGVECTOR_TABLE.
     * @param {string} config.connectionString - The connection string (optional).
     * @param {number} config.dimensions - The dimensions of the embedding model.
     */
    constructor(config?: {
        schemaName?: string;
        tableName?: string;
        connectionString?: string;
        dimensions?: number;
    } & Partial<IEmbedModel>);
    /**
     * Setter for the collection property.
     * Using a collection allows for simple segregation of vector data,
     * e.g. by user, source, or access-level.
     * Leave/set blank to ignore the collection value when querying.
     * @param coll Name for the collection.
     */
    setCollection(coll: string): void;
    /**
     * Getter for the collection property.
     * Using a collection allows for simple segregation of vector data,
     * e.g. by user, source, or access-level.
     * Leave/set blank to ignore the collection value when querying.
     * @returns The currently-set collection value.  Default is empty string.
     */
    getCollection(): string;
    private getDb;
    private checkSchema;
    /**
     * Connects to the database specified in environment vars.
     * This method also checks and creates the vector extension,
     * the destination table and indexes if not found.
     * @returns A connection to the database, or the error encountered while connecting/setting up.
     */
    client(): Promise<pg.Client>;
    /**
     * Delete all vector records for the specified collection.
     * NOTE: Uses the collection property controlled by setCollection/getCollection.
     * @returns The result of the delete query.
     */
    clearCollection(): Promise<pg.QueryResult<any>>;
    private getDataToInsert;
    /**
     * Adds vector record(s) to the table.
     * NOTE: Uses the collection property controlled by setCollection/getCollection.
     * @param embeddingResults The Nodes to be inserted, optionally including metadata tuples.
     * @returns A list of zero or more id values for the created records.
     */
    add(embeddingResults: BaseNode<Metadata>[]): Promise<string[]>;
    /**
     * Deletes a single record from the database by id.
     * NOTE: Uses the collection property controlled by setCollection/getCollection.
     * @param refDocId Unique identifier for the record to delete.
     * @param deleteKwargs Required by VectorStore interface.  Currently ignored.
     * @returns Promise that resolves if the delete query did not throw an error.
     */
    delete(refDocId: string, deleteKwargs?: any): Promise<void>;
    /**
     * Query the vector store for the closest matching data to the query embeddings
     * @param query The VectorStoreQuery to be used
     * @param options Required by VectorStore interface.  Currently ignored.
     * @returns Zero or more Document instances with data from the vector store.
     */
    query(query: VectorStoreQuery, options?: any): Promise<VectorStoreQueryResult>;
    /**
     * Required by VectorStore interface.  Currently ignored.
     * @param persistPath
     * @param fs
     * @returns Resolved Promise.
     */
    persist(persistPath: string): Promise<void>;
}
