/** * Box component */ export default class Box { /** * Creates a new Box instance. * @constructor * @param {Number} x1 * @param {Number} y1 * @param {Number} x2 * @param {Number} y2 */ x1: any; y1: any; x2: any; y2: any; constructor(x1: any, y1: any, x2: any, y2: any); /** * Sets the new dimensions of the box. * @param {Number} x1 * @param {Number} y1 * @param {Number} x2 * @param {Number} y2 */ set(x1?: null, y1?: null, x2?: null, y2?: null): this; /** * Calculates the width of the box. * @returns {Number} */ width(): number; /** * Calculates the height of the box. * @returns {Number} */ height(): number; /** * Resizes the box to a new size. * @param {Number} newWidth * @param {Number} newHeight * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ resize(newWidth: any, newHeight: any, origin?: number[]): this; /** * Scale the box by a factor. * @param {Number} factor * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ scale(factor: any, origin?: number[]): this; /** * Move the box to the specified coordinates. */ move(x?: null, y?: null): this; /** * Get relative x and y coordinates of a given point within the box. * @param {Array} point The x and y ratio position within the box. * @returns {Array} The x and y coordinates [x, y]. */ getRelativePoint(point?: number[]): number[]; /** * Get absolute x and y coordinates of a given point within the box. * @param {Array} point The x and y ratio position within the box. * @returns {Array} The x and y coordinates [x, y]. */ getAbsolutePoint(point?: number[]): any[]; /** * Constrain the box to a fixed ratio. * @param {Number} ratio * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). * @param {String} [grow] The axis to grow to maintain the ratio. * Defaults to 'height'. */ constrainToRatio(ratio: any, origin?: number[], grow?: string): this | undefined; /** * Constrain the box within a boundary. * @param {Number} boundaryWidth * @param {Number} boundaryHeight * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ constrainToBoundary(boundaryWidth: any, boundaryHeight: any, origin?: number[]): this; /** * Constrain the box to a maximum/minimum size. * @param {Number} [maxWidth] * @param {Number} [maxHeight] * @param {Number} [minWidth] * @param {Number} [minHeight] * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). * @param {Number} [ratio] Ratio to maintain. */ constrainToSize(maxWidth?: any, maxHeight?: any, minWidth?: any, minHeight?: any, origin?: number[], ratio?: any): this; }