import type { DexieCloudDB } from '../db/DexieCloudDB'; import { BlobRef } from './blobResolve'; /** * Deduplicates in-flight blob downloads. * * Both the blob-resolve middleware and the eager blob downloader may * try to fetch the same blob concurrently. This tracker ensures each * unique blob ref is only downloaded once — subsequent requests for * the same ref piggyback on the existing promise. * * Instantiate once per DexieCloudDB. */ export declare class BlobDownloadTracker { private inFlight; private db; constructor(db: DexieCloudDB); /** * Download a blob, deduplicating concurrent requests for the same ref. * * @param blobRef - The BlobRef to download * @param dbUrl - Base URL for the database (e.g., 'https://mydb.dexie.cloud') */ download(blobRef: BlobRef, dbUrl: string): Promise; } /** * Download blob data from server via proxy endpoint. * Uses auth header for authentication (same as sync). * When accessToken is null, the request is made without Authorization header — * this allows downloading blobs from public realms (rlm-public) for * unauthenticated users. * * @param blobRef - The BlobRef to download * @param dbUrl - Base URL for the database (e.g., 'https://mydb.dexie.cloud') * @param accessToken - Access token for authentication, or null for anonymous access */ export declare function downloadBlob(blobRef: BlobRef, dbUrl: string, accessToken: string | null): Promise;