Skip to content

Commit b48f02a

Browse files
committed
Add types and details in JSDoc comments
1 parent 3d848f1 commit b48f02a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/block-editor/src/components/iframe/use-scale-canvas.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,20 @@ function getAnimationKeyframes( transitionFrom, transitionTo ) {
120120
];
121121
}
122122

123+
/**
124+
* @typedef {Object} ObservedSize
125+
* @property {number|null} width The width of the observed element.
126+
* @property {number|null} height The height of the observed element.
127+
*/
128+
/** @type {ObservedSize} */
123129
const NULL_SIZE = { width: null, height: null };
124130

131+
/**
132+
* Get the size of the observed element.
133+
*
134+
* @param {ResizeObserverEntry[]} entries Array of the new dimensions of the element after each change.
135+
* @return {ObservedSize} Latest width and height of the observed element.
136+
*/
125137
function extractSize( entries ) {
126138
const contentBlockSize = entries.at( -1 ).contentBoxSize[ 0 ];
127139
return {

0 commit comments

Comments
 (0)