UNPKG

@nmmty/lazycanvas

Version:

A simple way to interact with @napi-rs/canvas in an advanced way!

52 lines (51 loc) 1.35 kB
import { AnyLayer, IGroup } from "../../types"; export declare class Group implements IGroup { id: string; visible: boolean; zIndex: number; components: Array<any>; constructor(); /** * Set the ID of the group * @param id {string} - The `id` of the group */ setID(id: string): this; /** * Set the visibility of the group * @param visible {boolean} - The `visibility` of the group */ setVisible(visible: boolean): this; /** * Set the zIndex of the group * @param zIndex {number} - The `zIndex` of the group */ setZIndex(zIndex: number): this; /** * Add a component to the group * @param components {any[]} - The `components` to add to the group */ add(...components: AnyLayer[]): this; /** * Remove a component from the group * @param id {any} - The `id` of the component to remove */ remove(id: string): this; /** * ClearLayer all components from the group */ clear(): this; /** * Get a component from the group * @param id {string} - The `id` of the component to get */ get(id: string): any; /** * Get all components from the group */ getAll(): any[]; /** * Get the length of the components */ get length(): number; toJSON(): IGroup; }