UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

64 lines (63 loc) 1.52 kB
/** * Square class * <br><img src="./media/examples/square.png" alt="square demo"/> * @class * @extends {module:Rectangle} */ export default class Square { /** * @inheritDoc * @param {Object} definition - Square definition * @return {Square} */ static from(definition: any): Square; /** * Square constructor * @param {PositionDefinition} positionDefinition - Top-left corner * @param {Number} size - Side's length * @param {ComponentOptions} [options] - Drawing options */ constructor(positionDefinition: PositionDefinition, size: number, options?: ComponentOptions); /** * Set this square's size * @param {Number} size - New size */ set size(size: number); /** * Get this square's size * @return {Number} */ get size(): number; /** * Set width (also set height) * @param {Number} width - Any value for width (and height) */ set width(width: number); /** * Get width * @return {Number} */ get width(): number; /** * Set height (also set width) * @param {Number} height - Any value for height (and width) */ set height(height: number); /** * Get height * @return {Number} */ get height(): number; /** * @inheritDoc */ toJSON(): any; [widthKey]: number; [heightKey]: number; } /** * @module Square */ declare const widthKey: unique symbol; declare const heightKey: unique symbol; export {};