/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { DragCancelEvent, DragEndEvent, DragMoveEvent, DragStartEvent } from '@dnd-kit/core';
import type { FlowModelRendererProps } from '@nocobase/flow-engine';
import { DragOverlayConfig, FlowModel, GridLayoutData, GridLayoutV2 } from '@nocobase/flow-engine';
import React from 'react';
export declare const GRID_FLOW_KEY = "gridSettings";
export declare const GRID_STEP = "grid";
interface DefaultStructure {
    parent?: FlowModel;
    subModels: {
        items: FlowModel[];
    };
}
export declare class GridModel<T extends {
    subModels: {
        items: FlowModel[];
    };
} = DefaultStructure> extends FlowModel<T> {
    subModelBaseClass: string;
    gridContainerRef: React.RefObject<HTMLDivElement>;
    prevMoveDistance: number;
    itemSettingsMenuLevel: number;
    itemFlowSettings: Exclude<FlowModelRendererProps['showFlowSettings'], boolean>;
    dragOverlayConfig?: DragOverlayConfig;
    itemFallback: React.JSX.Element;
    private readonly itemExtraToolbarItems;
    private dragState?;
    private _memoItemFlowSettings?;
    private updateDragPointerPosition;
    private handleDragScroll;
    private bindDragDocumentListeners;
    protected deriveRowOrder(rows: Record<string, string[][]>, provided?: string[]): string[];
    normalizeRowsWithOrder(rows: Record<string, string[][]>, provided?: string[]): {
        rows: Record<string, string[][]>;
        rowOrder: string[];
    };
    orderSizesByRowOrder(sizes: Record<string, number[]>, rowOrder: string[]): Record<string, number[]>;
    private getItemFlowSettings;
    getItemUids(): string[];
    protected normalizeLayoutFromSource(source?: Partial<GridLayoutData>): GridLayoutV2;
    getGridLayout(): GridLayoutV2;
    syncLayoutProps(layout: GridLayoutV2): void;
    setGridStepLayout(layout: GridLayoutV2): void;
    private findLayoutRowByPath;
    private collectCellItemsForResize;
    private buildResizedCells;
    private getResizeRowPath;
    private getResizeContainerWidth;
    private resizeGridLayout;
    onMount(): void;
    saveGridLayout(layout?: GridLayoutData | GridLayoutV2): void;
    mergeRowsWithItems(rows: Record<string, string[][]>): Record<string, string[][]>;
    resetRows(syncProps?: boolean): void;
    private computePointerPosition;
    private getDragContainer;
    private updateLayoutSnapshot;
    private scheduleSnapshotRefresh;
    private refreshPreviewFromPointer;
    /**
     * 根据 slot 类型、位置和配置计算最终的 overlay 尺寸和位置
     */
    private computeOverlayRect;
    private getHitTestSlot;
    private resolveDragSlot;
    private applyPreview;
    handleDragStart(event: DragStartEvent): void;
    handleDragMove(event: DragMoveEvent): void;
    private finishDrag;
    handleDragEnd(_event: DragEndEvent): void;
    handleDragCancel(_event: DragCancelEvent): void;
    renderAddSubModelButton(): JSX.Element;
    /**
     * 运行态按可见 block 过滤行/列，避免“整行都是 hidden block”但依然保留行间距占位。
     * - 配置态（flowSettingsEnabled）保持原始 rows/sizes 以便拖拽和布局编辑。
     * - 运行态仅在判断为“整列/整行都不可见”时做过滤，不写回 props/stepParams，布局元数据保持不变。
     */
    private getVisibleLayout;
    render(): React.JSX.Element;
}
/**
 * 将多列栅格 rows 转换为移动端单列 rows。
 * 遍历原 rows 的行与列顺序，把每个原列（过滤空白列后）变成一个新行（仅一列）。
 * 行 key 使用 uid() 生成，保持插入顺序即可。
 * @param rows 原始多列 rows
 * @returns 单列 rows
 */
export declare function transformRowsToSingleColumn(rows: Record<string, string[][]>, options?: {
    emptyColumnUid?: string;
}): Record<string, string[][]>;
export declare function recalculateGridSizes({ position, direction, resizeDistance, prevMoveDistance, oldSizes, oldRows, gridContainerWidth, gutter, columnCount, }: {
    position: {
        rowId: string;
        columnIndex: number;
        itemIndex: number;
    };
    direction: 'left' | 'right' | 'bottom' | 'corner';
    resizeDistance: number;
    prevMoveDistance: number;
    oldSizes: Record<string, number[]>;
    oldRows: Record<string, string[][]>;
    gridContainerWidth: number;
    gutter?: number;
    columnCount?: number;
}): {
    newRows: Record<string, string[][]>;
    newSizes: Record<string, number[]>;
    moveDistance: number;
};
export {};
