UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

25 lines (24 loc) • 719 B
/** * @typedef {Object} Circle * @property {number} x Circle's x position * @property {number} y Circle's y position * @property {number} radius Circle's radius */ /** * Convert clientRect to a formatted circle object * * @param {Partial<DOMRect>} domRect DOMRect of a square DOMElement * @param {boolean} force Force usage of non-square DOMElements * @return {Circle} Circle object that can be used in collides functions * @link https://js-toolkit.studiometa.dev/utils/collision/boundingRectToCircle.html */ export declare function boundingRectToCircle({ x, y, width, height }: { x: any; y: any; width: any; height: any; }, force?: boolean): { x: any; y: any; radius: number; };