import type { MouseEvent, MutableRefObject } from 'react';
import { type PlacementBoundingBox } from '../utils/batchScenePlacementLayout';
import type { DataSourceFormColumn, FloorMapCanvasNameI18n, FloorMapDataSourceRecordFormContent, FloorMapDataSources, FloorMapItemBase, FloorMapMergedItem, FloorMapPlaceMode, FloorMapSceneElement, FloorMapViewConfig } from '../types';
export interface UseFloorMapEditStateParams<T extends FloorMapItemBase> {
    floorMapConfigProp: FloorMapViewConfig | undefined;
    isFloorMapView: boolean;
    itemsProp: T[];
    cellSizeProp?: number;
    dataSources: FloorMapDataSources | undefined;
    onSave: ((config: FloorMapViewConfig) => void) | undefined;
    onDataSourceRecordSave: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
    dataSourceFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
    dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
    dataSourceLabels?: Record<string, string>;
    layoutPrefix: string;
    contentOffsetRef: MutableRefObject<{
        x: number;
        y: number;
    }>;
    showDataSourceRecordFormBlock?: boolean;
    /** 批量落点后由布局层注入：将视口移至新增图元区域 */
    focusViewportOnBoundsRef?: MutableRefObject<((bounds: PlacementBoundingBox) => void) | null>;
    /**
     * 网格显隐缓存命名空间（通常与视口 `viewportPersistNamespace` 同源，拼自业务/门店/平面图）。
     * 传入后网格 localStorage key 变为 `prefix:namespace:canvasId`，隔离不同门店/场景；
     * 不传则沿用 `prefix:canvasId`（向后兼容，跨场景可能共享）。
     */
    gridPersistNamespace?: string;
}
export declare function useFloorMapEditState<T extends FloorMapItemBase>(params: UseFloorMapEditStateParams<T>): {
    config: FloorMapViewConfig | null;
    currentCanvasId: string | null;
    setCurrentCanvasId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
    selectedId: string | null;
    setSelectedId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
    placeMode: FloorMapPlaceMode;
    setPlaceMode: import("react").Dispatch<import("react").SetStateAction<FloorMapPlaceMode>>;
    mergedItems: FloorMapMergedItem[];
    items: T[];
    saving: boolean;
    savingRecord: boolean;
    handleAddCanvas: () => void;
    handleRemoveCanvas: (canvasId: string) => void;
    handleRenameCanvas: (canvasId: string, name: string | FloorMapCanvasNameI18n) => void;
    handleUpdateItem: (itemId: string, patch: Partial<{
        x: number;
        y: number;
        width: number;
        height: number;
    }>) => void;
    handleUpdateItemsBatch: (patches: Array<{
        id: string;
        patch: Partial<{
            x: number;
            y: number;
            width: number;
            height: number;
        }>;
    }>) => void;
    handleCanvasPlaceClick: (e: MouseEvent<HTMLDivElement>) => void;
    handleSave: () => void;
    discardDraft: () => void;
    placeSceneElementFromPaletteDrop: (contentX: number, contentY: number, scene: Extract<FloorMapPlaceMode, {
        type: 'scene';
    }>) => boolean;
    bulkPlacePaletteItems: (items: Array<{
        elementKind: string;
        builtinShapeKey?: string;
    }>) => void;
    editPanelParams: {
        itemId: string;
        sceneElement: FloorMapSceneElement;
        onUpdate: (patch: Partial<FloorMapSceneElement>) => void;
        onSaveRecord: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
        onClose: () => void;
        onDelete: (() => void) | undefined;
        recordFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
        dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
        dataSourceLabels: Record<string, string> | undefined;
        layoutDraftDirty: boolean;
        showDataSourceRecordFormBlock: boolean | undefined;
    } | null;
    placeOverlayClass: string;
    isLayoutDirty: boolean;
    toggleDraftCanvasShowGrid: () => void;
    toggleSelectedLayoutLock: () => void;
    duplicateSelectedElement: () => void;
    deleteSelectedElement: () => void;
    undoDraft: () => void;
    redoDraft: () => void;
    canUndo: boolean;
    canRedo: boolean;
    commitDraft: (next: FloorMapViewConfig | ((prev: FloorMapViewConfig | null) => FloorMapViewConfig | null) | null, options?: import("./useDraftConfigHistory").DraftHistoryCommitOptions | undefined) => void;
};
