import { CdmCorpusDefinition, CdmContainerDefinition, CdmDocumentDefinition, CdmFolderDefinition, resolveOptions } from '../internal';
import { ConcurrentSemaphore } from '../Utilities/Concurrent/concurrentSemaphore';
/**
 * @internal
 * Synchronizes all dictionaries relating to the documents (and their statuses) in the corpus.
 */
export declare class DocumentLibrary {
    private allDocuments;
    private corpus;
    private docsCurrentlyIndexing;
    private docsCurrentlyLoading;
    private docsNotFound;
    private pathLookup;
    private readonly TAG;
    /**
     * @internal
     */
    concurrentReadLock: ConcurrentSemaphore;
    constructor(corpus: CdmCorpusDefinition);
    /**
     * @internal
     *
     * Adds a folder and document to the list of all documents in the corpus. Also adds the document path to the path lookup.
     * @param path The document path.
     * @param folder The folder.
     * @param doc The document
     */
    addDocumentPath(path: string, folder: CdmFolderDefinition, doc: CdmDocumentDefinition): void;
    /**
     * @internal
     *
     * Removes a folder and document from the list of all documents in the corpus. Also removes the document path from the path lookup.
     * @param path The document path.
     * @param folder The folder.
     * @param doc The document.
     */
    removeDocumentPath(path: string, folder: CdmFolderDefinition, doc: CdmDocumentDefinition): void;
    /**
     * @internal
     *
     * Returns a list of all the documents that are not loaded.
     */
    listDocsNotIndexed(rootDoc: CdmDocumentDefinition, docsLoaded: Set<string>): Set<CdmDocumentDefinition>;
    /**
     * @internal
     *
     * Returns a list of all the documents in the corpus.
     */
    listAllDocuments(): Set<CdmDocumentDefinition>;
    /**
     * @internal
     * Fetches a document from the path lookup.
     * @param path The document path.
     */
    fetchDocument(path: string): CdmDocumentDefinition;
    /**
     * @internal
     *
     * Sets a document's status to loading if the document needs to be loaded.
     * @param docPath The document path.
     */
    needToLoadDocument(docPath: string, docsLoading: Set<string>): boolean;
    /**
     * @internal
     *
     * Marks a document for indexing if it has loaded successfully, or adds it to the list of documents not found if it failed to load.
     * @param doc The document that was loaded.
     * @param docPath The document path.
     * @param docsNowLoaded The dictionary of documents that are now loaded.
     */
    markAsLoadedOrFailed(docPath: string, doc: CdmContainerDefinition): void;
    /**
     * @internal
     *
     * Removes a document from the list of documents that are not indexed to mark it as indexed.
     * @param doc The document.
     */
    markDocumentAsIndexed(doc: CdmDocumentDefinition): void;
    /**
     * @internal
     *
     * Adds a document to the list of documents that are not indexed to mark it for indexing.
     * @param doc The document.
     */
    markDocumentForIndexing(doc: CdmDocumentDefinition): boolean;
    /**
     * @internal
     *
     * Whether a specific pair of folder-document exists in the list of all documents in the corpus.
     * @param fd The folder-document pair.
     */
    contains(fd: [CdmFolderDefinition, CdmDocumentDefinition]): boolean;
    /**
     * @internal
     */
    loadFolderOrDocument(objectPath: string, forceReload?: boolean, resOpt?: resolveOptions): Promise<CdmContainerDefinition>;
    /**
     * @internal
     */
    private _loadFolderOrDocument;
}
