import type { PreviewPageDesignEditorApplyOutcome } from '../preview/PageDesignEditorStateContext';
import type { PreviewCustomizeAction } from './previewCustomizeActions';
type CustomizeSaveSequenceRef = {
    current: number;
};
type SavedCustomizeOutcome = Extract<PreviewPageDesignEditorApplyOutcome, {
    kind: 'saved';
}>;
export declare function runOptimisticCustomizeAction<TAction extends PreviewCustomizeAction, TSnapshot = undefined>(input: Readonly<{
    action: TAction;
    snapshot: TSnapshot;
    sequenceRef: CustomizeSaveSequenceRef;
    applyAction: (action: PreviewCustomizeAction) => Promise<PreviewPageDesignEditorApplyOutcome>;
    failureMessage: string;
    applyOptimistic?: (snapshot: TSnapshot) => void;
    onStart?: () => void;
    onSaved?: (outcome: SavedCustomizeOutcome) => void;
    rollback?: (snapshot: TSnapshot) => void;
    onFailed: (message: string) => void;
}>): void;
export {};
