import type { MutableRefObject } from "react";
import type { EditorMode } from "../client/editContext";
import type { FieldDescriptor } from "../pageModel";
import type { PageViewContext } from "../page-viewer/pageViewContext";
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>;
    activeBridgeInlineEditRef: MutableRefObject<BridgeInlineEditState | null>;
    blockIframeBlurUntil: (timestamp: number) => void;
    sendBeginInlineEdit: (payload: BeginInlineEditCommandPayload) => boolean;
    sendCancelInlineEdit: (payload: CancelInlineEditCommandPayload) => boolean;
    sendApplyFieldPatch: (payload: ApplyFieldPatchCommandPayload) => boolean;
};
export type BridgeInlineEditState = {
    elementKey: string;
    fieldId: string;
    item?: FieldDescriptor["item"];
    modeAtStart: EditorMode;
    value?: string;
};
export declare function useBridgeInlineEditing({ pageViewContextRef, activeBridgeInlineEditRef, blockIframeBlurUntil, sendBeginInlineEdit, sendCancelInlineEdit, sendApplyFieldPatch, }: UseBridgeInlineEditingOptions): {
    beginInlineEdit: (interaction: BridgeInlineEditInteraction) => Promise<boolean>;
    clearInlineDedupe: () => void;
    endFieldFocus: () => void;
    handleFieldValueChanged: (payload: FieldValueChangedEventPayload) => Promise<void>;
    handleInlineEditEnded: (payload: InlineEditEndedEventPayload) => void;
};
export {};
