export interface StorageLike {
    getItem(key: string): string | null;
    setItem(key: string, value: string): void;
    removeItem(key: string): void;
}
export interface TestAttemptSessionNavigationState {
    currentItemIndex: number;
    visitedItemIdentifiers: string[];
    currentSectionIdentifier?: string;
}
export interface TestAttemptSessionRealization {
    /**
     * Deterministic seed for shuffling/selection.
     * (Future: use for QTI ordering.shuffle / selection rules.)
     */
    seed: string;
    /**
     * Realized item order for this attempt (QTI item identifiers).
     */
    itemIdentifiers: string[];
}
export interface TestAttemptItemSession {
    /**
     * QTI assessmentItemRef identifier (same as questionRef.identifier).
     */
    itemIdentifier: string;
    /**
     * PIE session id for the underlying item attempt (if/when created).
     */
    pieSessionId?: string;
    attemptCount: number;
    isCompleted: boolean;
    startedAt?: string;
    updatedAt?: string;
    completedAt?: string;
    session?: unknown;
}
export interface TestAttemptSession {
    version: 1;
    /**
     * QTI-like identifier for the delivery attempt (administration).
     */
    testAttemptSessionIdentifier: string;
    assessmentId: string;
    startedAt: string;
    updatedAt: string;
    completedAt?: string;
    navigationState: TestAttemptSessionNavigationState;
    realization: TestAttemptSessionRealization;
    /**
     * Keyed by QTI item identifier (questionRef.identifier).
     */
    itemSessions: Record<string, TestAttemptItemSession>;
    /**
     * QTI 3.0 context variables (global assessment-level variables).
     * Managed by ContextVariableStore.
     */
    contextVariables?: Record<string, any>;
}
export declare function createMemoryStorage(initial?: Record<string, string>): StorageLike;
export declare function getBrowserLocalStorage(): StorageLike | null;
export declare function getOrCreateAnonymousDeviceId(storage: StorageLike): string;
export declare function createTestAttemptSessionIdentifier(args: {
    assessmentId: string;
    assignmentId?: string | null;
    userId?: string | null;
    storage: StorageLike;
}): {
    testAttemptSessionIdentifier: string;
    seed: string;
};
export declare function getTestAttemptSessionStorageKey(testAttemptSessionIdentifier: string): string;
export declare function loadTestAttemptSession(storage: StorageLike, testAttemptSessionIdentifier: string): TestAttemptSession | null;
export declare function saveTestAttemptSession(storage: StorageLike, session: TestAttemptSession): void;
export declare function createNewTestAttemptSession(args: {
    testAttemptSessionIdentifier: string;
    assessmentId: string;
    seed: string;
    itemIdentifiers: string[];
}): TestAttemptSession;
export declare function upsertVisitedItem(session: TestAttemptSession, itemIdentifier: string): TestAttemptSession;
export declare function setCurrentPosition(session: TestAttemptSession, args: {
    currentItemIndex: number;
    currentSectionIdentifier?: string;
}): TestAttemptSession;
export declare function upsertItemSessionFromPieSessionChange(session: TestAttemptSession, args: {
    itemIdentifier: string;
    pieSessionId: string;
    isCompleted?: boolean;
    session?: unknown;
}): TestAttemptSession;
