source dump of claude code
at main 23 lines 419 B view raw
1import type { DOMElement } from './dom.js' 2 3type Output = { 4 /** 5 * Element width. 6 */ 7 width: number 8 9 /** 10 * Element height. 11 */ 12 height: number 13} 14 15/** 16 * Measure the dimensions of a particular `<Box>` element. 17 */ 18const measureElement = (node: DOMElement): Output => ({ 19 width: node.yogaNode?.getComputedWidth() ?? 0, 20 height: node.yogaNode?.getComputedHeight() ?? 0, 21}) 22 23export default measureElement