Files
terminal-lab/terminal/packages/terminal-core/src/layout/IMeasureAdapter.ts
douboer@gmail.com 3b7c1d558a first commit
2026-03-03 13:23:14 +08:00

15 lines
561 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* IMeasureAdapter — 平台测量接口(字符/容器尺寸获取)。
* Web 由 ResizeObserver + Canvas 实现;小程序由 wx.createSelectorQuery 实现。
*/
export interface IMeasureAdapter {
/** 测量单个等宽字符宽/高(像素)*/
measureChar(): { widthPx: number; heightPx: number };
/** 测量终端容器内部可用宽/高(已去除 padding像素*/
measureContainer(): { widthPx: number; heightPx: number };
/** 订阅容器尺寸变化;返回取消订阅函数 */
onResize(cb: () => void): () => void;
}