import { AddComponentOperation, EditOperation, ExecuteEditOptions, PublishItemOperation, SuggestedEdit, User } from "../../types";
import { FieldDescriptor, FullItem, ItemDescriptor, Page } from "../pageModel";
import React from "react";
import { EditorConfiguration } from "../../config/types";
import { ConfirmationDialogHandle } from "../ConfirmationDialog";
import { ItemsRepository } from "./itemsRepository";
import type { FieldModificationStore } from "./fieldModificationStore";
import { EditorMode, LayoutMode } from "./editContext";
export declare function cleanupPendingSuggestedEditOperations(suggestedEdit: SuggestedEdit, user?: {
    name: string;
}): void;
export declare function waitForPendingSuggestedEditSave(suggestedEdit: SuggestedEdit): Promise<void>;
export declare function getOperationsContext(state: {
    page?: Page;
    currentItemDescriptor?: ItemDescriptor;
    item?: FullItem;
    sessionId: string;
    user?: User;
    setSelection: (ids: string[]) => void;
    requestRefresh: (refresh: "immediate" | "waitForQuietPeriod") => void;
    configuration: EditorConfiguration;
    setLockedField: (field: FieldDescriptor) => void;
    lockedField?: FieldDescriptor;
    loadItem: (item: ItemDescriptor) => void;
    itemsRepository: ItemsRepository;
    editHistory: EditOperation[];
    setEditHistory: React.Dispatch<React.SetStateAction<EditOperation[]>>;
    showOnlyMyChanges: boolean;
    historyMode: "global" | "page-centric" | "current-version" | "timeline";
    refreshHistory: (mode?: "global" | "page-centric" | "current-version" | "timeline", filterBySession?: boolean) => Promise<void>;
    suggestedEdits: SuggestedEdit[];
    setSuggestedEdits: (suggestedEdits: SuggestedEdit[]) => void;
    mode: EditorMode;
    layoutMode: LayoutMode;
    setFocusFieldComponentId: (componentId: string) => void;
    setInsertMode: (insertMode: boolean) => void;
    getActiveSlotContext?: () => {
        fieldModificationStore: FieldModificationStore;
    } | undefined;
    getFieldModificationStoreForSlot?: (slotId: string) => FieldModificationStore | undefined;
    getActiveSlotId?: () => string | null;
}, ui: {
    showErrorToast: (error: {
        summary?: string;
        details?: string;
    }) => void;
    confirmationDialogRef: React.RefObject<ConfirmationDialogHandle | null>;
    onOperationExecuted: (op: EditOperation) => void;
}): {
    ops: {
        addComponent: (componentTypeId: string, placeholderKey: string, index: number, pageItem: ItemDescriptor) => Promise<AddComponentOperation | undefined>;
        ensureLock: (field: FieldDescriptor) => Promise<boolean>;
        lockItems: (items: ItemDescriptor[]) => Promise<void>;
        unlockItems: (items: ItemDescriptor[]) => Promise<void>;
        executeWorkflowCommand: (item: ItemDescriptor, commandId: string) => Promise<void>;
        editField: ({ field, value, rawValue, forceMode, refresh, originatingSlotId, }: {
            field: FieldDescriptor;
            value?: string;
            rawValue?: string | null;
            forceMode?: EditorMode;
            refresh?: "none" | "immediate" | "delayed" | "waitForQuietPeriod";
            originatingSlotId?: string;
        }) => Promise<void>;
        updateRenderingParameters: (componentId: string, parameters: Record<string, string | null>) => Promise<void>;
        updateRenderingRules: (componentId: string, rules: unknown) => Promise<void>;
        undo: (operationId?: string) => Promise<boolean>;
        undoOperations: (operationIds: string[]) => Promise<boolean>;
        redo: (operationId?: string) => Promise<boolean>;
        executeEditOperation: (op: EditOperation, options?: ExecuteEditOptions) => Promise<EditOperation>;
        renameItem: (item: ItemDescriptor, newName: string) => Promise<void>;
        deleteItems: (items: ItemDescriptor[], options?: {
            canUndo?: boolean;
            hardDelete?: boolean;
        }) => Promise<true | undefined>;
        createItem: (parent: ItemDescriptor, templateId: string, name: string) => Promise<ItemDescriptor | undefined>;
        createVersion: (item: ItemDescriptor) => Promise<void>;
        removeVersion: (item: ItemDescriptor) => Promise<void>;
        publishItem: (operation: PublishItemOperation) => Promise<PublishItemOperation>;
        duplicateComponents: ({ componentIds }: {
            componentIds: string[];
        }) => void;
        undoing: boolean;
        moveItems: (items: ItemDescriptor[], target: ItemDescriptor, index: number) => Promise<void>;
        copyItems: (items: ItemDescriptor[], target: ItemDescriptor, index: number) => Promise<ItemDescriptor[]>;
        cloneItems: (items: ItemDescriptor[], target: ItemDescriptor, index: number) => Promise<ItemDescriptor[]>;
        duplicateItem: (item: ItemDescriptor, target: ItemDescriptor, name: string) => Promise<ItemDescriptor | undefined>;
        onFieldBlur: () => void;
    };
    context: {
        editOperationExecuted: EditOperation | undefined;
        executingEditOperations: EditOperation[];
        markOperationComplete: (operationId: string) => void;
    };
    cleanup: () => void;
};
