Skip to content

Commit

Permalink
Add types and details in JSDoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende committed Dec 3, 2024
1 parent 5da995a commit 714ad14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/block-editor/src/components/iframe/use-scale-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,20 @@ function getAnimationKeyframes( transitionFrom, transitionTo ) {
];
}

/**
* @typedef {Object} ObservedSize
* @property {number|null} width The width of the observed element.
* @property {number|null} height The height of the observed element.
*/
/** @type {ObservedSize} */
const NULL_SIZE = { width: null, height: null };

/**
* Get the size of the observed element.
*
* @param {ResizeObserverEntry[]} entries Array of the new dimensions of the element after each change.
* @return {ObservedSize} Latest width and height of the observed element.
*/
function extractSize( entries ) {
const contentBlockSize = entries.at( -1 ).contentBoxSize[ 0 ];
return {
Expand Down

0 comments on commit 714ad14

Please sign in to comment.