@nmmty/lazycanvas
Version:
A simple way to interact with @napi-rs/canvas in an advanced way!
40 lines (39 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Link = void 0;
const enum_1 = require("../../types/enum");
class Link {
source;
type;
additionalSpacing;
constructor(props) {
this.source = props?.source || '';
this.type = props?.type || enum_1.LinkType.Width;
this.additionalSpacing = props?.additionalSpacing || 0;
}
/**
* @description Sets the source of the link.
* @param source {string} - The `id` of the layer to link.
*/
setSource(source) {
this.source = source;
return this;
}
/**
* @description Sets the type of the link.
* @param type {AnyLinkType} - The `type` of the link.
*/
setType(type) {
this.type = type;
return this;
}
/**
* @description Sets the additional spacing of the link.
* @param additionalSpacing {ScaleType} - The `additionalSpacing` of the link.
*/
setSpacing(additionalSpacing) {
this.additionalSpacing = additionalSpacing;
return this;
}
}
exports.Link = Link;