export declare const CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY: string;
/** Keys written by this service in localStorage when using {@link smartCardStorage}. */
export declare const CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY: string;
export declare class CurrentSiteCloudIdService {
    /**
     * Holds the shared tenant_info work: one in-flight fetch, then (on success) a settled promise for the session cloud
     * id so later callers never trigger another `tenant_info` in the same page lifetime (until {@link clearCache}).
     */
    private tenantInfoInflightPromise;
    private readStoredCloudId;
    private writeStoredCloudId;
    private ensureTenantInfoInflightStarted;
    /**
     * Returns the currently cached cloud id synchronously and starts a background refresh.
     * The refresh result is persisted for future calls but is not awaited by this call.
     */
    getCachedCloudIdAndRefresh(): string | undefined;
    /** Writes tenant cloud id for tests or callers that intentionally warm storage before edge resolves. */
    persistStoredCloudId(cloudId: string): void;
    /**
     * When local storage already has a tenant cloud id, it is returned immediately; a background tenant_info refresh
     * is still kicked off unless one is already in flight.
     *
     * Without storage, this awaits the deduped in-flight tenant_info (first concurrent caller chooses the URL;
     * all share one promise regardless of subsequent `baseUriWithNoTrailingSlash`).
     *
     * On network success with no cloud id, or on failure: falls back via {@link readStoredCloudId}.
     */
    get(baseUriWithNoTrailingSlash?: string): Promise<string | undefined>;
    /** Clears session pin and persisted storage so the next {@link get} is a fresh tenant_info fetch. */
    clearCache(): void;
}
export declare const currentSiteCloudIdService: CurrentSiteCloudIdService;
/**
 * Resolves the current site cloud id through the module-level {@link currentSiteCloudIdService}.
 * Returns a stored cloud id immediately when one exists; otherwise waits for the shared
 * `tenant_info` request and persists the result for subsequent cached reads.
 */
export declare const getCurrentSiteCloudId: (baseUriWithNoTrailingSlash?: string) => Promise<string | undefined>;
/**
 * Reads the current site cloud id from browser storage (the `site-cloud-id:v1` row) via the
 * module-level {@link currentSiteCloudIdService} singleton, without awaiting network work.
 * Calling this also starts the shared `tenant_info` refresh in the background when one is not
 * already running, so a later call can observe a refreshed value when available.
 */
export declare function getCachedCurrentSiteCloudIdAndRefresh(): string | undefined;
