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>
74 lines (73 loc) • 2.26 kB
TypeScript
import { BaseLayer } from './BaseLayer';
import { GetSet } from './types';
/**
* Layer constructor. Layers are tied to their own canvas element and are used
* to contain groups or shapes.
* @constructor
* @memberof Konva
* @augments Konva.BaseLayer
* @param {Object} config
* @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want
* to clear the canvas before each layer draw. The default value is true.
* @@nodeParams
* @@containerParams
* @example
* var layer = new Konva.Layer();
* stage.add(layer);
* // now you can add shapes, groups into the layer
*/
export declare class Layer extends BaseLayer {
constructor(config: any);
_setCanvasSize(width: any, height: any): void;
_validateAdd(child: any): void;
/**
* get visible intersection shape. This is the preferred
* method for determining if a point intersects a shape or not
* also you may pass optional selector parametr to return ancestor of intersected shape
* @method
* @memberof Konva.Layer.prototype
* @param {Object} pos
* @param {Number} pos.x
* @param {Number} pos.y
* @param {String} [selector]
* @returns {Konva.Node}
* @example
* var shape = layer.getIntersection({x: 50, y: 50});
* // or if you interested in shape parent:
* var group = layer.getIntersection({x: 50, y: 50}, 'Group');
*/
getIntersection(pos: any, selector: any): any;
_getIntersection(pos: any): {
shape: any;
antialiased?: undefined;
} | {
antialiased: boolean;
shape?: undefined;
} | {
shape?: undefined;
antialiased?: undefined;
};
drawScene(can: any, top: any): this;
drawHit(can: any, top: any): this;
clear(bounds: any): this;
/**
* enable hit graph
* @name Konva.Layer#enableHitGraph
* @method
* @returns {Layer}
*/
enableHitGraph(): this;
/**
* disable hit graph
* @name Konva.Layer#disableHitGraph
* @method
* @memberof Konva.Layer.prototype
* @returns {Layer}
*/
disableHitGraph(): this;
setSize({ width, height }: {
width: any;
height: any;
}): this;
hitGraphEnabled: GetSet<boolean, this>;
}