UNPKG

konva

Version:

<p align="center"> <img src="https://raw.githubusercontent.com/konvajs/konvajs.github.io/master/apple-touch-icon-180x180.png" alt="Konva logo" height="180" /> </p>

45 lines (44 loc) 1.47 kB
import { Shape } from '../Shape'; import { GetSet } from '../types'; /** * Line constructor.&nbsp; Lines are defined by an array of points and * a tension * @constructor * @memberof Konva * @augments Konva.Shape * @param {Object} config * @param {Array} config.points Flat array of points coordinates. You should define them as [x1, y1, x2, y2, x3, y3]. * @param {Number} [config.tension] Higher values will result in a more curvy line. A value of 0 will result in no interpolation. * The default is 0 * @param {Boolean} [config.closed] defines whether or not the line shape is closed, creating a polygon or blob * @param {Boolean} [config.bezier] if no tension is provided but bezier=true, we draw the line as a bezier using the passed points * @@shapeParams * @@nodeParams * @example * var line = new Konva.Line({ * x: 100, * y: 50, * points: [73, 70, 340, 23, 450, 60, 500, 20], * stroke: 'red', * tension: 1 * }); */ export declare class Line extends Shape { constructor(config: any); _sceneFunc(context: any): void; getTensionPoints(): any; _getTensionPoints(): any[]; _getTensionPointsClosed(): any[]; getWidth(): number; getHeight(): number; getSelfRect(): { x: number; y: number; width: number; height: number; }; closed: GetSet<boolean, this>; bezier: GetSet<boolean, this>; tension: GetSet<number, this>; points: GetSet<number[], this>; }