pencil.js
Version:
Nice modular interactive 2D drawing library.
44 lines (43 loc) • 1.32 kB
TypeScript
/**
* @module Line
*/
/**
* Line class
* <br><img src="./media/examples/line.png" alt="line demo"/>
* @class
* @extends Component
*/
export default class Line extends Component {
/**
* @inheritDoc
* @param {Object} definition -Line definition
* @return {Line}
*/
static from(definition: any): Line;
/**
* @typedef {Object} LineCaps
* @enum {String}
* @prop {String} butt - Caps cut straight at end points
* @prop {String} round - Round caps by adding a circle at end points, with a radius of lineWidth
* @prop {String} square - Square caps by adding a square at end points, with a size of lineWidth
*/
/**
* @type {LineCaps}
*/
static get caps(): any;
/**
* Line constructor
* @param {PositionDefinition} positionDefinition - First point
* @param {Array<PositionDefinition>} points - List of points
* @param {LineOptions} [options] - Drawing options
*/
constructor(positionDefinition: any, points: Array<any>, options?: LineOptions);
/**
* @type {Array<Position>}
*/
points: Array<Position>;
}
export type LineOptions = any;
export type LineCaps = any;
import Component from "@pencil.js/component";
import Position from "@pencil.js/position";