@nmmty/lazycanvas
Version:
A simple way to interact with @napi-rs/canvas in an advanced way!
40 lines (39 loc) • 1.5 kB
TypeScript
import { IClearLayer, IClearLayerProps, ScaleType } from "../../types";
import { LayerType } from "../../types/enum";
import { Canvas, SKRSContext2D } from "@napi-rs/canvas";
import { LayersManager } from "../managers/LayersManager";
export declare class ClearLayer implements IClearLayer {
id: string;
type: LayerType;
zIndex: number;
visible: boolean;
props: IClearLayerProps;
constructor(props?: IClearLayerProps);
/**
* @description Position of the layer in the 2D plane. You can use `numbers`, `percentages`, `px`, `vw`, `vh`, `vmin`, `vmax`.
* @param x {ScaleType} - The `x` position of the layer
* @param y {ScaleType} - The `y` position of the layer
*/
setPosition(x: ScaleType, y: ScaleType): this;
/**
* @description Sets the size of the layer.
* @param width {ScaleType} - The `width` of the layer
* @param height {ScaleType} - The `height` of the
*/
setSize(width: ScaleType, height: ScaleType): this;
/**
* @description Sets the visibility of the layer.
* @param visible {boolean} - The `visibility` of the layer
*/
setVisible(visible: boolean): this;
/**
* @description Sets zIndex of the layer.
* @param zIndex {number} - The `zIndex` of the layer
*/
setZIndex(zIndex: number): this;
draw(ctx: SKRSContext2D, canvas: Canvas, manager: LayersManager, debug: boolean): Promise<void>;
/**
* @returns {IClearLayer}
*/
toJSON(): IClearLayer;
}