/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext.js";
/**
 * @internal
 */
export declare class DataStoreContexts implements Iterable<[string, FluidDataStoreContext]>, IDisposable {
    private readonly notBoundContexts;
    /**
     * Attached and loaded context proxies
     */
    private readonly _contexts;
    /**
     * List of pending context waiting either to be bound or to arrive from another client.
     * This covers the case where a local context has been created but not yet bound,
     * or the case where a client knows a store will exist and is waiting on its creation,
     * so that a caller may await the deferred's promise until such a time as the context is fully ready.
     * This is a superset of _contexts, since contexts remain here once the Deferred resolves.
     */
    private readonly deferredContexts;
    private readonly disposeOnce;
    private readonly _logger;
    constructor(baseLogger: ITelemetryBaseLogger);
    [Symbol.iterator](): Iterator<[string, FluidDataStoreContext]>;
    get size(): number;
    get disposed(): boolean;
    readonly dispose: () => void;
    notBoundLength(): number;
    isNotBound(id: string): boolean;
    has(id: string): boolean;
    get(id: string): FluidDataStoreContext | undefined;
    delete(id: string): boolean;
    private readonly _recentlyDeletedContexts;
    getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined;
    /**
     * Return the unbound local context with the given id,
     * or undefined if it's not found or not unbound.
     */
    getUnbound(id: string): LocalFluidDataStoreContext | undefined;
    /**
     * Add the given context, marking it as to-be-bound
     */
    addUnbound(context: LocalFluidDataStoreContext): void;
    /**
     * Get the context with the given id, once it exists locally and is attached.
     * e.g. If created locally, it must be bound, or if created remotely then it's fine as soon as it's sync'd in.
     * @param id - The id of the context to get
     * @param wait - If false, return undefined if the context isn't present and ready now. Otherwise, wait for it.
     */
    getBoundOrRemoted(id: string, wait: boolean): Promise<FluidDataStoreContext | undefined>;
    private ensureDeferred;
    /**
     * Update this context as bound
     */
    bind(id: string): void;
    /**
     * Triggers the deferred to resolve, indicating the context is not local-only
     * @param id - The id of the context to resolve to
     */
    private resolveDeferred;
    /**
     * Add the given context, marking it as not local-only.
     * This could be because it's a local context that's been bound, or because it's a remote context.
     * @param context - The context to add
     */
    addBoundOrRemoted(context: FluidDataStoreContext): void;
}
//# sourceMappingURL=dataStoreContexts.d.ts.map