UNPKG

@studiometa/js-toolkit

Version:

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

24 lines (23 loc) • 636 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 * @returns {Circle} Circle object that can be used in collides functions */ export declare function boundingRectToCircle({ x, y, width, height }: { x: any; y: any; width: any; height: any; }, force?: boolean): { x: any; y: any; radius: number; };