import { TestAttemptSession } from '@pie-players/pie-assessment-toolkit';
import { SectionControllerHandle, SectionSessionPersistenceConfig, SectionControllerRuntimeState, SectionControllerSessionState } from './toolkit-section-contracts.js';
import { ItemEntity } from '@pie-players/pie-players-shared';
import { NavigationResult, SectionControllerChangeListener, SectionCompositionModel, SectionNavigationState, SectionViewModel, SessionChangedResult } from './types.js';
export declare class SectionController implements SectionControllerHandle {
    private readonly contentService;
    private readonly sessionService;
    private readonly itemNavigationService;
    private sessionPersistence;
    private state;
    private readonly listeners;
    private readonly trackedRenderables;
    private readonly loadedRenderableKeys;
    private readonly itemCompletionByCanonicalId;
    private sectionLoadingComplete;
    private totalRegistered;
    private totalLoaded;
    private sectionItemsComplete;
    private completedCount;
    private totalItems;
    private nextApplyRevision;
    private lastReplayedApplyRevision;
    private pendingApplyReplay;
    private emitChange;
    subscribe(listener: SectionControllerChangeListener): () => void;
    initialize(input?: unknown): Promise<void>;
    updateInput(input?: unknown): Promise<void>;
    configureSessionPersistence(config: SectionSessionPersistenceConfig): void;
    hydrate(): Promise<void>;
    persist(): Promise<void>;
    dispose(): void;
    getViewModel(): SectionViewModel;
    getCompositionModel(): SectionCompositionModel;
    getInstructions(): import('@pie-players/pie-players-shared').RubricBlock[];
    getSectionLoadedEventDetail(): {
        sectionId: string;
        itemCount: number;
        passageCount: number;
        isPageMode: boolean;
    };
    getResolvedItemSessions(): Record<string, any>;
    getResolvedTestAttemptSession(): TestAttemptSession | null;
    getCanonicalItemId(itemId: string): string;
    private getItemViewModels;
    getItemSessionsByItemId(): Record<string, any>;
    /**
     * Host-facing persistence shape.
     * Use this for serializing/restoring section session state across reloads.
     * This is intentionally compact and not a full runtime diagnostics view.
     */
    getSession(): SectionControllerSessionState | null;
    private getSectionItemIdentifiers;
    /**
     * Runtime/debugger shape scoped to the current section.
     * Use this for widgets that need a section-scoped live snapshot (debug panels, diagnostics).
     * Unlike getSession(), this is optimized for runtime introspection, not host persistence.
     */
    getRuntimeState(): SectionControllerRuntimeState | null;
    /**
     * Snapshot of currently-loaded renderables in registration order.
     *
     * Walks `trackedRenderables` (preserves insertion order) and emits an entry
     * for each entry whose key is in `loadedRenderableKeys`. Used by the
     * coordinator to replay `content-loaded` events to subscribers that
     * attach after a renderable has finished loading.
     */
    private collectLoadedRenderableSnapshot;
    getCurrentItem(): ItemEntity | null;
    getCurrentItemSession(): unknown;
    getNavigationState(isLoading?: boolean): SectionNavigationState;
    updateItemSession(itemId: string, sessionDetail: any): SessionChangedResult | null;
    applySession(session: SectionControllerSessionState | null, options?: {
        mode?: "replace" | "merge";
    }): Promise<void>;
    /**
     * Move between items inside the current section only.
     * Cross-section navigation belongs to the higher-level assessment player.
     */
    navigateToItem(index: number): NavigationResult | null;
    handleContentRegistered(args: {
        itemId: string;
        canonicalItemId?: string;
        contentKind?: string;
    }): void;
    handleContentUnregistered(args: {
        itemId: string;
        canonicalItemId?: string;
        contentKind?: string;
    }): void;
    handleContentLoaded(args: {
        itemId: string;
        canonicalItemId?: string;
        contentKind?: string;
        detail?: unknown;
        timestamp?: number;
    }): void;
    handleItemPlayerError(args: {
        itemId: string;
        canonicalItemId?: string;
        contentKind?: string;
        error: unknown;
        timestamp?: number;
    }): void;
    reportSectionError(args: {
        source: "item-player" | "section-runtime" | "toolkit" | "controller";
        error: unknown;
        itemId?: string;
        canonicalItemId?: string;
        contentKind?: string;
        timestamp?: number;
    }): void;
    private resetLifecycleTracking;
    private toSectionContentKind;
    private getRenderableKey;
    private readCompleteFromSession;
    private bootstrapCompletionFromSessions;
    private updateItemCompleteState;
    private emitSectionItemsCompleteIfChanged;
    private evaluateSectionLoadingState;
    private replayPendingAppliedSession;
    private normalizeApplySession;
    private normalizeItemSessionEntry;
    private applyNormalizedSessionToState;
    private cloneForRead;
}
