import type { MutableRefObject } from "react";
import type { EditorMode } from "../client/editContext";
import type { PageViewContext } from "../page-viewer/pageViewContext";
import type { BridgeInlineEditSessionCoordinator } from "../page-viewer/bridgeInlineEditSession";
import type { ApplyFieldPatchCommandPayload, BeginInlineEditCommandPayload, CancelInlineEditCommandPayload, FieldValueChangedEventPayload, InlineEditEndedEventPayload, InteractionEventPayload } from "../bridge/protocol";
export type BridgeInlineEditInteraction = InteractionEventPayload & Pick<BeginInlineEditCommandPayload, "selectedText" | "selectionStartOffset" | "selectionEndOffset">;
type UseBridgeInlineEditingOptions = {
    pageViewContextRef: MutableRefObject<PageViewContext | undefined>;
    inlineEditSession: BridgeInlineEditSessionCoordinator;
    blockIframeBlurUntil: (timestamp: number) => void;
    sendBeginInlineEdit: (payload: BeginInlineEditCommandPayload) => boolean;
    sendCancelInlineEdit: (payload: CancelInlineEditCommandPayload) => boolean;
    sendApplyFieldPatch: (payload: ApplyFieldPatchCommandPayload) => boolean;
};
export declare function useBridgeInlineEditing({ pageViewContextRef, inlineEditSession, blockIframeBlurUntil, sendBeginInlineEdit, sendCancelInlineEdit, sendApplyFieldPatch, }: UseBridgeInlineEditingOptions): {
    beginInlineEdit: (interaction: BridgeInlineEditInteraction, options?: {
        isCurrent?: () => boolean;
        sessionId?: string;
    }) => Promise<boolean>;
    clearInlineDedupe: () => void;
    endFieldFocus: () => void;
    handleFieldValueChanged: (payload: FieldValueChangedEventPayload, options?: {
        recordSession?: boolean;
        endedModeAtStart?: EditorMode;
    }) => Promise<void>;
    handleInlineEditEnded: (payload: InlineEditEndedEventPayload, options?: {
        recordSession?: boolean;
        releaseFocus?: boolean;
        endedModeAtStart?: EditorMode;
    }) => void;
};
export {};
