import { ModelNode } from '../model/base';
import { Doc } from '../view/Doc';
import { ImageSize } from '../../base/utils/image-size-util';
import { WrField } from '../model/document/WrField';
import { Wtc } from '../model/document/Wtc';
import { Wr } from '../model/document/Wp';
import { WrText } from '../model/document/WrText';
import { WidgetMeta } from '../widget/widget-meta';
export declare const ADAPTIVE_IMAGE_CELL_MSG = "\u8BE5\u5355\u5143\u683C\u4E3A\u81EA\u9002\u5E94\u56FE\u7247\u5B57\u6BB5\uFF0C\u4E0D\u53EF\u6DFB\u52A0\u5176\u4ED6\u5185\u5BB9";
export declare const ADAPTIVE_IMAGE_SWITCH_MSG = "\u5207\u6362\u4E3A\u81EA\u9002\u5E94\u524D\uFF0C\u8BF7\u5148\u6E05\u7A7A\u5355\u5143\u683C\u5185\u5176\u4ED6\u5185\u5BB9\uFF0C\u4E14\u5355\u5143\u683C\u5185\u4EC5\u4FDD\u7559\u8BE5\u56FE\u7247\u5B57\u6BB5";
export type AdaptiveImageComputedValue = {
    relWidth: number;
    relHeight: number;
};
/** 是否为自适应模式的图片字段 */
export declare function isAdaptiveImageWidgetMeta(widgetMeta?: WidgetMeta | null): boolean;
/** 是否为无实际内容的文本 run（占位符或空文本） */
export declare function isEmptyTextRun(run: WrText): boolean;
/** 从模型节点向上查找所在单元格 */
export declare function getAncestorCell(node: ModelNode): Wtc | null;
/** 获取单元格内所有 run */
export declare function getCellRuns(cell: Wtc): Wr[];
/** 获取单元格内有实际内容的 run */
export declare function getNonEmptyCellRuns(cell: Wtc): Wr[];
/** 获取单元格内的自适应图片字段 */
export declare function getAdaptiveImageFieldInCell(cell: Wtc): WrField | null;
/** 单元格是否已被自适应图片字段锁定（禁止插入其他内容） */
export declare function isCellLockedByAdaptiveImage(cell: Wtc | null): boolean;
/** 单元格是否仅包含一个图片字段（用于切换为自适应前的校验） */
export declare function canSwitchImageFieldToAdaptive(cell: Wtc | null, fieldRunId?: string): boolean;
/** 单元格是否仅包含自适应图片字段 */
export declare function cellHasOnlyAdaptiveImageField(cell: Wtc): boolean;
/** 与 FieldImageHandler / 渲染层约定的 newSpecificConfig 键 */
export declare function getAdaptiveImageConfigKey(modelRef: {
    id: string;
    start?: number;
}): string;
/** 从布局节点向上查找所在单元格的内容区尺寸 */
export declare function getCellContentSizeFromWidget(doc: Doc, widgetId: string): ImageSize | null;
/** 自适应模式下铺满单元格内容区 */
export declare function computeAdaptiveImageSize(cellSize: ImageSize): ImageSize;
/** 读取渲染阶段写入的自适应尺寸 */
export declare function getAdaptiveImageComputedSize(widgetMeta: {
    props?: {
        newSpecificConfig?: Record<string, AdaptiveImageComputedValue>;
    };
} | null | undefined, configKey: string, fallback?: ImageSize): ImageSize | undefined;
