Shumoku Docs

ドキュメントを検索

共通文書と現行公開版

検索を読み込み中…

English

@shumoku/core · 0.4.0 · function

resolveNodeSize

ソース

APIの説明は英語のcanonical sourceを表示しています。

Resolve a node's display size — returns the node's own `size` if set, otherwise asks the engine for its body size. Pass `engine` to share its TextMeasurer cache with other queries. Without one, a process-wide default engine is created lazily; this is fine for one-off helpers but not ideal for hot loops where explicit control matters.

resolveNodeSize(node: { label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec }, engine?: LayoutEngine): { height: number; width: number }

パラメーター

名前 説明 既定値
node { label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec } 追加説明はありません。
engine LayoutEngine 追加説明はありません。

戻り値

{ height: number; width: number }

libs/@shumoku/core/src/layout/engine/index.ts:85