type PortalsBucketUpdater = React.Dispatch<React.SetStateAction<Record<string | number, React.ReactPortal>>>;
type PortalRendererUpdater = React.Dispatch<React.SetStateAction<Array<PortalBucketType>>>;
type PortalBucketType = {
    capacity: number;
    portals: Record<string | number, React.ReactPortal>;
    updater: PortalsBucketUpdater | null;
};
/**
 * A utility class to manage and dynamically scale React portals across multiple buckets.
 * It allows for efficient rendering of large numbers of React portals by distributing them
 * across "buckets" and updating these buckets as necessary to balance load and performance.
 *
 * @class PortalManager
 * @typedef {object} PortalManager
 *
 * @property {number} maxBucketCapacity - The maximum capacity of each bucket before a new bucket is created.
 * @property {number} scaleRatio - The ratio to determine the number of new buckets to add when scaling up.
 * @property {Array<PortalBucketType>} buckets - An array of bucket objects where each bucket holds a record of React portals.
 * @property {Set<number>} availableBuckets - A set of indices representing buckets that have available capacity.
 * @property {Map<React.Key, number>} portalToBucketMap - A map of React portal keys to their corresponding bucket indices.
 * @property {PortalRendererUpdater|null} portalRendererUpdater - A function to trigger updates to the rendering of portals.
 * @property {number} scaleCapacityThreshold - The threshold at which the buckets are scaled up to accommodate more portals.
 * @property {Map<number, ReturnType<typeof throttle>>} throttledBucketUpdaters - A map of bucket IDs to their throttled update functions.
 * @property {number} throttleDelay - The delay in milliseconds for throttling bucket updates.
 *
 * @param {number} [initialBuckets=DEFAULT_INITIAL_BUCKETS] - The initial number of buckets to create.
 * @param {number} [maxBucketCapacity=DEFAULT_MAX_BUCKET_CAPACITY] - The maximum number of portals a single bucket can hold.
 * @param {number} [scaleRatio=DEFAULT_SCALE_RATIO] - The ratio used to calculate the number of new buckets to add when scaling.
 * @param {number} [throttleDelay=DEFAULT_THROTTLE_DELAY] - The delay in milliseconds for throttling updates.
 */
export declare class PortalManager {
    private maxBucketCapacity;
    private scaleRatio;
    private buckets;
    private availableBuckets;
    private portalToBucketMap;
    private portalRendererUpdater;
    private scaleCapacityThreshold;
    private throttledBucketUpdaters;
    private throttleDelay;
    /**
     * Controls whether to use throttled updates or immediate synchronous updates.
     * During initial load, we use synchronous updates to avoid delays and ensure immediate responsiveness.
     * After the initial load period (one RAF cycle), we switch to throttled updates for better performance.
     */
    private shouldUseThrottledUpdates;
    /**
     * RequestAnimationFrame callback ID used to transition from synchronous to throttled update mode.
     * This ensures we switch to throttled mode after the initial render cycle completes.
     */
    private throttleActivationRAFId;
    constructor(initialBuckets?: number, maxBucketCapacity?: number, scaleRatio?: number, throttleDelay?: number);
    private getCurrentBucket;
    private createBucket;
    private getOrCreateThrottledUpdater;
    getBuckets(): PortalBucketType[];
    registerBucket(id: number, updater: PortalsBucketUpdater): void;
    unregisterBucket(id: number): void;
    updateBuckets(id: number, immediate?: boolean): void;
    registerPortal(key: string | number, portal: React.ReactPortal, immediate?: boolean): () => void;
    registerPortalRenderer(updater: PortalRendererUpdater): void;
    unregisterPortalRenderer(): void;
    /**
     * Cleans up resources used by the PortalManager. This includes clearing all portals,
     * unregistering all buckets, and resetting internal state.
     */
    destroy(): void;
}
export {};
