UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

53 lines (52 loc) 1.35 kB
/** * @module Checkbox */ /** * Checkbox class * <br><img src="./media/examples/checkbox.png" alt="checkbox demo"/> * @class * @extends Input */ export default class Checkbox extends Input { /** * Margin around the filling square in ratio * @type {Number} */ static get MARGIN(): number; /** * Checkbox constructor * @param {PositionDefinition} positionDefinition - Top-left corner * @param {CheckboxOptions} [options] - Specific options */ constructor(positionDefinition: any, options?: CheckboxOptions); fill: Square; /** * Set it's width * @param {Number} value - Width of the checkbox */ set width(arg: number); /** * Get it's width * @return {Number} */ get width(): number; /** * Set it's height * @param {Number} value - Height of the checkbox */ set height(arg: number); /** * Get it's height * @return {Number} */ get height(): number; /** * Inverse whether it's checked * @param {Boolean} [newValue] - If defined, will force the value * @return {Boolean} */ toggle(newValue?: boolean): boolean; } export type CheckboxOptions = any; import Input from "@pencil.js/input"; import Square from "@pencil.js/square";