/**
 * ElementToolStateStore - Manages element-level ephemeral tool state
 *
 * Provides centralized storage for UI tool state (answer eliminations, flags, etc.)
 * that should NOT be sent to the server for scoring. Each element is uniquely identified
 * across the entire assessment using composite keys.
 *
 * Key features:
 * - Element-level granularity (not item-level)
 * - Composite keys for global uniqueness: `assessmentId:sectionId:itemId:elementId`
 * - Cross-section state persistence
 * - Reactive subscriptions
 * - Optional persistence callback integration
 * - Generic solution for any tool
 */
export interface ElementIdComponents {
    assessmentId: string;
    sectionId: string;
    itemId: string;
    elementId: string;
}
export declare class ElementToolStateStore {
    private elementStates;
    private listeners;
    private onStateChange;
    /**
     * Generates a globally unique element ID by combining assessment, section, item, and element IDs.
     * Format: `${assessmentId}:${sectionId}:${itemId}:${elementId}`
     *
     * @example
     * getGlobalElementId('demo-assessment', 'section-1', 'q1', 'mc1')
     * // Returns: "demo-assessment:section-1:q1:mc1"
     */
    getGlobalElementId(assessmentId: string, sectionId: string, itemId: string, elementId: string): string;
    /**
     * Parses a global element ID into its component parts.
     *
     * @example
     * parseGlobalElementId('demo-assessment:section-1:q1:mc1')
     * // Returns: { assessmentId: 'demo-assessment', sectionId: 'section-1', itemId: 'q1', elementId: 'mc1' }
     */
    parseGlobalElementId(globalElementId: string): ElementIdComponents | null;
    /**
     * Sets tool state for a specific element.
     * Notifies all subscribers and triggers persistence callback.
     *
     * @param globalElementId Composite key identifying the element
     * @param toolId Tool identifier (e.g., 'answerEliminator', 'flagging')
     * @param state Tool-specific state object
     */
    setState(globalElementId: string, toolId: string, state: any): void;
    /**
     * Gets tool state for a specific element.
     *
     * @param globalElementId Composite key identifying the element
     * @param toolId Tool identifier
     * @returns Tool state or undefined if not found
     */
    getState(globalElementId: string, toolId: string): any | undefined;
    /**
     * Gets all tool states for a specific element.
     *
     * @param globalElementId Composite key identifying the element
     * @returns Object with tool states keyed by toolId
     */
    getElementState(globalElementId: string): Record<string, any>;
    /**
     * Gets all tool states for all elements.
     * Used for persistence and debugging.
     *
     * @returns Nested object: { globalElementId: { toolId: state } }
     */
    getAllState(): Record<string, Record<string, any>>;
    /**
     * Subscribes to state changes.
     * Callback is invoked whenever any element's tool state changes.
     *
     * @param callback Function to call on state changes
     * @returns Unsubscribe function
     */
    subscribe(callback: (state: Map<string, Map<string, any>>) => void): () => void;
    private _notifyListeners;
    /**
     * Sets a callback to be invoked on state changes for persistence integration.
     * Used by demo/app layer to persist tool state to localStorage or server.
     *
     * @param callback Function to call with serialized state on changes
     */
    setOnStateChange(callback: (state: Record<string, Record<string, any>>) => void): void;
    private _notifyStateChange;
    /**
     * Loads tool state from serialized format.
     * Used to restore state from localStorage or server.
     *
     * @param state Serialized state object
     */
    loadState(state: Record<string, Record<string, any>>): void;
    /**
     * Clears all tool state for a specific element.
     *
     * @param globalElementId Composite key identifying the element
     */
    clearElement(globalElementId: string): void;
    /**
     * Clears state for a specific tool across all elements.
     * Useful when disabling a tool globally.
     *
     * @param toolId Tool identifier
     */
    clearTool(toolId: string): void;
    /**
     * Clears all tool state for a specific section.
     * Useful when unmounting/disposing a section.
     *
     * @param assessmentId Assessment identifier
     * @param sectionId Section identifier
     */
    clearSection(assessmentId: string, sectionId: string): void;
    /**
     * Clears all tool state.
     * Useful when switching between assessments or demos.
     */
    clearAll(): void;
}
