export type AutosaveSaveStatus = 'idle' | 'saving' | 'skipped' | 'error'; export interface AutosaveRegistration { containerName: string; } export declare const AUTOSAVE_SAVE_STATUS: { readonly IDLE: "idle"; readonly SAVING: "saving"; readonly SKIPPED: "skipped"; readonly ERROR: "error"; }; export declare const TYPING_INPUT_SELECTOR: string; /** * Determines whether autosave should be processed for a given action payload. * Resolution order: * 1. `payload.data.caseInfo.settings.autoSave` — set by the API response (relocated * from `uiResources.settings.autoSave` by the DX API translator) on actions that * carry full case data (ADD/REPLACE_CONTAINER_ITEM). * 2. `caseInfo.settings.autoSave` from Redux, keyed by the payload's context — used * when the payload does not carry caseInfo (FIELD_CHANGE, UPDATE_CONTAINER_ITEM * without data, REMOVE_CONTAINER_ITEM, timer-management actions, etc.). * 3. `false` when no source provides the flag. */ export declare const isAutosaveEnabled: (payload?: { data?: { caseInfo?: { settings?: { autoSave?: unknown; }; }; }; context?: string; containerItemID?: string; }) => boolean; /** Returns true when the context is registered for autosave. */ export declare const isAutosaveEnabledForContext: (context: string) => boolean; export declare const recordPendingValue: (context: string, reference: string, value: string) => void; /** Registers a context. Called by autosave-middleware on ADD/REPLACE_CONTAINER_ITEM. */ export declare const registerAutosaveContext: (context: string, reg: AutosaveRegistration) => void; /** Removes a context and cancels any pending timer. */ export declare const deregisterAutosaveContext: (context: string) => void; /** * Deregisters every registered context that is a descendant of `parentContext`. * Strictly children only — `parentContext` itself is not touched (callers handle * the parent context separately under their own eligibility guard). * * Used by the middleware on REPLACE_CONTAINER_ITEM and REMOVE_CONTAINER_ITEM so a * subtree teardown cleans up registered children even when the parent container * itself was never autosave-eligible. */ export declare const deregisterAutosaveOnChildContexts: (parentContext: string) => void; /** Subscribes to status changes for a context. Returns an unsubscribe function. */ export declare const subscribeAutosaveStatus: (context: string, callback: (status: AutosaveSaveStatus) => void) => (() => void); /** * Cancels any pending autosave timer for the given context without deregistering it. * Call this when a manual save or submit action is initiated so the timer does not * fire redundantly after the action completes. */ export declare const cancelAutosave: (context: string) => void; /** Schedules an autosave after the configured delay of inactivity. No-ops for unregistered contexts. */ export declare const scheduleAutosave: (context: string) => void; export declare const getSuspendedContexts: () => ReadonlySet; /** * Suspends autosave for a context for the duration an embedded data modal is open. * Cancels any pending timer and blocks new ones until `resumeAutosave` is called. */ export declare const suspendAutosave: (context: string) => void; /** * Resumes autosave for a context after the embedded data modal closes. * If the form has unsaved changes (dirty), reschedules the timer so they are not silently dropped. */ export declare const resumeAutosave: (context: string) => void;