import type * as Rdf from '../rdf/rdfModel';
import { ElementTypeGraph, LinkTypeModel, ElementTypeIri, ElementTypeModel, PropertyTypeIri, PropertyTypeModel, LinkTypeIri, ElementIri, ElementModel, LinkModel } from '../model';
import { DataProvider, DataProviderLinkCount, DataProviderLookupParams, DataProviderLookupItem } from '../provider';
/**
 * Options for {@link IndexedDbCachedProvider}.
 *
 * @see {@link IndexedDbCachedProvider}
 */
export interface IndexedDbCachedProviderOptions {
    /**
     * Base data provider to cache request results for.
     */
    readonly baseProvider: DataProvider;
    /**
     * `IndexedDB` database name to store cached data.
     */
    readonly dbName: string;
    /**
     * Whether to cache missing results from the following {@link DataProvider} methods:
     *  - {@link DataProvider.elements elements()}
     *  - {@link DataProvider.elementTypes elementTypes()}
     *  - {@link DataProvider.linkTypes linkTypes()}
     *  - {@link DataProvider.propertyTypes propertyTypes()}
     *
     * @default true
     */
    readonly cacheMissing?: boolean;
    /**
     * Whether to cache results from {@link DataProvider.links}.
     *
     * If enabled, stores and updates a partial "mirror" of a previously-requested
     * graph links from previous requests to partially or fully return cached ones.
     *
     * @default true
     */
    readonly cacheLinks?: boolean;
    /**
     * Whether to cache results from {@link DataProvider.lookup} with
     * {@link DataProviderLookupParams.text text} requests.
     *
     * @default false
     */
    readonly cacheTextLookups?: boolean;
    /**
     * Signal to close [IndexedDB database](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
     * and dispose the provider.
     */
    readonly closeSignal: AbortSignal;
}
/**
 * Caches graph data returned from another data provider using
 * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) storage.
 *
 * @category Data
 */
export declare class IndexedDbCachedProvider implements DataProvider {
    static readonly DB_VERSION = 3;
    private readonly hasher;
    private readonly baseProvider;
    private readonly dbName;
    private readonly cacheMissing;
    private readonly cacheLinks;
    private readonly cacheTextLookups;
    private readonly linkLock;
    private readonly closeSignal;
    private openedDb;
    private deleteRequest;
    constructor(options: IndexedDbCachedProviderOptions);
    get factory(): Rdf.DataFactory;
    clearCache(): Promise<void>;
    private deleteDatabase;
    private openDb;
    private onClose;
    private closeDatabase;
    knownElementTypes(params: {
        signal?: AbortSignal | undefined;
    }): Promise<ElementTypeGraph>;
    knownLinkTypes(params: {
        signal?: AbortSignal | undefined;
    }): Promise<LinkTypeModel[]>;
    elementTypes(params: {
        classIds: readonly ElementTypeIri[];
        signal?: AbortSignal | undefined;
    }): Promise<Map<ElementTypeIri, ElementTypeModel>>;
    propertyTypes(params: {
        propertyIds: readonly PropertyTypeIri[];
        signal?: AbortSignal | undefined;
    }): Promise<Map<PropertyTypeIri, PropertyTypeModel>>;
    linkTypes(params: {
        linkTypeIds: readonly LinkTypeIri[];
        signal?: AbortSignal | undefined;
    }): Promise<Map<LinkTypeIri, LinkTypeModel>>;
    elements(params: {
        elementIds: readonly ElementIri[];
        signal?: AbortSignal | undefined;
    }): Promise<Map<ElementIri, ElementModel>>;
    links(params: {
        primary: ReadonlyArray<ElementIri>;
        secondary: ReadonlyArray<ElementIri>;
        linkTypeIds?: readonly LinkTypeIri[] | undefined;
        signal?: AbortSignal | undefined;
    }): Promise<LinkModel[]>;
    private readLinkRanges;
    private selectMissingLinkBlocks;
    private fetchAndCacheLinks;
    private updateLinkRanges;
    private readLinksFromCache;
    connectedLinkStats(params: {
        elementId: ElementIri;
        inexactCount?: boolean;
        signal?: AbortSignal | undefined;
    }): Promise<DataProviderLinkCount[]>;
    lookup(params: DataProviderLookupParams): Promise<DataProviderLookupItem[]>;
}
//# sourceMappingURL=indexedDbCachedProvider.d.ts.map