/**
 * Inverted asset-reference index (assets-referenced-not-owned, Phase 3).
 *
 * The Library "loose / unreferenced" filter needs to know, for EVERY asset, how
 * many entries reference it — so deliberate library uploads (and the owner
 * migration's re-homed orphan pastes) aren't drowned by incidental ones. This
 * is the inversion of P2's delete-impact (which asks the question for one
 * entry's assets); both consume the same workspace walk (asset-reference-scan).
 *
 * An asset with count 0 is "loose". Unreferenced is a VALID steady state — a
 * not-yet-embedded library upload looks identical to an orphan paste — so this
 * NEVER drives deletion; it only powers a filter.
 *
 * Fail-safe (eng review): on a `partial` scan the counts are INCOMPLETE — an
 * asset absent from the index might simply not have been reached. Callers must
 * NOT mark such assets loose (a false-loose could lure a user into deleting a
 * still-referenced asset); the client gates the whole loose filter on `partial`.
 */
import type { WorkspaceManager } from '../core/workspace-manager.js';
export interface AssetReferenceIndex {
    /** assetId → number of distinct entries that reference it (live-reconciled).
     *  Assets referenced by no entry are absent (count 0). Legacy un-indexed
     *  blobs use 3-segment URLs the immutable-ref scan ignores, so they never
     *  appear here — the client treats an unknown count as "not loose". */
    index: Record<string, number>;
    /** True when the scan hit its budget before covering the workspace — counts
     *  are then incomplete and the client must mark nothing loose. */
    partial: boolean;
}
/**
 * Build the workspace-wide assetId → referencing-entry-count map in one walk.
 * Each entry contributes at most 1 to an asset's count (the scan dedupes
 * assetIds per entry), so the count is "how many entries reference this asset".
 */
export declare function computeAssetReferenceIndex(opts: {
    workspaceManager: WorkspaceManager;
    /** Test hook — overrides the scan budget. */
    budgetMs?: number;
}): Promise<AssetReferenceIndex>;
