@nmmty/lazycanvas 0.6.0-dev.f33019 → 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 (58) hide show
  1. package/dist/helpers/Utlis.d.ts +28 -0
  2. package/dist/helpers/Utlis.js +78 -0
  3. package/dist/helpers/index.d.ts +3 -0
  4. package/dist/helpers/index.js +19 -0
  5. package/dist/index.d.ts +5 -10
  6. package/dist/index.js +5 -29
  7. package/dist/structures/LazyCanvas.d.ts +46 -13
  8. package/dist/structures/LazyCanvas.js +66 -22
  9. package/dist/structures/components/BaseLayer.d.ts +16 -16
  10. package/dist/structures/components/BaseLayer.js +17 -17
  11. package/dist/structures/components/BezierLayer.d.ts +21 -21
  12. package/dist/structures/components/BezierLayer.js +20 -20
  13. package/dist/structures/components/ClearLayer.d.ts +15 -15
  14. package/dist/structures/components/ClearLayer.js +14 -14
  15. package/dist/structures/components/Group.d.ts +10 -11
  16. package/dist/structures/components/Group.js +9 -10
  17. package/dist/structures/components/ImageLayer.d.ts +12 -14
  18. package/dist/structures/components/ImageLayer.js +11 -11
  19. package/dist/structures/components/LineLayer.d.ts +20 -20
  20. package/dist/structures/components/LineLayer.js +19 -19
  21. package/dist/structures/components/MorphLayer.d.ts +18 -24
  22. package/dist/structures/components/MorphLayer.js +18 -26
  23. package/dist/structures/components/Path2DLayer.d.ts +4 -78
  24. package/dist/structures/components/Path2DLayer.js +2 -116
  25. package/dist/structures/components/QuadraticLayer.d.ts +22 -22
  26. package/dist/structures/components/QuadraticLayer.js +21 -21
  27. package/dist/structures/components/TextLayer.d.ts +37 -43
  28. package/dist/structures/components/TextLayer.js +37 -45
  29. package/dist/structures/helpers/Exporter.d.ts +9 -11
  30. package/dist/structures/helpers/Exporter.js +49 -32
  31. package/dist/structures/helpers/Font.d.ts +4 -6
  32. package/dist/structures/helpers/Font.js +4 -4
  33. package/dist/structures/helpers/Gradient.d.ts +15 -10
  34. package/dist/structures/helpers/Gradient.js +14 -9
  35. package/dist/structures/helpers/Link.d.ts +5 -5
  36. package/dist/structures/helpers/Link.js +5 -5
  37. package/dist/structures/helpers/Pattern.d.ts +5 -5
  38. package/dist/structures/helpers/Pattern.js +5 -5
  39. package/dist/structures/helpers/index.d.ts +7 -7
  40. package/dist/structures/helpers/readers/JSONReader.d.ts +12 -12
  41. package/dist/structures/helpers/readers/JSONReader.js +29 -19
  42. package/dist/structures/helpers/readers/YAMLReader.d.ts +4 -4
  43. package/dist/structures/helpers/readers/YAMLReader.js +21 -11
  44. package/dist/structures/managers/AnimationManager.d.ts +11 -11
  45. package/dist/structures/managers/AnimationManager.js +11 -11
  46. package/dist/structures/managers/FontsManager.d.ts +14 -15
  47. package/dist/structures/managers/FontsManager.js +14 -15
  48. package/dist/structures/managers/LayersManager.d.ts +22 -12
  49. package/dist/structures/managers/LayersManager.js +27 -12
  50. package/dist/structures/managers/PluginManager.d.ts +230 -0
  51. package/dist/structures/managers/PluginManager.js +182 -0
  52. package/dist/structures/managers/RenderManager.d.ts +10 -12
  53. package/dist/structures/managers/RenderManager.js +31 -16
  54. package/dist/structures/managers/index.d.ts +5 -0
  55. package/dist/structures/managers/index.js +21 -0
  56. package/dist/utils/utils.d.ts +1 -1
  57. package/dist/utils/utils.js +15 -16
  58. package/package.json +59 -56
@@ -20,8 +20,8 @@ class Link {
20
20
  additionalSpacing;
21
21
  /**
22
22
  * Constructs a new Link instance.
23
- * @param opts {Object} - Optional properties for the link.
24
- * @param opts.props {ILink} - The link properties.
23
+ * @param {Object} [opts] - Optional properties for the link.
24
+ * @param {ILink} [opts.props] - The link properties.
25
25
  */
26
26
  constructor(opts) {
27
27
  this.source = opts?.props?.source || '';
@@ -30,7 +30,7 @@ class Link {
30
30
  }
31
31
  /**
32
32
  * Sets the source of the link.
33
- * @param source {string} - The ID of the layer to link.
33
+ * @param {string} [source] - The ID of the layer to link.
34
34
  * @returns {this} The current instance for chaining.
35
35
  */
36
36
  setSource(source) {
@@ -39,7 +39,7 @@ class Link {
39
39
  }
40
40
  /**
41
41
  * Sets the type of the link.
42
- * @param type {AnyLinkType} - The type of the link.
42
+ * @param {AnyLinkType} [type] - The type of the link.
43
43
  * @returns {this} The current instance for chaining.
44
44
  */
45
45
  setType(type) {
@@ -48,7 +48,7 @@ class Link {
48
48
  }
49
49
  /**
50
50
  * Sets the additional spacing of the link.
51
- * @param additionalSpacing {ScaleType} - The additional spacing of the link.
51
+ * @param {ScaleType} [additionalSpacing] - The additional spacing of the link.
52
52
  * @returns {this} The current instance for chaining.
53
53
  */
54
54
  setSpacing(additionalSpacing) {
@@ -36,27 +36,27 @@ export declare class Pattern implements IPattern {
36
36
  src: string | LazyCanvas;
37
37
  /**
38
38
  * Constructs a new Pattern instance.
39
- * @param opts {Object} - Optional properties for the pattern.
40
- * @param opts.props {IPattern} - The pattern properties.
39
+ * @param {Object} [opts] - Optional properties for the pattern.
40
+ * @param {IPattern} [opts.props] - The pattern properties.
41
41
  */
42
42
  constructor(opts?: {
43
43
  props?: IPattern;
44
44
  });
45
45
  /**
46
46
  * Sets the type of the pattern.
47
- * @param type {AnyPatternType} - The type of the pattern (e.g., repeat, no-repeat).
47
+ * @param {AnyPatternType} [type] - The type of the pattern (e.g., repeat, no-repeat).
48
48
  * @returns {this} The current instance for chaining.
49
49
  */
50
50
  setType(type: AnyPatternType): this;
51
51
  /**
52
52
  * Sets the source of the pattern.
53
- * @param src {string | LazyCanvas} - The source of the pattern, which can be a string (URL or path) or a LazyCanvas instance.
53
+ * @param {string | LazyCanvas} [src] - The source of the pattern, which can be a string (URL or path) or a LazyCanvas instance.
54
54
  * @returns {this} The current instance for chaining.
55
55
  */
56
56
  setSrc(src: string | LazyCanvas): this;
57
57
  /**
58
58
  * Draws the pattern on a canvas context.
59
- * @param ctx {SKRSContext2D} - The canvas rendering context.
59
+ * @param {SKRSContext2D} [ctx] - The canvas rendering context.
60
60
  * @returns {Promise<CanvasPattern>} The created pattern.
61
61
  */
62
62
  draw(ctx: SKRSContext2D): Promise<CanvasPattern>;
@@ -24,8 +24,8 @@ class Pattern {
24
24
  src;
25
25
  /**
26
26
  * Constructs a new Pattern instance.
27
- * @param opts {Object} - Optional properties for the pattern.
28
- * @param opts.props {IPattern} - The pattern properties.
27
+ * @param {Object} [opts] - Optional properties for the pattern.
28
+ * @param {IPattern} [opts.props] - The pattern properties.
29
29
  */
30
30
  constructor(opts) {
31
31
  this.type = opts?.props?.type || types_1.PatternType.Repeat;
@@ -33,7 +33,7 @@ class Pattern {
33
33
  }
34
34
  /**
35
35
  * Sets the type of the pattern.
36
- * @param type {AnyPatternType} - The type of the pattern (e.g., repeat, no-repeat).
36
+ * @param {AnyPatternType} [type] - The type of the pattern (e.g., repeat, no-repeat).
37
37
  * @returns {this} The current instance for chaining.
38
38
  */
39
39
  setType(type) {
@@ -42,7 +42,7 @@ class Pattern {
42
42
  }
43
43
  /**
44
44
  * Sets the source of the pattern.
45
- * @param src {string | LazyCanvas} - The source of the pattern, which can be a string (URL or path) or a LazyCanvas instance.
45
+ * @param {string | LazyCanvas} [src] - The source of the pattern, which can be a string (URL or path) or a LazyCanvas instance.
46
46
  * @returns {this} The current instance for chaining.
47
47
  */
48
48
  setSrc(src) {
@@ -51,7 +51,7 @@ class Pattern {
51
51
  }
52
52
  /**
53
53
  * Draws the pattern on a canvas context.
54
- * @param ctx {SKRSContext2D} - The canvas rendering context.
54
+ * @param {SKRSContext2D} [ctx] - The canvas rendering context.
55
55
  * @returns {Promise<CanvasPattern>} The created pattern.
56
56
  */
57
57
  async draw(ctx) {
@@ -1,7 +1,7 @@
1
- export * from "./Exporter";
2
- export * from "./Font";
3
- export * from "./Gradient";
4
- export * from "./Link";
5
- export * from "./Pattern";
6
- export * from "./readers/JSONReader";
7
- export * from "./readers/YAMLReader";
1
+ export * from './Exporter';
2
+ export * from './Font';
3
+ export * from './Gradient';
4
+ export * from './Link';
5
+ export * from './Pattern';
6
+ export * from './readers/JSONReader';
7
+ export * from './readers/YAMLReader';
@@ -5,9 +5,9 @@ import { IOLazyCanvas, LazyCanvas } from "../../LazyCanvas";
5
5
  export declare class JSONReader {
6
6
  /**
7
7
  * Reads JSON data and converts it into a LazyCanvas instance.
8
- * @param data {IOLazyCanvas} - The JSON data to read.
9
- * @param opts {Object} - Optional settings.
10
- * @param opts.debug {boolean} - Whether to enable debug logging.
8
+ * @param {IOLazyCanvas} [data] - The JSON data to read.
9
+ * @param {Object} [opts] - Optional settings.
10
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
11
11
  * @returns {LazyCanvas} The created LazyCanvas instance.
12
12
  * @throws {LazyError} If the data contains invalid options or no layers are found.
13
13
  */
@@ -16,9 +16,9 @@ export declare class JSONReader {
16
16
  }): LazyCanvas;
17
17
  /**
18
18
  * Reads a JSON file and converts it into a LazyCanvas instance.
19
- * @param file {string} - The path to the JSON file.
20
- * @param opts {Object} - Optional settings.
21
- * @param opts.debug {boolean} - Whether to enable debug logging.
19
+ * @param {string} [file] - The path to the JSON file.
20
+ * @param {Object} [opts] - Optional settings.
21
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
22
22
  * @returns {LazyCanvas} The created LazyCanvas instance.
23
23
  * @throws {LazyError} If the file does not exist.
24
24
  */
@@ -27,22 +27,22 @@ export declare class JSONReader {
27
27
  }): LazyCanvas;
28
28
  /**
29
29
  * Parses an array of JSON layers into an array of AnyLayer or Group instances.
30
- * @param data {Array<JSONLayer | Group>} - The array of JSON layers to parse.
31
- * @param opts {Object} - Optional settings.
32
- * @param opts.debug {boolean} - Whether to enable debug logging.
30
+ * @param {Array<JSONLayer | Group>} [data] - The array of JSON layers to parse.
31
+ * @param {Object} [opts] - Optional settings.
32
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
33
33
  * @returns {Array<AnyLayer | Group>} The parsed layers.
34
34
  */
35
35
  private static layersParse;
36
36
  /**
37
37
  * Parses a single JSON layer into an AnyLayer or Group instance.
38
- * @param layer {JSONLayer | IGroup | Group} - The JSON layer to parse.
39
- * @param misc {IBaseLayerMisc} - Miscellaneous options for the layer.
38
+ * @param {JSONLayer | IGroup | Group} [layer] - The JSON layer to parse.
39
+ * @param {IBaseLayerMisc} [misc] - Miscellaneous options for the layer.
40
40
  * @returns {AnyLayer | Group} The parsed layer.
41
41
  */
42
42
  private static layerParse;
43
43
  /**
44
44
  * Parses the fill style of a layer.
45
- * @param layer {JSONLayer} - The layer whose fill style is to be parsed.
45
+ * @param {JSONLayer} [layer] - The layer whose fill style is to be parsed.
46
46
  * @returns {string | Gradient | Pattern} The parsed fill style.
47
47
  */
48
48
  private static fillParse;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.JSONReader = void 0;
27
37
  const types_1 = require("../../../types");
@@ -37,9 +47,9 @@ const path = __importStar(require("path"));
37
47
  class JSONReader {
38
48
  /**
39
49
  * Reads JSON data and converts it into a LazyCanvas instance.
40
- * @param data {IOLazyCanvas} - The JSON data to read.
41
- * @param opts {Object} - Optional settings.
42
- * @param opts.debug {boolean} - Whether to enable debug logging.
50
+ * @param {IOLazyCanvas} [data] - The JSON data to read.
51
+ * @param {Object} [opts] - Optional settings.
52
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
43
53
  * @returns {LazyCanvas} The created LazyCanvas instance.
44
54
  * @throws {LazyError} If the data contains invalid options or no layers are found.
45
55
  */
@@ -66,9 +76,9 @@ class JSONReader {
66
76
  }
67
77
  /**
68
78
  * Reads a JSON file and converts it into a LazyCanvas instance.
69
- * @param file {string} - The path to the JSON file.
70
- * @param opts {Object} - Optional settings.
71
- * @param opts.debug {boolean} - Whether to enable debug logging.
79
+ * @param {string} [file] - The path to the JSON file.
80
+ * @param {Object} [opts] - Optional settings.
81
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
72
82
  * @returns {LazyCanvas} The created LazyCanvas instance.
73
83
  * @throws {LazyError} If the file does not exist.
74
84
  */
@@ -84,9 +94,9 @@ class JSONReader {
84
94
  }
85
95
  /**
86
96
  * Parses an array of JSON layers into an array of AnyLayer or Group instances.
87
- * @param data {Array<JSONLayer | Group>} - The array of JSON layers to parse.
88
- * @param opts {Object} - Optional settings.
89
- * @param opts.debug {boolean} - Whether to enable debug logging.
97
+ * @param {Array<JSONLayer | Group>} [data] - The array of JSON layers to parse.
98
+ * @param {Object} [opts] - Optional settings.
99
+ * @param {boolean} [opts.debug] - Whether to enable debug logging.
90
100
  * @returns {Array<AnyLayer | Group>} The parsed layers.
91
101
  */
92
102
  static layersParse(data, opts) {
@@ -108,8 +118,8 @@ class JSONReader {
108
118
  }
109
119
  /**
110
120
  * Parses a single JSON layer into an AnyLayer or Group instance.
111
- * @param layer {JSONLayer | IGroup | Group} - The JSON layer to parse.
112
- * @param misc {IBaseLayerMisc} - Miscellaneous options for the layer.
121
+ * @param {JSONLayer | IGroup | Group} [layer] - The JSON layer to parse.
122
+ * @param {IBaseLayerMisc} [misc] - Miscellaneous options for the layer.
113
123
  * @returns {AnyLayer | Group} The parsed layer.
114
124
  */
115
125
  static layerParse(layer, misc) {
@@ -144,7 +154,7 @@ class JSONReader {
144
154
  }
145
155
  /**
146
156
  * Parses the fill style of a layer.
147
- * @param layer {JSONLayer} - The layer whose fill style is to be parsed.
157
+ * @param {JSONLayer} [layer] - The layer whose fill style is to be parsed.
148
158
  * @returns {string | Gradient | Pattern} The parsed fill style.
149
159
  */
150
160
  static fillParse(layer) {
@@ -2,8 +2,8 @@ import { LazyCanvas } from "../../LazyCanvas";
2
2
  export declare class YAMLReader {
3
3
  /**
4
4
  * Reads a YAML string and converts it to a LazyCanvas object.
5
- * @param data - The YAML string to read.
6
- * @param opts - Optional parameters for debugging.
5
+ * @param {string} [data] - The YAML string to read.
6
+ * @param {Object} [opts] - Optional parameters for debugging.
7
7
  * @returns A Promise that resolves to a LazyCanvas object.
8
8
  */
9
9
  static read(data: string, opts?: {
@@ -11,8 +11,8 @@ export declare class YAMLReader {
11
11
  }): LazyCanvas;
12
12
  /**
13
13
  * Reads a YAML file and converts it to a LazyCanvas object.
14
- * @param filePath - The path to the YAML file.
15
- * @param opts - Optional parameters for debugging.
14
+ * @param {string} [filePath] - The path to the YAML file.
15
+ * @param {Object} [opts] - Optional parameters for debugging.
16
16
  * @returns A Promise that resolves to a LazyCanvas object.
17
17
  * @throws LazyError if the file does not exist or has an invalid extension.
18
18
  */
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.YAMLReader = void 0;
27
37
  const JSONReader_1 = require("./JSONReader");
@@ -32,8 +42,8 @@ const path = __importStar(require("path"));
32
42
  class YAMLReader {
33
43
  /**
34
44
  * Reads a YAML string and converts it to a LazyCanvas object.
35
- * @param data - The YAML string to read.
36
- * @param opts - Optional parameters for debugging.
45
+ * @param {string} [data] - The YAML string to read.
46
+ * @param {Object} [opts] - Optional parameters for debugging.
37
47
  * @returns A Promise that resolves to a LazyCanvas object.
38
48
  */
39
49
  static read(data, opts) {
@@ -50,8 +60,8 @@ class YAMLReader {
50
60
  }
51
61
  /**
52
62
  * Reads a YAML file and converts it to a LazyCanvas object.
53
- * @param filePath - The path to the YAML file.
54
- * @param opts - Optional parameters for debugging.
63
+ * @param {string} [filePath] - The path to the YAML file.
64
+ * @param {Object} [opts] - Optional parameters for debugging.
55
65
  * @returns A Promise that resolves to a LazyCanvas object.
56
66
  * @throws LazyError if the file does not exist or has an invalid extension.
57
67
  */
@@ -69,10 +69,10 @@ export declare class AnimationManager implements IAnimationManager {
69
69
  debug: boolean;
70
70
  /**
71
71
  * Constructs a new AnimationManager instance.
72
- * @param opts {Object} - Optional settings for the animation manager.
73
- * @param opts.debug {boolean} - Whether debugging is enabled.
74
- * @param opts.settings {Object} - Additional settings for the animation manager.
75
- * @param opts.settings.options {IAnimationOptions} - The animation options.
72
+ * @param {Object} [opts] - Optional settings for the animation manager.
73
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
74
+ * @param {Object} [opts.settings] - Additional settings for the animation manager.
75
+ * @param {IAnimationOptions} [opts.settings.options] - The animation options.
76
76
  */
77
77
  constructor(opts?: {
78
78
  debug?: boolean;
@@ -82,38 +82,38 @@ export declare class AnimationManager implements IAnimationManager {
82
82
  });
83
83
  /**
84
84
  * Sets the frame rate of the animation.
85
- * @param frameRate {number} - The frame rate of the animation (default is 30).
85
+ * @param {number} [frameRate] - The frame rate of the animation (default is 30).
86
86
  * @returns {this} The current instance for chaining.
87
87
  */
88
88
  setFrameRate(frameRate: number): this;
89
89
  /**
90
90
  * Sets whether the animation should loop.
91
- * @param loop {boolean} - Whether the animation should loop (default is true).
91
+ * @param {boolean} [loop] - Whether the animation should loop (default is true).
92
92
  * @returns {this} The current instance for chaining.
93
93
  */
94
94
  setLoop(loop: boolean): this;
95
95
  /**
96
96
  * Sets whether the animation should have transparency.
97
- * @param transparency {boolean} - Whether the animation should have transparency (default is true).
97
+ * @param {boolean} [transparency] - Whether the animation should have transparency (default is true).
98
98
  * @returns {this} The current instance for chaining.
99
99
  */
100
100
  setTransparent(transparency: boolean): this;
101
101
  /**
102
102
  * Sets the RGB format of the animation.
103
- * @param rgb {ColorSpace} - The RGB format of the animation (default is RGB565).
103
+ * @param {ColorSpace} [rgb] - The RGB format of the animation (default is RGB565).
104
104
  * @returns {this} The current instance for chaining.
105
105
  */
106
106
  setRGBFormat(rgb: AnyColorSpace): this;
107
107
  /**
108
108
  * Sets the maximum number of colors in the animation.
109
- * @param maxColors {number} - The maximum number of colors (default is 256).
109
+ * @param {number} [maxColors] - The maximum number of colors (default is 256).
110
110
  * @returns {this} The current instance for chaining.
111
111
  */
112
112
  setMaxColors(maxColors: number): this;
113
113
  /**
114
114
  * Sets whether the content of previous frames will be cleared.
115
- * @param clear {boolean} - Whether to clear the content of previous frames (default is true).
116
- * @param bufferSize {number} - The size of the frame buffer (default is 0).
115
+ * @param {boolean} [clear] - Whether to clear the content of previous frames (default is true).
116
+ * @param {number} [bufferSize] - The size of the frame buffer (default is 0).
117
117
  * @returns {this} The current instance for chaining.
118
118
  */
119
119
  setClear(clear: boolean, bufferSize?: number): this;
@@ -16,10 +16,10 @@ class AnimationManager {
16
16
  debug;
17
17
  /**
18
18
  * Constructs a new AnimationManager instance.
19
- * @param opts {Object} - Optional settings for the animation manager.
20
- * @param opts.debug {boolean} - Whether debugging is enabled.
21
- * @param opts.settings {Object} - Additional settings for the animation manager.
22
- * @param opts.settings.options {IAnimationOptions} - The animation options.
19
+ * @param {Object} [opts] - Optional settings for the animation manager.
20
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
21
+ * @param {Object} [opts.settings] - Additional settings for the animation manager.
22
+ * @param {IAnimationOptions} [opts.settings.options] - The animation options.
23
23
  */
24
24
  constructor(opts) {
25
25
  this.options = opts?.settings?.options || {
@@ -39,7 +39,7 @@ class AnimationManager {
39
39
  }
40
40
  /**
41
41
  * Sets the frame rate of the animation.
42
- * @param frameRate {number} - The frame rate of the animation (default is 30).
42
+ * @param {number} [frameRate] - The frame rate of the animation (default is 30).
43
43
  * @returns {this} The current instance for chaining.
44
44
  */
45
45
  setFrameRate(frameRate) {
@@ -48,7 +48,7 @@ class AnimationManager {
48
48
  }
49
49
  /**
50
50
  * Sets whether the animation should loop.
51
- * @param loop {boolean} - Whether the animation should loop (default is true).
51
+ * @param {boolean} [loop] - Whether the animation should loop (default is true).
52
52
  * @returns {this} The current instance for chaining.
53
53
  */
54
54
  setLoop(loop) {
@@ -57,7 +57,7 @@ class AnimationManager {
57
57
  }
58
58
  /**
59
59
  * Sets whether the animation should have transparency.
60
- * @param transparency {boolean} - Whether the animation should have transparency (default is true).
60
+ * @param {boolean} [transparency] - Whether the animation should have transparency (default is true).
61
61
  * @returns {this} The current instance for chaining.
62
62
  */
63
63
  setTransparent(transparency) {
@@ -66,7 +66,7 @@ class AnimationManager {
66
66
  }
67
67
  /**
68
68
  * Sets the RGB format of the animation.
69
- * @param rgb {ColorSpace} - The RGB format of the animation (default is RGB565).
69
+ * @param {ColorSpace} [rgb] - The RGB format of the animation (default is RGB565).
70
70
  * @returns {this} The current instance for chaining.
71
71
  */
72
72
  setRGBFormat(rgb) {
@@ -75,7 +75,7 @@ class AnimationManager {
75
75
  }
76
76
  /**
77
77
  * Sets the maximum number of colors in the animation.
78
- * @param maxColors {number} - The maximum number of colors (default is 256).
78
+ * @param {number} [maxColors] - The maximum number of colors (default is 256).
79
79
  * @returns {this} The current instance for chaining.
80
80
  */
81
81
  setMaxColors(maxColors) {
@@ -84,8 +84,8 @@ class AnimationManager {
84
84
  }
85
85
  /**
86
86
  * Sets whether the content of previous frames will be cleared.
87
- * @param clear {boolean} - Whether to clear the content of previous frames (default is true).
88
- * @param bufferSize {number} - The size of the frame buffer (default is 0).
87
+ * @param {boolean} [clear] - Whether to clear the content of previous frames (default is true).
88
+ * @param {number} [bufferSize] - The size of the frame buffer (default is 0).
89
89
  * @returns {this} The current instance for chaining.
90
90
  */
91
91
  setClear(clear, bufferSize) {
@@ -26,31 +26,30 @@ export declare class FontsManager implements IFontsManager {
26
26
  debug: boolean;
27
27
  /**
28
28
  * Constructs a new FontsManager instance.
29
- * @param opts {Object} - Optional settings for the FontsManager.
30
- * @param opts.debug {boolean} - Whether debugging is enabled.
29
+ * @param {Object} [opts] - Optional settings for the FontsManager.
30
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
31
31
  */
32
32
  constructor(opts?: {
33
33
  debug?: boolean;
34
34
  });
35
35
  /**
36
36
  * Loads fonts into the manager from a given font list.
37
- * @param fontList {IFonts} - The fonts to load into the manager.
37
+ * @param {IFonts} [fontList] - The fonts to load into the manager.
38
38
  * @returns {this} The current instance for chaining.
39
39
  */
40
40
  loadFonts(fontList: IFonts): this;
41
41
  /**
42
42
  * Replace base fonts with custom fonts by special file.
43
43
  * Use this method before loading fonts by `FontManager`.
44
- * The file should be generated by the following instructions in MD file.
45
- * @see https://github.com/NMMTY/LazyCanvas/blob/main/scripts/FontsGenerate.md
46
- * @param fonts {Font[]} - The fonts to add to the manager.
44
+ * The file should be generated by the following instructions in [MD file](https://github.com/NMMTY/LazyCanvas/blob/main/scripts/FontsGenerate.md).
45
+ * @param {Font[]} [fonts] - The fonts to add to the manager.
47
46
  * @returns {this} The current instance for chaining.
48
47
  * @throws {LazyError} If required font properties are missing or the font already exists.
49
48
  */
50
49
  add(...fonts: Font[]): this;
51
50
  /**
52
51
  * Removes fonts from the manager.
53
- * @param array {Array<{ family: string, weight: string }>} - The family and weight of the fonts to remove.
52
+ * @param {Array<{ family: string, weight: string }>} [array] - The family and weight of the fonts to remove.
54
53
  * @returns {this} The current instance for chaining.
55
54
  */
56
55
  remove(...array: Array<{
@@ -64,15 +63,15 @@ export declare class FontsManager implements IFontsManager {
64
63
  clear(): this;
65
64
  /**
66
65
  * Retrieves a font or fonts from the manager.
67
- * @param family {string} - The family of the font to retrieve.
68
- * @param weight {string} - The weight of the font to retrieve (optional).
66
+ * @param {string} [family] - The family of the font to retrieve.
67
+ * @param {string} [weight] - The weight of the font to retrieve (optional).
69
68
  * @returns {Font | Font[] | undefined} The retrieved font(s) or undefined if not found.
70
69
  */
71
70
  get(family: string, weight?: string): Font | Font[] | undefined;
72
71
  /**
73
72
  * Checks if a font exists in the manager.
74
- * @param family {string} - The family of the font to check.
75
- * @param weight {string} - The weight of the font to check (optional).
73
+ * @param {string} [family] - The family of the font to check.
74
+ * @param {string} [weight] - The weight of the font to check (optional).
76
75
  * @returns {boolean} True if the font exists, false otherwise.
77
76
  */
78
77
  has(family: string, weight?: string): boolean;
@@ -98,8 +97,8 @@ export declare class FontsManager implements IFontsManager {
98
97
  entries(): IterableIterator<[string, Font]>;
99
98
  /**
100
99
  * Iterates over the fonts in the manager.
101
- * @param callbackfn {Function} - The function to execute on each font.
102
- * @param thisArg {any} - The `this` context to use (optional).
100
+ * @param {Function} [callbackfn] - The function to execute on each font.
101
+ * @param {any} [thisArg] - The `this` context to use (optional).
103
102
  * @returns {this} The current instance for chaining.
104
103
  */
105
104
  forEach(callbackfn: (value: Font, key: string, map: Map<string, Font>) => void, thisArg?: any): this;
@@ -110,7 +109,7 @@ export declare class FontsManager implements IFontsManager {
110
109
  toJSON(): object;
111
110
  /**
112
111
  * Populates the font map from a JSON object.
113
- * @param json {object} - The JSON object to populate the map from.
112
+ * @param {object} [json] - The JSON object to populate the map from.
114
113
  * @returns {this} The current instance for chaining.
115
114
  */
116
115
  fromJSON(json: object): this;
@@ -121,7 +120,7 @@ export declare class FontsManager implements IFontsManager {
121
120
  toArray(): Font[];
122
121
  /**
123
122
  * Populates the font map from an array of fonts.
124
- * @param array {Font[]} - The array of fonts to populate the map from.
123
+ * @param {Font[]} [array] - The array of fonts to populate the map from.
125
124
  * @returns {this} The current instance for chaining.
126
125
  */
127
126
  fromArray(array: Font[]): this;
@@ -19,8 +19,8 @@ class FontsManager {
19
19
  debug;
20
20
  /**
21
21
  * Constructs a new FontsManager instance.
22
- * @param opts {Object} - Optional settings for the FontsManager.
23
- * @param opts.debug {boolean} - Whether debugging is enabled.
22
+ * @param {Object} [opts] - Optional settings for the FontsManager.
23
+ * @param {boolean} [opts.debug] - Whether debugging is enabled.
24
24
  */
25
25
  constructor(opts) {
26
26
  this.map = new Map();
@@ -29,7 +29,7 @@ class FontsManager {
29
29
  }
30
30
  /**
31
31
  * Loads fonts into the manager from a given font list.
32
- * @param fontList {IFonts} - The fonts to load into the manager.
32
+ * @param {IFonts} [fontList] - The fonts to load into the manager.
33
33
  * @returns {this} The current instance for chaining.
34
34
  */
35
35
  loadFonts(fontList) {
@@ -46,9 +46,8 @@ class FontsManager {
46
46
  /**
47
47
  * Replace base fonts with custom fonts by special file.
48
48
  * Use this method before loading fonts by `FontManager`.
49
- * The file should be generated by the following instructions in MD file.
50
- * @see https://github.com/NMMTY/LazyCanvas/blob/main/scripts/FontsGenerate.md
51
- * @param fonts {Font[]} - The fonts to add to the manager.
49
+ * The file should be generated by the following instructions in [MD file](https://github.com/NMMTY/LazyCanvas/blob/main/scripts/FontsGenerate.md).
50
+ * @param {Font[]} [fonts] - The fonts to add to the manager.
52
51
  * @returns {this} The current instance for chaining.
53
52
  * @throws {LazyError} If required font properties are missing or the font already exists.
54
53
  */
@@ -76,7 +75,7 @@ class FontsManager {
76
75
  }
77
76
  /**
78
77
  * Removes fonts from the manager.
79
- * @param array {Array<{ family: string, weight: string }>} - The family and weight of the fonts to remove.
78
+ * @param {Array<{ family: string, weight: string }>} [array] - The family and weight of the fonts to remove.
80
79
  * @returns {this} The current instance for chaining.
81
80
  */
82
81
  remove(...array) {
@@ -95,8 +94,8 @@ class FontsManager {
95
94
  }
96
95
  /**
97
96
  * Retrieves a font or fonts from the manager.
98
- * @param family {string} - The family of the font to retrieve.
99
- * @param weight {string} - The weight of the font to retrieve (optional).
97
+ * @param {string} [family] - The family of the font to retrieve.
98
+ * @param {string} [weight] - The weight of the font to retrieve (optional).
100
99
  * @returns {Font | Font[] | undefined} The retrieved font(s) or undefined if not found.
101
100
  */
102
101
  get(family, weight) {
@@ -106,8 +105,8 @@ class FontsManager {
106
105
  }
107
106
  /**
108
107
  * Checks if a font exists in the manager.
109
- * @param family {string} - The family of the font to check.
110
- * @param weight {string} - The weight of the font to check (optional).
108
+ * @param {string} [family] - The family of the font to check.
109
+ * @param {string} [weight] - The weight of the font to check (optional).
111
110
  * @returns {boolean} True if the font exists, false otherwise.
112
111
  */
113
112
  has(family, weight) {
@@ -145,8 +144,8 @@ class FontsManager {
145
144
  }
146
145
  /**
147
146
  * Iterates over the fonts in the manager.
148
- * @param callbackfn {Function} - The function to execute on each font.
149
- * @param thisArg {any} - The `this` context to use (optional).
147
+ * @param {Function} [callbackfn] - The function to execute on each font.
148
+ * @param {any} [thisArg] - The `this` context to use (optional).
150
149
  * @returns {this} The current instance for chaining.
151
150
  */
152
151
  forEach(callbackfn, thisArg) {
@@ -162,7 +161,7 @@ class FontsManager {
162
161
  }
163
162
  /**
164
163
  * Populates the font map from a JSON object.
165
- * @param json {object} - The JSON object to populate the map from.
164
+ * @param {object} [json] - The JSON object to populate the map from.
166
165
  * @returns {this} The current instance for chaining.
167
166
  */
168
167
  fromJSON(json) {
@@ -178,7 +177,7 @@ class FontsManager {
178
177
  }
179
178
  /**
180
179
  * Populates the font map from an array of fonts.
181
- * @param array {Font[]} - The array of fonts to populate the map from.
180
+ * @param {Font[]} [array] - The array of fonts to populate the map from.
182
181
  * @returns {this} The current instance for chaining.
183
182
  */
184
183
  fromArray(array) {