/** * 平面图/布局内容区尺寸计算:格子与像素单位、gap 解析、包围盒 */ import type { FloorMapItemBase, FloorMapItemUnit } from '../types'; /** 默认每格像素 */ export declare const DEFAULT_CELL_SIZE = 64; /** 默认 item 间距(像素) */ export declare const DEFAULT_ITEM_GAP = 8; /** * 将 mapLayer.gap 解析为像素数 */ export declare function gapToPx(gap: number | string | undefined): number; /** * 根据 items 计算内容区像素宽高 * - cell:按格子数 + cellSize + itemGap 计算 * - pixel:按 item 的 x/y/width/height 像素取边界(仅右/下边界,用于非 floor map 或兼容) */ export declare function getContentSize(items: T[], cellSize: number, itemGap: number, itemUnit: FloorMapItemUnit): { contentWidth: number; contentHeight: number; }; /** * pixel 模式下取 items 包围盒(含左/上),用于画布四周扩 padding 时的尺寸与偏移 */ export declare function getPixelBoundingBox(items: T[], cellSize: number): { minLeft: number; minTop: number; maxRight: number; maxBottom: number; } | null;