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>
98 lines (97 loc) • 2.72 kB
TypeScript
import { Container } from './Container';
import { SceneCanvas, HitCanvas } from './Canvas';
import { GetSet } from './types';
/**
* BaseLayer constructor.
* @constructor
* @memberof Konva
* @augments Konva.Container
* @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
*/
export declare abstract class BaseLayer extends Container {
canvas: SceneCanvas;
hitCanvas: HitCanvas;
constructor(config: any);
createPNGStream(): any;
/**
* get layer canvas wrapper
* @method
* @name Konva.BaseLayer#getCanvas
*/
getCanvas(): SceneCanvas;
/**
* get layer hit canvas
* @method
* @name Konva.BaseLayer#getHitCanvas
*/
getHitCanvas(): HitCanvas;
/**
* get layer canvas context
* @method
* @name Konva.BaseLayer#getContext
*/
getContext(): import("./Context").Context;
/**
* clear scene and hit canvas contexts tied to the layer
* @method
* @name Konva.BaseLayer#clear
* @param {Object} [bounds]
* @param {Number} [bounds.x]
* @param {Number} [bounds.y]
* @param {Number} [bounds.width]
* @param {Number} [bounds.height]
* @example
* layer.clear();
* layer.clear({
* x : 0,
* y : 0,
* width : 100,
* height : 100
* });
*/
clear(bounds?: any): this;
setZIndex(index: any): this;
moveToTop(): boolean;
moveUp(): boolean;
moveDown(): boolean;
moveToBottom(): boolean;
getLayer(): this;
remove(): this;
getStage(): any;
setSize({ width, height }: {
width: any;
height: any;
}): this;
_toKonvaCanvas(config: any): any;
_checkVisibility(): void;
/**
* get/set width of layer.getter return width of stage. setter doing nothing.
* if you want change width use `stage.width(value);`
* @name Konva.BaseLayer#width
* @method
* @returns {Number}
* @example
* var width = layer.width();
*/
getWidth(): number;
setWidth(): void;
/**
* get/set height of layer.getter return height of stage. setter doing nothing.
* if you want change height use `stage.height(value);`
* @name Konva.BaseLayer#height
* @method
* @returns {Number}
* @example
* var height = layer.height();
*/
getHeight(): number;
setHeight(): void;
getIntersection(pos: any, selector?: any): any;
_applyTransform(shape: any, context: any, top: any): void;
clearBeforeDraw: GetSet<boolean, this>;
batchDraw: () => void;
}