UNPKG

@nmmty/lazycanvas

Version:

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

67 lines (66 loc) 1.85 kB
import { AnyLinkType, ScaleType } from "../../types"; /** * Interface representing a link between layers. */ export interface ILink { /** * The source layers ID. */ source: string; /** * The type of the link (e.g., width, height, etc.). */ type: AnyLinkType; /** * The additional spacing applied to the link. */ additionalSpacing: ScaleType; } /** * Class representing a link between layers with properties and methods to manipulate it. */ export declare class Link { /** * The source layers ID. */ source: string; /** * The type of the link (e.g., width, height, etc.). */ type: AnyLinkType; /** * The additional spacing applied to the link. */ additionalSpacing: ScaleType; /** * Constructs a new Link instance. * @param opts {Object} - Optional properties for the link. * @param opts.props {ILink} - The link properties. */ constructor(opts?: { props?: ILink; }); /** * Sets the source of the link. * @param source {string} - The ID of the layer to link. * @returns {this} The current instance for chaining. */ setSource(source: string): this; /** * Sets the type of the link. * @param type {AnyLinkType} - The type of the link. * @returns {this} The current instance for chaining. */ setType(type: AnyLinkType): this; /** * Sets the additional spacing of the link. * @param additionalSpacing {ScaleType} - The additional spacing of the link. * @returns {this} The current instance for chaining. */ setSpacing(additionalSpacing: ScaleType): this; /** * Converts the Link instance to a JSON representation. * @returns {ILink} The JSON representation of the link. */ toJSON(): ILink; }