import type { Filter } from '../types/message-types.js';
import { createLevelDatabase, LevelWrapper } from './level-wrapper.js';
export interface IndexLevelOptions {
    signal?: AbortSignal;
}
/**
 * A LevelDB implementation for indexing the messages stored in the DWN.
 */
export declare class IndexLevel {
    config: IndexLevelConfig;
    db: LevelWrapper<string>;
    constructor(config: IndexLevelConfig);
    open(): Promise<void>;
    close(): Promise<void>;
    /**
     * Adds indexes for a specific data/object/content.
     * @param dataId ID of the data/object/content being indexed.
     */
    put(tenant: string, dataId: string, indexes: {
        [property: string]: unknown;
    }, options?: IndexLevelOptions): Promise<void>;
    /**
     * Executes the given single filter query and appends the results without duplicate into `matchedIDs`.
     */
    private executeSingleFilterQuery;
    query(tenant: string, filters: Filter[], options?: IndexLevelOptions): Promise<Array<string>>;
    delete(tenant: string, dataId: string, options?: IndexLevelOptions): Promise<void>;
    clear(): Promise<void>;
    /**
     * @returns IDs of data that matches the exact property and value.
     */
    private findExactMatches;
    /**
     * @returns IDs of data that matches the range filter.
     */
    private findRangeMatches;
    private encodeValue;
    /**
     *  Encodes a numerical value as a string for lexicographical comparison.
     *  If the number is positive it simply pads it with leading zeros.
     *  ex.: input:  1024 => "0000000000001024"
     *       input: -1024 => "!9007199254739967"
     *
     * @param value the number to encode.
     * @returns a string representation of the number.
     */
    static encodeNumberValue(value: number): string;
    /**
     * Extracts the value encoded within the indexed key when a record is inserted.
     *
     * ex. key: 'dateCreated\u0000"2023-05-25T18:23:29.425008Z"\u0000bafyreigs3em7lrclhntzhgvkrf75j2muk6e7ypq3lrw3ffgcpyazyw6pry'
     *     extracted value: "2023-05-25T18:23:29.425008Z"
     *
     * @param key an IndexLevel db key.
     * @returns the extracted encodedValue from the key.
     */
    static extractValueFromKey(key: string): string;
    /**
     * Joins the given values using the `\x00` (\u0000) character.
     */
    private static delimiter;
    private join;
    dump(): Promise<void>;
}
type IndexLevelConfig = {
    location: string;
    createLevelDatabase?: typeof createLevelDatabase;
};
export {};
//# sourceMappingURL=index-level.d.ts.map