@nmmty/lazycanvas 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/helpers/index.d.ts +3 -0
  2. package/dist/helpers/index.js +19 -0
  3. package/dist/index.d.ts +5 -12
  4. package/dist/index.js +5 -31
  5. package/dist/structures/LazyCanvas.d.ts +12 -16
  6. package/dist/structures/LazyCanvas.js +24 -27
  7. package/dist/structures/components/BaseLayer.d.ts +16 -16
  8. package/dist/structures/components/BaseLayer.js +16 -16
  9. package/dist/structures/components/BezierLayer.d.ts +21 -21
  10. package/dist/structures/components/BezierLayer.js +20 -20
  11. package/dist/structures/components/ClearLayer.d.ts +15 -15
  12. package/dist/structures/components/ClearLayer.js +14 -14
  13. package/dist/structures/components/Group.d.ts +10 -11
  14. package/dist/structures/components/Group.js +9 -10
  15. package/dist/structures/components/ImageLayer.d.ts +12 -12
  16. package/dist/structures/components/ImageLayer.js +11 -11
  17. package/dist/structures/components/LineLayer.d.ts +20 -20
  18. package/dist/structures/components/LineLayer.js +19 -19
  19. package/dist/structures/components/MorphLayer.d.ts +18 -18
  20. package/dist/structures/components/MorphLayer.js +17 -17
  21. package/dist/structures/components/Path2DLayer.d.ts +4 -72
  22. package/dist/structures/components/Path2DLayer.js +2 -108
  23. package/dist/structures/components/QuadraticLayer.d.ts +22 -22
  24. package/dist/structures/components/QuadraticLayer.js +21 -21
  25. package/dist/structures/components/TextLayer.d.ts +37 -37
  26. package/dist/structures/components/TextLayer.js +36 -36
  27. package/dist/structures/helpers/Exporter.d.ts +9 -9
  28. package/dist/structures/helpers/Exporter.js +9 -9
  29. package/dist/structures/helpers/Font.d.ts +4 -4
  30. package/dist/structures/helpers/Font.js +4 -4
  31. package/dist/structures/helpers/Gradient.d.ts +15 -10
  32. package/dist/structures/helpers/Gradient.js +14 -9
  33. package/dist/structures/helpers/Link.d.ts +5 -5
  34. package/dist/structures/helpers/Link.js +5 -5
  35. package/dist/structures/helpers/Pattern.d.ts +5 -5
  36. package/dist/structures/helpers/Pattern.js +5 -5
  37. package/dist/structures/helpers/index.d.ts +7 -7
  38. package/dist/structures/helpers/readers/JSONReader.d.ts +12 -12
  39. package/dist/structures/helpers/readers/JSONReader.js +12 -12
  40. package/dist/structures/helpers/readers/YAMLReader.d.ts +4 -4
  41. package/dist/structures/helpers/readers/YAMLReader.js +4 -4
  42. package/dist/structures/managers/AnimationManager.d.ts +11 -11
  43. package/dist/structures/managers/AnimationManager.js +11 -11
  44. package/dist/structures/managers/FontsManager.d.ts +14 -15
  45. package/dist/structures/managers/FontsManager.js +14 -15
  46. package/dist/structures/managers/LayersManager.d.ts +15 -15
  47. package/dist/structures/managers/LayersManager.js +19 -19
  48. package/dist/structures/managers/PluginManager.d.ts +11 -9
  49. package/dist/structures/managers/PluginManager.js +9 -8
  50. package/dist/structures/managers/RenderManager.d.ts +10 -10
  51. package/dist/structures/managers/RenderManager.js +10 -10
  52. package/dist/structures/managers/index.d.ts +5 -0
  53. package/dist/structures/managers/index.js +21 -0
  54. package/dist/types/index.d.ts +0 -1
  55. package/dist/types/index.js +0 -1
  56. package/dist/utils/utils.d.ts +1 -1
  57. package/package.json +59 -60
@@ -0,0 +1,3 @@
1
+ export * from './Utlis';
2
+ export * from './Filters';
3
+ export * from './FontsList';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Utlis"), exports);
18
+ __exportStar(require("./Filters"), exports);
19
+ __exportStar(require("./FontsList"), exports);
package/dist/index.d.ts CHANGED
@@ -1,13 +1,6 @@
1
- export { LazyCanvas, ILazyCanvas, ILazyCanvasOptions, IOLazyCanvas, } from "./structures/LazyCanvas";
2
- export { IFontsManager } from "./structures/managers/FontsManager";
3
- export { IAnimationManager, IAnimationOptions } from "./structures/managers/AnimationManager";
4
- export { IRenderManager } from "./structures/managers/RenderManager";
5
- export { ILayersManager } from "./structures/managers/LayersManager";
6
- export { IPluginManager, ILazyCanvasPlugin, IPluginHooks } from "./structures/managers/PluginManager";
1
+ export * from "./structures/LazyCanvas";
2
+ export * from "./structures/managers";
7
3
  export * from "./structures/components";
8
- export { LayerType, LayerScaleType, LineCap, LineJoin, TextAlign, TextDirection, TextBaseline, FontWeight, Export, Centring, PatternType, GradientType, LinkType } from "./types";
9
- export { Font, IFont, IFonts, Gradient, IGradient, GradientPoint, GradientColorStop, Pattern, IPattern, Link, ILink, Exporter, JSONReader, YAMLReader } from "./structures/helpers";
10
- export { Filters } from "./helpers/Filters";
11
- export { FontsList } from "./helpers/FontsList";
12
- export type { AnyLayer, AnyCentring, AnyPatternType, AnyGradientType, AnyTextAlign, AnyTextDirection, AnyTextBaseline, AnyWeight, AnyLineCap, AnyLineJoin, AnyExport, AnyLinkType, AnyGlobalCompositeOperation, AnyColorSpace, ScaleType, ColorType, Point, PointNumber, Transform, Extensions } from "./types";
13
- export { Utils } from "./helpers/Utlis";
4
+ export * from "./types";
5
+ export * from "./structures/helpers";
6
+ export * from "./helpers";
package/dist/index.js CHANGED
@@ -14,35 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Utils = exports.FontsList = exports.Filters = exports.YAMLReader = exports.JSONReader = exports.Exporter = exports.Link = exports.Pattern = exports.Gradient = exports.Font = exports.LinkType = exports.GradientType = exports.PatternType = exports.Centring = exports.Export = exports.FontWeight = exports.TextBaseline = exports.TextDirection = exports.TextAlign = exports.LineJoin = exports.LineCap = exports.LayerScaleType = exports.LayerType = exports.LazyCanvas = void 0;
18
- var LazyCanvas_1 = require("./structures/LazyCanvas");
19
- Object.defineProperty(exports, "LazyCanvas", { enumerable: true, get: function () { return LazyCanvas_1.LazyCanvas; } });
17
+ __exportStar(require("./structures/LazyCanvas"), exports);
18
+ __exportStar(require("./structures/managers"), exports);
20
19
  __exportStar(require("./structures/components"), exports);
21
- var types_1 = require("./types");
22
- Object.defineProperty(exports, "LayerType", { enumerable: true, get: function () { return types_1.LayerType; } });
23
- Object.defineProperty(exports, "LayerScaleType", { enumerable: true, get: function () { return types_1.LayerScaleType; } });
24
- Object.defineProperty(exports, "LineCap", { enumerable: true, get: function () { return types_1.LineCap; } });
25
- Object.defineProperty(exports, "LineJoin", { enumerable: true, get: function () { return types_1.LineJoin; } });
26
- Object.defineProperty(exports, "TextAlign", { enumerable: true, get: function () { return types_1.TextAlign; } });
27
- Object.defineProperty(exports, "TextDirection", { enumerable: true, get: function () { return types_1.TextDirection; } });
28
- Object.defineProperty(exports, "TextBaseline", { enumerable: true, get: function () { return types_1.TextBaseline; } });
29
- Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return types_1.FontWeight; } });
30
- Object.defineProperty(exports, "Export", { enumerable: true, get: function () { return types_1.Export; } });
31
- Object.defineProperty(exports, "Centring", { enumerable: true, get: function () { return types_1.Centring; } });
32
- Object.defineProperty(exports, "PatternType", { enumerable: true, get: function () { return types_1.PatternType; } });
33
- Object.defineProperty(exports, "GradientType", { enumerable: true, get: function () { return types_1.GradientType; } });
34
- Object.defineProperty(exports, "LinkType", { enumerable: true, get: function () { return types_1.LinkType; } });
35
- var helpers_1 = require("./structures/helpers");
36
- Object.defineProperty(exports, "Font", { enumerable: true, get: function () { return helpers_1.Font; } });
37
- Object.defineProperty(exports, "Gradient", { enumerable: true, get: function () { return helpers_1.Gradient; } });
38
- Object.defineProperty(exports, "Pattern", { enumerable: true, get: function () { return helpers_1.Pattern; } });
39
- Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return helpers_1.Link; } });
40
- Object.defineProperty(exports, "Exporter", { enumerable: true, get: function () { return helpers_1.Exporter; } });
41
- Object.defineProperty(exports, "JSONReader", { enumerable: true, get: function () { return helpers_1.JSONReader; } });
42
- Object.defineProperty(exports, "YAMLReader", { enumerable: true, get: function () { return helpers_1.YAMLReader; } });
43
- var Filters_1 = require("./helpers/Filters");
44
- Object.defineProperty(exports, "Filters", { enumerable: true, get: function () { return Filters_1.Filters; } });
45
- var FontsList_1 = require("./helpers/FontsList");
46
- Object.defineProperty(exports, "FontsList", { enumerable: true, get: function () { return FontsList_1.FontsList; } });
47
- var Utlis_1 = require("./helpers/Utlis");
48
- Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return Utlis_1.Utils; } });
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./structures/helpers"), exports);
22
+ __exportStar(require("./helpers"), exports);
@@ -1,10 +1,6 @@
1
1
  import { AnyExport, JSONLayer } from "../types";
2
2
  import { Canvas, SKRSContext2D, SvgCanvas, SvgExportFlag } from "@napi-rs/canvas";
3
- import { LayersManager } from "./managers/LayersManager";
4
- import { RenderManager } from "./managers/RenderManager";
5
- import { FontsManager } from "./managers/FontsManager";
6
- import { AnimationManager, IAnimationOptions } from "./managers/AnimationManager";
7
- import { PluginManager, ILazyCanvasPlugin } from "./managers/PluginManager";
3
+ import { LayersManager, RenderManager, FontsManager, AnimationManager, IAnimationOptions, PluginManager, ILazyCanvasPlugin } from "./managers";
8
4
  import { Group } from "./components";
9
5
  /**
10
6
  * Interface representing the LazyCanvas structure.
@@ -104,9 +100,9 @@ export declare class LazyCanvas implements ILazyCanvas {
104
100
  options: ILazyCanvasOptions;
105
101
  /**
106
102
  * Constructs a new LazyCanvas instance.
107
- * @param opts {Object} - Optional settings for the LazyCanvas instance.
108
- * @param opts.debug {boolean} - Whether debugging is enabled.
109
- * @param opts.settings {IOLazyCanvas} - The input settings for the LazyCanvas instance.
103
+ * @param {Object} [opts] - Optional settings for the LazyCanvas instance.
104
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
105
+ * @param {IOLazyCanvas} [opts.settings] - The input settings for the LazyCanvas instance.
110
106
  */
111
107
  constructor(opts?: {
112
108
  debug?: boolean;
@@ -114,13 +110,13 @@ export declare class LazyCanvas implements ILazyCanvas {
114
110
  });
115
111
  /**
116
112
  * Sets the export type for the canvas.
117
- * @param type {AnyExport} - The export type (e.g., buffer, SVG, etc.).
113
+ * @param {AnyExport} [type] - The export type (e.g., buffer, SVG, etc.).
118
114
  * @returns {this} The current instance for chaining.
119
115
  */
120
116
  setExportType(type: AnyExport): this;
121
117
  /**
122
118
  * Sets the SVG export flag. This method should be called after `setExportType`.
123
- * @param flag {SvgExportFlag} - The SVG export flag.
119
+ * @param {SvgExportFlag} [flag] - The SVG export flag.
124
120
  * @returns {this} The current instance for chaining.
125
121
  */
126
122
  setSvgExportFlag(flag: SvgExportFlag): this;
@@ -131,32 +127,32 @@ export declare class LazyCanvas implements ILazyCanvas {
131
127
  animated(): this;
132
128
  /**
133
129
  * Resizes the canvas to the specified dimensions.
134
- * @param ratio {number} - The ratio to resize the canvas.
130
+ * @param {number} [ratio] - The ratio to resize the canvas.
135
131
  * @returns {this} The current instance for chaining.
136
132
  */
137
133
  resize(ratio: number): this;
138
134
  /**
139
135
  * Creates a new canvas with the specified dimensions.
140
- * @param width {number} - The width of the canvas.
141
- * @param height {number} - The height of the canvas.
136
+ * @param {number} [width] - The width of the canvas.
137
+ * @param {number} [height] - The height of the canvas.
142
138
  * @returns {this} The current instance for chaining.
143
139
  */
144
140
  create(width: number, height: number): this;
145
141
  /**
146
142
  * Installs a plugin to the canvas.
147
- * @param plugin {ILazyCanvasPlugin} - The plugin to install.
143
+ * @param {ILazyCanvasPlugin} [plugin] - The plugin to install.
148
144
  * @returns {this} The current instance for chaining.
149
145
  */
150
146
  use(plugin: ILazyCanvasPlugin): this;
151
147
  /**
152
148
  * Removes a plugin from the canvas.
153
- * @param pluginName {string} - The name of the plugin to remove.
149
+ * @param {string} [pluginName] - The name of the plugin to remove.
154
150
  * @returns {this} The current instance for chaining.
155
151
  */
156
152
  removePlugin(pluginName: string): this;
157
153
  /**
158
154
  * Gets a plugin by name.
159
- * @param pluginName {string} - The name of the plugin.
155
+ * @param {string} [pluginName] - The name of the plugin.
160
156
  * @returns {ILazyCanvasPlugin | undefined} The plugin or undefined if not found.
161
157
  */
162
158
  getPlugin(pluginName: string): ILazyCanvasPlugin | undefined;
@@ -3,11 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LazyCanvas = void 0;
4
4
  const types_1 = require("../types");
5
5
  const canvas_1 = require("@napi-rs/canvas");
6
- const LayersManager_1 = require("./managers/LayersManager");
7
- const RenderManager_1 = require("./managers/RenderManager");
8
- const FontsManager_1 = require("./managers/FontsManager");
9
- const AnimationManager_1 = require("./managers/AnimationManager");
10
- const PluginManager_1 = require("./managers/PluginManager");
6
+ const managers_1 = require("./managers");
11
7
  const LazyUtil_1 = require("../utils/LazyUtil");
12
8
  const utils_1 = require("../utils/utils");
13
9
  /**
@@ -33,33 +29,34 @@ class LazyCanvas {
33
29
  options;
34
30
  /**
35
31
  * Constructs a new LazyCanvas instance.
36
- * @param opts {Object} - Optional settings for the LazyCanvas instance.
37
- * @param opts.debug {boolean} - Whether debugging is enabled.
38
- * @param opts.settings {IOLazyCanvas} - The input settings for the LazyCanvas instance.
32
+ * @param {Object} [opts] - Optional settings for the LazyCanvas instance.
33
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
34
+ * @param {IOLazyCanvas} [opts.settings] - The input settings for the LazyCanvas instance.
39
35
  */
40
36
  constructor(opts) {
41
37
  this.canvas = new canvas_1.Canvas(0, 0);
42
38
  this.ctx = this.canvas.getContext('2d');
43
39
  this.manager = {
44
- layers: new LayersManager_1.LayersManager(this, { debug: opts?.debug }),
45
- render: new RenderManager_1.RenderManager(this, { debug: opts?.debug }),
46
- fonts: new FontsManager_1.FontsManager({ debug: opts?.debug }),
47
- animation: new AnimationManager_1.AnimationManager({ debug: opts?.debug, settings: { options: opts?.settings?.animation } }),
48
- plugins: new PluginManager_1.PluginManager(this, { debug: opts?.debug })
40
+ layers: new managers_1.LayersManager(this, { debug: opts?.debug }),
41
+ render: new managers_1.RenderManager(this, { debug: opts?.debug }),
42
+ fonts: new managers_1.FontsManager({ debug: opts?.debug }),
43
+ animation: new managers_1.AnimationManager({ debug: opts?.debug, settings: { options: opts?.settings?.animation } }),
44
+ plugins: new managers_1.PluginManager(this, { debug: opts?.debug })
49
45
  };
50
46
  this.options = {
51
- width: opts?.settings?.options.width || 0,
52
- height: opts?.settings?.options.height || 0,
53
- animated: opts?.settings?.options.animated || false,
54
- exportType: opts?.settings?.options.exportType || types_1.Export.BUFFER,
55
- flag: opts?.settings?.options.flag || canvas_1.SvgExportFlag.RelativePathEncoding
47
+ width: 0,
48
+ height: 0,
49
+ animated: false,
50
+ exportType: types_1.Export.BUFFER,
51
+ flag: canvas_1.SvgExportFlag.RelativePathEncoding,
52
+ ...opts?.settings?.options
56
53
  };
57
54
  if (opts?.debug)
58
55
  LazyUtil_1.LazyLog.log('info', 'LazyCanvas initialized with settings:', opts.settings);
59
56
  }
60
57
  /**
61
58
  * Sets the export type for the canvas.
62
- * @param type {AnyExport} - The export type (e.g., buffer, SVG, etc.).
59
+ * @param {AnyExport} [type] - The export type (e.g., buffer, SVG, etc.).
63
60
  * @returns {this} The current instance for chaining.
64
61
  */
65
62
  setExportType(type) {
@@ -80,7 +77,7 @@ class LazyCanvas {
80
77
  }
81
78
  /**
82
79
  * Sets the SVG export flag. This method should be called after `setExportType`.
83
- * @param flag {SvgExportFlag} - The SVG export flag.
80
+ * @param {SvgExportFlag} [flag] - The SVG export flag.
84
81
  * @returns {this} The current instance for chaining.
85
82
  */
86
83
  setSvgExportFlag(flag) {
@@ -101,7 +98,7 @@ class LazyCanvas {
101
98
  }
102
99
  /**
103
100
  * Resizes the canvas to the specified dimensions.
104
- * @param ratio {number} - The ratio to resize the canvas.
101
+ * @param {number} [ratio] - The ratio to resize the canvas.
105
102
  * @returns {this} The current instance for chaining.
106
103
  */
107
104
  resize(ratio) {
@@ -125,8 +122,8 @@ class LazyCanvas {
125
122
  }
126
123
  /**
127
124
  * Creates a new canvas with the specified dimensions.
128
- * @param width {number} - The width of the canvas.
129
- * @param height {number} - The height of the canvas.
125
+ * @param {number} [width] - The width of the canvas.
126
+ * @param {number} [height] - The height of the canvas.
130
127
  * @returns {this} The current instance for chaining.
131
128
  */
132
129
  create(width, height) {
@@ -139,14 +136,14 @@ class LazyCanvas {
139
136
  this.canvas = new canvas_1.Canvas(width, height);
140
137
  }
141
138
  this.ctx = this.canvas.getContext('2d');
142
- this.manager.layers = new LayersManager_1.LayersManager(this, { debug: this.manager.layers.debug });
139
+ this.manager.layers = new managers_1.LayersManager(this, { debug: this.manager.layers.debug });
143
140
  // Выполняем хук onCanvasCreated для всех плагинов
144
141
  this.manager.plugins.executeHook('onCanvasCreated', this, width, height);
145
142
  return this;
146
143
  }
147
144
  /**
148
145
  * Installs a plugin to the canvas.
149
- * @param plugin {ILazyCanvasPlugin} - The plugin to install.
146
+ * @param {ILazyCanvasPlugin} [plugin] - The plugin to install.
150
147
  * @returns {this} The current instance for chaining.
151
148
  */
152
149
  use(plugin) {
@@ -155,7 +152,7 @@ class LazyCanvas {
155
152
  }
156
153
  /**
157
154
  * Removes a plugin from the canvas.
158
- * @param pluginName {string} - The name of the plugin to remove.
155
+ * @param {string} [pluginName] - The name of the plugin to remove.
159
156
  * @returns {this} The current instance for chaining.
160
157
  */
161
158
  removePlugin(pluginName) {
@@ -164,7 +161,7 @@ class LazyCanvas {
164
161
  }
165
162
  /**
166
163
  * Gets a plugin by name.
167
- * @param pluginName {string} - The name of the plugin.
164
+ * @param {string} [pluginName] - The name of the plugin.
168
165
  * @returns {ILazyCanvasPlugin | undefined} The plugin or undefined if not found.
169
166
  */
170
167
  getPlugin(pluginName) {
@@ -144,27 +144,27 @@ export declare class BaseLayer<T extends IBaseLayerProps> {
144
144
  constructor(type?: LayerType, props?: T, misc?: IBaseLayerMisc);
145
145
  /**
146
146
  * Sets the position of the layer in the 2D plane.
147
- * @param {ScaleType} x - The x-coordinate of the layer.
148
- * @param {ScaleType} y - The y-coordinate of the layer.
147
+ * @param {ScaleType} [x] - The x-coordinate of the layer.
148
+ * @param {ScaleType} [y] - The y-coordinate of the layer.
149
149
  * @returns {this} The current instance for chaining.
150
150
  */
151
151
  setPosition(x: ScaleType, y: ScaleType): this;
152
152
  /**
153
153
  * Sets the opacity of the layer.
154
- * @param {number} opacity - The opacity value, between 0 and 1.
154
+ * @param {number} [opacity] - The opacity value, between 0 and 1.
155
155
  * @returns {this} The current instance for chaining.
156
156
  */
157
157
  setOpacity(opacity: number): this;
158
158
  /**
159
159
  * Sets the unique identifier of the layer.
160
160
  *
161
- * @param {string} id - The unique identifier.
161
+ * @param {string} [id] - The unique identifier.
162
162
  * @returns {this} The current instance for chaining.
163
163
  */
164
164
  setID(id: string): this;
165
165
  /**
166
166
  * Sets the shadow properties of the layer.
167
- * @param {string} color - The color of the shadow.
167
+ * @param {string} [color] - The color of the shadow.
168
168
  * @param {number} [blur] - The blur radius of the shadow.
169
169
  * @param {number} [offsetX] - The horizontal offset of the shadow.
170
170
  * @param {number} [offsetY] - The vertical offset of the shadow.
@@ -174,57 +174,57 @@ export declare class BaseLayer<T extends IBaseLayerProps> {
174
174
  setShadow(color: string, blur?: number, offsetX?: number, offsetY?: number): this;
175
175
  /**
176
176
  * Sets the transformation matrix of the layer.
177
- * @param {DOMMatrix2DInit} matrix - The transformation matrix.
177
+ * @param {DOMMatrix2DInit} [matrix] - The transformation matrix.
178
178
  * @returns {this} The current instance for chaining.
179
179
  */
180
180
  setMatrix(matrix: DOMMatrix2DInit): this;
181
181
  /**
182
182
  * Sets the scale of the layer in the x and y directions.
183
- * @param {number} x - The scale factor in the x direction.
184
- * @param {number} y - The scale factor in the y direction.
183
+ * @param {number} [x] - The scale factor in the x direction.
184
+ * @param {number} [y] - The scale factor in the y direction.
185
185
  * @returns {this} The current instance for chaining.
186
186
  */
187
187
  setScale(x: number, y: number): this;
188
188
  /**
189
189
  * Sets the rotation of the layer.
190
- * @param {number} rotate - The rotation angle in degrees.
190
+ * @param {number} [rotate] - The rotation angle in degrees.
191
191
  * @returns {this} The current instance for chaining.
192
192
  */
193
193
  setRotate(rotate: number): this;
194
194
  /**
195
195
  * Sets the translation of the layer in the x and y directions.
196
- * @param {number} x - The translation in the x direction.
197
- * @param {number} y - The translation in the y direction.
196
+ * @param {number} [x] - The translation in the x direction.
197
+ * @param {number} [y] - The translation in the y direction.
198
198
  * @returns {this} The current instance for chaining.
199
199
  */
200
200
  setTranslate(x: number, y: number): this;
201
201
  /**
202
202
  * Sets the filter effects for the layer.
203
- * @param {...AnyFilter} filter - The filter effects to apply.
203
+ * @param {...AnyFilter} [filter] - The filter effects to apply.
204
204
  * @returns {this} The current instance for chaining.
205
205
  */
206
206
  setFilters(...filter: AnyFilter[]): this;
207
207
  /**
208
208
  * Sets the centring type of the layer. **Don't affect on Bezier, Line, Quadratic and Text layers**.
209
- * @param {AnyCentring} centring - The centring type.
209
+ * @param {AnyCentring} [centring] - The centring type.
210
210
  * @returns {this} The current instance for chaining.
211
211
  */
212
212
  setCentring(centring: AnyCentring): this;
213
213
  /**
214
214
  * Sets the visibility of the layer.
215
- * @param {boolean} visible - The visibility state.
215
+ * @param {boolean} [visible] - The visibility state.
216
216
  * @returns {this} The current instance for chaining.
217
217
  */
218
218
  setVisible(visible: boolean): this;
219
219
  /**
220
220
  * Sets the z-index of the layer.
221
- * @param {number} zIndex - The z-index value.
221
+ * @param {number} [zIndex] - The z-index value.
222
222
  * @returns {this} The current instance for chaining.
223
223
  */
224
224
  setZIndex(zIndex: number): this;
225
225
  /**
226
226
  * Sets the global composite operation for the layer.
227
- * @param {AnyGlobalCompositeOperation} operation - The composite operation.
227
+ * @param {AnyGlobalCompositeOperation} [operation] - The composite operation.
228
228
  * @returns {this} The current instance for chaining.
229
229
  */
230
230
  setGlobalCompositeOperation(operation: AnyGlobalCompositeOperation): this;
@@ -52,8 +52,8 @@ class BaseLayer {
52
52
  }
53
53
  /**
54
54
  * Sets the position of the layer in the 2D plane.
55
- * @param {ScaleType} x - The x-coordinate of the layer.
56
- * @param {ScaleType} y - The y-coordinate of the layer.
55
+ * @param {ScaleType} [x] - The x-coordinate of the layer.
56
+ * @param {ScaleType} [y] - The y-coordinate of the layer.
57
57
  * @returns {this} The current instance for chaining.
58
58
  */
59
59
  setPosition(x, y) {
@@ -63,7 +63,7 @@ class BaseLayer {
63
63
  }
64
64
  /**
65
65
  * Sets the opacity of the layer.
66
- * @param {number} opacity - The opacity value, between 0 and 1.
66
+ * @param {number} [opacity] - The opacity value, between 0 and 1.
67
67
  * @returns {this} The current instance for chaining.
68
68
  */
69
69
  setOpacity(opacity) {
@@ -73,7 +73,7 @@ class BaseLayer {
73
73
  /**
74
74
  * Sets the unique identifier of the layer.
75
75
  *
76
- * @param {string} id - The unique identifier.
76
+ * @param {string} [id] - The unique identifier.
77
77
  * @returns {this} The current instance for chaining.
78
78
  */
79
79
  setID(id) {
@@ -82,7 +82,7 @@ class BaseLayer {
82
82
  }
83
83
  /**
84
84
  * Sets the shadow properties of the layer.
85
- * @param {string} color - The color of the shadow.
85
+ * @param {string} [color] - The color of the shadow.
86
86
  * @param {number} [blur] - The blur radius of the shadow.
87
87
  * @param {number} [offsetX] - The horizontal offset of the shadow.
88
88
  * @param {number} [offsetY] - The vertical offset of the shadow.
@@ -104,7 +104,7 @@ class BaseLayer {
104
104
  }
105
105
  /**
106
106
  * Sets the transformation matrix of the layer.
107
- * @param {DOMMatrix2DInit} matrix - The transformation matrix.
107
+ * @param {DOMMatrix2DInit} [matrix] - The transformation matrix.
108
108
  * @returns {this} The current instance for chaining.
109
109
  */
110
110
  setMatrix(matrix) {
@@ -113,8 +113,8 @@ class BaseLayer {
113
113
  }
114
114
  /**
115
115
  * Sets the scale of the layer in the x and y directions.
116
- * @param {number} x - The scale factor in the x direction.
117
- * @param {number} y - The scale factor in the y direction.
116
+ * @param {number} [x] - The scale factor in the x direction.
117
+ * @param {number} [y] - The scale factor in the y direction.
118
118
  * @returns {this} The current instance for chaining.
119
119
  */
120
120
  setScale(x, y) {
@@ -123,7 +123,7 @@ class BaseLayer {
123
123
  }
124
124
  /**
125
125
  * Sets the rotation of the layer.
126
- * @param {number} rotate - The rotation angle in degrees.
126
+ * @param {number} [rotate] - The rotation angle in degrees.
127
127
  * @returns {this} The current instance for chaining.
128
128
  */
129
129
  setRotate(rotate) {
@@ -132,8 +132,8 @@ class BaseLayer {
132
132
  }
133
133
  /**
134
134
  * Sets the translation of the layer in the x and y directions.
135
- * @param {number} x - The translation in the x direction.
136
- * @param {number} y - The translation in the y direction.
135
+ * @param {number} [x] - The translation in the x direction.
136
+ * @param {number} [y] - The translation in the y direction.
137
137
  * @returns {this} The current instance for chaining.
138
138
  */
139
139
  setTranslate(x, y) {
@@ -142,7 +142,7 @@ class BaseLayer {
142
142
  }
143
143
  /**
144
144
  * Sets the filter effects for the layer.
145
- * @param {...AnyFilter} filter - The filter effects to apply.
145
+ * @param {...AnyFilter} [filter] - The filter effects to apply.
146
146
  * @returns {this} The current instance for chaining.
147
147
  */
148
148
  setFilters(...filter) {
@@ -151,7 +151,7 @@ class BaseLayer {
151
151
  }
152
152
  /**
153
153
  * Sets the centring type of the layer. **Don't affect on Bezier, Line, Quadratic and Text layers**.
154
- * @param {AnyCentring} centring - The centring type.
154
+ * @param {AnyCentring} [centring] - The centring type.
155
155
  * @returns {this} The current instance for chaining.
156
156
  */
157
157
  setCentring(centring) {
@@ -160,7 +160,7 @@ class BaseLayer {
160
160
  }
161
161
  /**
162
162
  * Sets the visibility of the layer.
163
- * @param {boolean} visible - The visibility state.
163
+ * @param {boolean} [visible] - The visibility state.
164
164
  * @returns {this} The current instance for chaining.
165
165
  */
166
166
  setVisible(visible) {
@@ -169,7 +169,7 @@ class BaseLayer {
169
169
  }
170
170
  /**
171
171
  * Sets the z-index of the layer.
172
- * @param {number} zIndex - The z-index value.
172
+ * @param {number} [zIndex] - The z-index value.
173
173
  * @returns {this} The current instance for chaining.
174
174
  */
175
175
  setZIndex(zIndex) {
@@ -178,7 +178,7 @@ class BaseLayer {
178
178
  }
179
179
  /**
180
180
  * Sets the global composite operation for the layer.
181
- * @param {AnyGlobalCompositeOperation} operation - The composite operation.
181
+ * @param {AnyGlobalCompositeOperation} [operation] - The composite operation.
182
182
  * @returns {this} The current instance for chaining.
183
183
  */
184
184
  setGlobalCompositeOperation(operation) {
@@ -1,7 +1,7 @@
1
1
  import { BaseLayer, IBaseLayer, IBaseLayerMisc, IBaseLayerProps } from "./BaseLayer";
2
2
  import { ColorType, Point, ScaleType, LayerType } from "../../types";
3
3
  import { Canvas, SKRSContext2D, SvgCanvas } from "@napi-rs/canvas";
4
- import { LayersManager } from "../managers/LayersManager";
4
+ import { LayersManager } from "../managers";
5
5
  /**
6
6
  * Interface representing a Bezier layer.
7
7
  */
@@ -67,13 +67,13 @@ export declare class BezierLayer extends BaseLayer<IBezierLayerProps> {
67
67
  props: IBezierLayerProps;
68
68
  /**
69
69
  * Constructs a new BezierLayer instance.
70
- * @param props {IBezierLayerProps} - The properties of the Bezier layer.
71
- * @param misc {IBaseLayerMisc} - Miscellaneous options for the layer.
70
+ * @param {IBezierLayerProps} [props] - The properties of the Bezier layer.
71
+ * @param {IBaseLayerMisc} [misc] - Miscellaneous options for the layer.
72
72
  */
73
73
  constructor(props?: IBezierLayerProps, misc?: IBaseLayerMisc);
74
74
  /**
75
75
  * Sets the control points of the Bezier layer.
76
- * @param controlPoints {Array<{ x: ScaleType, y: ScaleType }>} - The control points of the Bezier layer.
76
+ * @param {Array<{ x: ScaleType, y: ScaleType }>} [controlPoints] - The control points of the Bezier layer.
77
77
  * @returns {this} The current instance for chaining.
78
78
  * @throws {LazyError} If the number of control points is not exactly 2.
79
79
  */
@@ -83,34 +83,34 @@ export declare class BezierLayer extends BaseLayer<IBezierLayerProps> {
83
83
  }[]): this;
84
84
  /**
85
85
  * Sets the end position of the Bezier layer.
86
- * @param x {ScaleType} - The x-coordinate of the end point.
87
- * @param y {ScaleType} - The y-coordinate of the end point.
86
+ * @param {ScaleType} [x] - The x-coordinate of the end point.
87
+ * @param {ScaleType} [y] - The y-coordinate of the end point.
88
88
  * @returns {this} The current instance for chaining.
89
89
  */
90
90
  setEndPosition(x: ScaleType, y: ScaleType): this;
91
91
  /**
92
92
  * Sets the color of the Bezier layer.
93
- * @param color {ColorType} - The color of the layer.
93
+ * @param {ColorType} [color] - The color of the layer.
94
94
  * @returns {this} The current instance for chaining.
95
95
  * @throws {LazyError} If the color is not provided or invalid.
96
96
  */
97
97
  setColor(color: ColorType): this;
98
98
  /**
99
99
  * Sets the stroke properties of the Bezier layer.
100
- * @param width {number} - The width of the stroke.
101
- * @param cap {string} - The cap style of the stroke.
102
- * @param join {string} - The join style of the stroke.
103
- * @param dash {number[]} - The dash pattern of the stroke.
104
- * @param dashOffset {number} - The dash offset of the stroke.
105
- * @param miterLimit {number} - The miter limit of the stroke.
100
+ * @param {number} [width] - The width of the stroke.
101
+ * @param {string} [cap] - The cap style of the stroke.
102
+ * @param {string} [join] - The join style of the stroke.
103
+ * @param {number[]} [dash] - The dash pattern of the stroke.
104
+ * @param {number} [dashOffset] - The dash offset of the stroke.
105
+ * @param {number} [miterLimit] - The miter limit of the stroke.
106
106
  * @returns {this} The current instance for chaining.
107
107
  */
108
108
  setStroke(width: number, cap?: CanvasLineCap, join?: CanvasLineJoin, dash?: number[], dashOffset?: number, miterLimit?: number): this;
109
109
  /**
110
110
  * Calculates the bounding box of the Bezier layer.
111
- * @param ctx {SKRSContext2D} - The canvas rendering context.
112
- * @param canvas {Canvas | SvgCanvas} - The canvas instance.
113
- * @param manager {LayersManager} - The layers manager.
111
+ * @param {SKRSContext2D} [ctx] - The canvas rendering context.
112
+ * @param {Canvas | SvgCanvas} [canvas] - The canvas instance.
113
+ * @param {LayersManager} [manager] - The layers manager.
114
114
  * @returns {Object} The bounding box details including max, min, center, width, and height.
115
115
  */
116
116
  getBoundingBox(ctx: SKRSContext2D, canvas: Canvas | SvgCanvas, manager: LayersManager): {
@@ -122,10 +122,10 @@ export declare class BezierLayer extends BaseLayer<IBezierLayerProps> {
122
122
  };
123
123
  /**
124
124
  * Draws the Bezier layer on the canvas.
125
- * @param ctx {SKRSContext2D} - The canvas rendering context.
126
- * @param canvas {Canvas | SvgCanvas} - The canvas instance.
127
- * @param manager {LayersManager} - The layers manager.
128
- * @param debug {boolean} - Whether to enable debug logging.
125
+ * @param {SKRSContext2D} [ctx] - The canvas rendering context.
126
+ * @param {Canvas | SvgCanvas} [canvas] - The canvas instance.
127
+ * @param {LayersManager} [manager] - The layers manager.
128
+ * @param {boolean} [debug] - Whether to enable debug logging.
129
129
  */
130
130
  draw(ctx: SKRSContext2D, canvas: Canvas | SvgCanvas, manager: LayersManager, debug: boolean): Promise<void>;
131
131
  /**
@@ -135,7 +135,7 @@ export declare class BezierLayer extends BaseLayer<IBezierLayerProps> {
135
135
  toJSON(): IBezierLayer;
136
136
  /**
137
137
  * Validates the properties of the Bezier layer.
138
- * @param data {IBezierLayerProps} - The properties to validate.
138
+ * @param {IBezierLayerProps} [data] - The properties to validate.
139
139
  * @returns {IBezierLayerProps} The validated properties.
140
140
  */
141
141
  protected validateProps(data: IBezierLayerProps): IBezierLayerProps;