nexfep 0.5.5 → 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.
package/README.md CHANGED
@@ -41,7 +41,10 @@ import { Application } from "nexfep";
41
41
 
42
42
  const app = new Application();
43
43
 
44
- const window = await app.windows.createWindow(true, false);
44
+ const window = await app.windows.createWindow({
45
+ visible: true,
46
+ decoration: false,
47
+ });
45
48
 
46
49
  await window.loadHTML("<h1 nexfep-area-drag>Hello Nexfep!</h1>");
47
50
  ```
@@ -81,11 +84,37 @@ const app = new Application({ LogFilePath: "./app.log" });
81
84
  - `createLocker(appName)` — Create an application instance lock to prevent multiple instances
82
85
  - `exit()` — Exit the application
83
86
 
87
+ ### Icon
88
+
89
+ `Icon` represents an image resource that can be used as a window icon, tray icon, etc.
90
+
91
+ ```typescript
92
+ import { Icon } from "nexfep";
93
+
94
+ // Create from file path
95
+ const icon = Icon.from("./icon.png");
96
+
97
+ // Create from Buffer or Uint8Array
98
+ const icon = Icon.from(buffer);
99
+ const icon = Icon.from(uint8Array);
100
+
101
+ // Create from an object containing data/width/height
102
+ const icon = Icon.from({ data: buffer, width: 64, height: 64 });
103
+ const icon = Icon.from({ data: uint8Array, width: 64, height: 64 });
104
+ ```
105
+
106
+ **Static Methods**
107
+
108
+ | Method | Parameters | Return Value | Description |
109
+ | ------------------ | ----------------------------------------------------------------------------------------- | ------------ | ------------------------ |
110
+ | `Icon.from(input)` | `string` \| `Buffer` \| `Uint8Array` \| `{ data: Uint8Array \| Buffer, width?, height? }` | `Icon` | Creates an icon instance |
111
+
84
112
  ### Logger
85
113
 
86
114
  The logger supports both file output and colored console output. It can be accessed via `app.logger`.
87
115
 
88
116
  ```typescript
117
+ app.logger.clear();
89
118
  app.logger.log("Hello World");
90
119
  app.logger.error("An error occurred");
91
120
  app.logger.warn("Warning message");
@@ -95,13 +124,14 @@ app.logger.debug("Debug message");
95
124
 
96
125
  **Methods**
97
126
 
98
- | Method | Description |
99
- | ---------------- | ------------------------------ |
100
- | `log(message)` | Log a message |
101
- | `error(message)` | Log an error message (red) |
102
- | `warn(message)` | Log a warning message (yellow) |
103
- | `info(message)` | Log an info message (blue) |
104
- | `debug(message)` | Log a debug message (gray) |
127
+ | Method | Description |
128
+ | ---------------- | ------------------------------------------------------------------------------ |
129
+ | `clear()` | Clear the log file (only takes effect when the `LogFilePath` parameter is set) |
130
+ | `log(message)` | Log a message |
131
+ | `error(message)` | Log an error message (red) |
132
+ | `warn(message)` | Log a warning message (yellow) |
133
+ | `info(message)` | Log an info message (blue) |
134
+ | `debug(message)` | Log a debug message (gray) |
105
135
 
106
136
  Each method accepts either a string or an array of strings.
107
137
 
@@ -118,15 +148,22 @@ const locker = app.createLocker("my-app");
118
148
  try {
119
149
  // Try to acquire the lock
120
150
  await locker.lock();
151
+ // You can also pass data to the other instance when acquiring the lock
152
+ // await locker.lock(process.argv[2]);
121
153
  } catch {
122
154
  // Instance already exists, exit the application
123
155
  app.exit();
124
156
  }
125
157
  // Focus the current instance when other instances acquire the lock
126
- locker.whenLost(() => {
158
+ locker.whenLost((data) => {
127
159
  if (!win.isFocused()) {
128
160
  win.focus();
129
161
  }
162
+ // If the other instance passed data, you can use it to perform specific actions
163
+ // If no data was passed, data will be null
164
+ if (data) {
165
+ console.log("Other instance passed data:", data);
166
+ }
130
167
  });
131
168
  // Release the lock
132
169
  locker.unlock();
@@ -134,7 +171,7 @@ locker.unlock();
134
171
 
135
172
  **Methods**
136
173
 
137
- - `lock()` — Try to acquire the lock
174
+ - `lock(data?)` — Try to acquire the lock
138
175
  - `whenLost(callback)` — Register a callback to be called when other instances acquire the lock
139
176
  - `unlock()` — Release the lock
140
177
 
@@ -143,16 +180,14 @@ locker.unlock();
143
180
  Create and manage system tray icons with context menus via `app.createTray()`.
144
181
 
145
182
  ```typescript
146
- import { readFileSync } from "fs";
183
+ import { Icon } from "nexfep";
184
+
185
+ const icon = Icon.from("./icon.png");
147
186
 
148
187
  const tray = app.createTray({
149
188
  id: "my-tray",
150
189
  tooltip: "My App",
151
- icon: {
152
- data: readFileSync("./icon.png"),
153
- width: 32,
154
- height: 32,
155
- },
190
+ icon: icon, // Icon instance
156
191
  menuItems: [
157
192
  { id: "show", label: "Show Window" },
158
193
  { id: "quit", label: "Quit" },
@@ -160,29 +195,19 @@ const tray = app.createTray({
160
195
  });
161
196
  ```
162
197
 
163
- The `icon` field accepts a `TrayIconImage` object:
164
-
165
- ```typescript
166
- interface TrayIconImage {
167
- data: Buffer; // Image binary data
168
- width?: number; // Optional width
169
- height?: number; // Optional height
170
- }
171
- ```
172
-
173
198
  **Methods**
174
199
 
175
- | Method | Description |
176
- | -------------------------------- | ------------------------------------------------------------------ |
177
- | `addMenuItem(item)` | Add a menu item |
178
- | `removeMenuItem(id)` | Remove a menu item by ID |
179
- | `setMenuItems(items)` | Replace all menu items |
180
- | `setIcon(icon, width?, height?)` | Change the tray icon (raw pixel data as `Uint8Array` / `number[]`) |
181
- | `setTooltip(tooltip)` | Change the tooltip text |
182
- | `on(event, callback)` | Listen for tray events (e.g. `'click'`) |
183
- | `show()` | Show the tray icon |
184
- | `hide()` | Hide the tray icon |
185
- | `destroy()` | Destroy the tray icon |
200
+ | Method | Description |
201
+ | --------------------- | ------------------------------------------------ |
202
+ | `addMenuItem(item)` | Add a menu item |
203
+ | `removeMenuItem(id)` | Remove a menu item by ID |
204
+ | `setMenuItems(items)` | Replace all menu items |
205
+ | `setIcon(icon)` | Change the tray icon, accepts an `Icon` instance |
206
+ | `setTooltip(tooltip)` | Change the tooltip text |
207
+ | `on(event, callback)` | Listen for tray events (e.g. `'click'`) |
208
+ | `show()` | Show the tray icon |
209
+ | `hide()` | Hide the tray icon |
210
+ | `destroy()` | Destroy the tray icon |
186
211
 
187
212
  ```typescript
188
213
  tray.on("click", () => {
@@ -197,13 +222,14 @@ tray.setTooltip("Nexfep App");
197
222
  Send desktop notifications via `app.utils.notify()`.
198
223
 
199
224
  ```typescript
200
- const notification = app.utils.notify("Title", "Notification body");
225
+ const notification = app.utils.notify("Title", { body: "Notification body" });
201
226
  ```
202
227
 
203
228
  **Parameters**
204
229
 
205
230
  - `title` — Notification title
206
- - `body` (optional) — Notification body text
231
+ - `options` (optional) — Configuration object
232
+ - `body` — Notification body text
207
233
 
208
234
  ### Window Pool
209
235
 
@@ -216,13 +242,38 @@ const pool = app.windows;
216
242
  ### Window Creation
217
243
 
218
244
  ```typescript
219
- const win = await pool.createWindow(true, false);
245
+ // Use all defaults by omitting parameters
246
+ const win = await pool.createWindow();
247
+
248
+ // Pass partial parameters
249
+ const win = await pool.createWindow({
250
+ visible: true,
251
+ title: "My App",
252
+ });
253
+
254
+ // All parameters
255
+ const win = await pool.createWindow({
256
+ visible: true, // Whether to show immediately, default true
257
+ decoration: true, // Whether to use system decorations, default true
258
+ title: "My App", // Window title, default "Nexfep Window"
259
+ icon: iconInstance, // Window icon, Icon instance, optional
260
+ resizable: true, // Whether the window is resizable, default true
261
+ width: 800, // Window width, default 800
262
+ height: 600, // Window height, default 600
263
+ });
220
264
  ```
221
265
 
222
266
  **Parameters**
223
267
 
224
- - `isShow` (boolean, default `true`) — Whether to immediately show the window
225
- - `isDecorated` (boolean, default `true`) — Whether to use system window decorations. When set to `false`, the window has no border and requires a custom title bar
268
+ | Option | Type | Default | Description |
269
+ | ------------ | --------- | ----------------- | ---------------------------------------------------------------------------------------------------------------- |
270
+ | `visible` | `boolean` | `true` | Whether to immediately show the window |
271
+ | `decoration` | `boolean` | `true` | Whether to use system window decorations. When `false`, the window has no border and requires a custom title bar |
272
+ | `title` | `string` | `"Nexfep Window"` | Window title |
273
+ | `icon` | `Icon` | none | Window icon |
274
+ | `resizable` | `boolean` | `true` | Whether the window is resizable |
275
+ | `width` | `number` | `800` | Window width in pixels |
276
+ | `height` | `number` | `600` | Window height in pixels |
226
277
 
227
278
  ### Window Operations
228
279
 
@@ -358,6 +409,12 @@ window.addEventListener("user-login", (event) => {
358
409
  });
359
410
  ```
360
411
 
412
+ The main process can send events to all open windows via `pool.broadcast`, with parameters identical to those of `window.broadcast` in the page:
413
+
414
+ ```typescript
415
+ pool.broadcast("user-login", { userId: 123 });
416
+ ```
417
+
361
418
  #### Tell
362
419
 
363
420
  Send a message to a specific window by its ID via `window.tell`:
@@ -386,6 +443,12 @@ Each window's ID can be accessed via `window.id`:
386
443
  console.log("This window ID:", window.id);
387
444
  ```
388
445
 
446
+ The main process can also send messages to this window through `win.tell`:
447
+
448
+ ```typescript
449
+ win.tell("custom-message", { text: `Hello Window ${win.id}` });
450
+ ```
451
+
389
452
  ### Custom Messages
390
453
 
391
454
  #### Send Messages
@@ -584,44 +647,47 @@ Please do not include the outer `metadata` field, just the internal fields. Like
584
647
 
585
648
  ### WindowPool
586
649
 
587
- | Method/Property | Parameters | Return Value | Description |
588
- | ------------------------------------- | ----------------------------------------------------------------------- | ----------------- | ------------------------------------------------------ |
589
- | `createWindow(isShow?, isDecorated?)` | `isShow`: boolean (default true), `isDecorated`: boolean (default true) | Promise\<Window> | Creates and returns a window |
590
- | `handle(event, callback)` | `event`: string, `callback`: (data: any) => any | None | Listens for the specified event |
591
- | `unhandle(event, callback)` | `event`: string, `callback`: (data: any) => any | None | Removes the specified event listener |
592
- | `global` | / | Map\<string, any> | A global variable map |
593
- | `closeWindow(window)` | `window`: Window | Promise\<void> | Closes the specified window and returns it to the pool |
594
- | `onCustomMessage` | `(window: Window, data: string) => void` | None | Custom message callback |
650
+ | Method/Property | Parameters | Return Value | Description |
651
+ | --------------------------- | ------------------------------------------------------ | ----------------- | ------------------------------------------------------ |
652
+ | `createWindow(options?)` | Optional parameters, see Window Creation section above | Promise\<Window> | Creates and returns a window |
653
+ | `handle(event, callback)` | `event`: string, `callback`: (data: any) => any | None | Listens for the specified event |
654
+ | `unhandle(event, callback)` | `event`: string, `callback`: (data: any) => any | None | Removes the specified event listener |
655
+ | `global` | / | Map\<string, any> | A global variable map |
656
+ | `closeWindow(window)` | `window`: Window | Promise\<void> | Closes the specified window and returns it to the pool |
657
+ | `onCustomMessage` | `(window: Window, data: string) => void` | None | Custom message callback |
595
658
 
596
659
  ### Window
597
660
 
598
- | Method/Property | Parameters | Return Value | Description |
599
- | --------------------------- | --------------------------------- | --------------------------------- | ------------------------------------------------- |
600
- | `loadURL(url)` | `url`: string — URL to load | Promise\<void> | Loads the specified URL |
601
- | `loadHTML(html)` | `html`: string — HTML string | Promise\<void> | Loads the specified HTML content |
602
- | `show()` | None | void | Shows the window |
603
- | `hide()` | None | void | Hides the window |
604
- | `maximize()` | None | void | Maximizes the window |
605
- | `unMaximize()` | None | void | Restores the window (cancels maximize) |
606
- | `minimize()` | None | void | Minimizes the window |
607
- | `unMinimize()` | None | void | Restores the window (cancels minimize) |
608
- | `close()` | None | void | Closes the window and returns to pool |
609
- | `setTitle(title)` | `title`: string | void | Sets the window title |
610
- | `setDecorated(isDecorated)` | `isDecorated`: boolean | void | Sets whether the window has borders and title bar |
611
- | `resizable(resizable)` | `resizable`: boolean | void | Sets whether the window is resizable |
612
- | `setSize(width, height)` | `width`: number, `height`: number | void | Sets the window size in pixels |
613
- | `getSize()` | None | { width: number, height: number } | Gets the window size in pixels |
614
- | `setPosition(x, y)` | `x`: number, `y`: number | void | Sets the window position in pixels |
615
- | `getPosition()` | None | { x: number, y: number } | Gets the window position in pixels |
616
- | `isMaximized()` | None | boolean | Whether the window is maximized |
617
- | `isMinimized()` | None | boolean | Whether the window is minimized |
618
- | `toggleMaximize()` | None | void | Toggles the window maximized state |
619
- | `toggleMinimize()` | None | void | Toggles the window minimized state |
620
- | `isFocused()` | None | boolean | Whether the window has focused |
621
- | `focus()` | None | void | Focuses the window |
622
- | `openDevTools()` | None | void | Opens developer tools |
623
- | `closeDevTools()` | None | void | Closes developer tools |
624
- | `id` | None | number | Unique window identifier, auto-incrementing |
661
+ | Method/Property | Parameters | Return Value | Description |
662
+ | --------------------------------------- | ----------------------------------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------- |
663
+ | `loadURL(url)` | `url`: string — URL to load | Promise\<void> | Loads the specified URL |
664
+ | `loadHTML(html)` | `html`: string — HTML string | Promise\<void> | Loads the specified HTML content |
665
+ | `show()` | None | void | Shows the window |
666
+ | `hide()` | None | void | Hides the window |
667
+ | `maximize()` | None | void | Maximizes the window |
668
+ | `unMaximize()` | None | void | Restores the window (cancels maximize) |
669
+ | `minimize()` | None | void | Minimizes the window |
670
+ | `unMinimize()` | None | void | Restores the window (cancels minimize) |
671
+ | `close()` | None | void | Closes the window and returns to pool |
672
+ | `setTitle(title)` | `title`: string | void | Sets the window title |
673
+ | `setDecorated(isDecorated)` | `isDecorated`: boolean | void | Sets whether the window has borders and title bar |
674
+ | `setResizable(resizable)` | `resizable`: boolean | void | Sets whether the window is resizable |
675
+ | `setLevel(level)` | `level`: `-1` \| `0` \| `1` | void | Sets window level: -1=bottom, 0=normal, 1=top |
676
+ | `setFullScreen(isFullScreen, options?)` | `isFullScreen`: `boolean`, `options?`: `{ borderless?: boolean }` | void | Sets fullscreen mode. `borderless: true` for borderless fullscreen, otherwise exclusive fullscreen |
677
+ | `setIcon(icon)` | `icon`: `Icon` | void | Sets the window icon |
678
+ | `setSize(width, height)` | `width`: number, `height`: number | void | Sets the window size in pixels |
679
+ | `getSize()` | None | { width: number, height: number } | Gets the window size in pixels |
680
+ | `setPosition(x, y)` | `x`: number, `y`: number | void | Sets the window position in pixels |
681
+ | `getPosition()` | None | { x: number, y: number } | Gets the window position in pixels |
682
+ | `focus()` | None | void | Focuses the window |
683
+ | `isFocused()` | None | boolean | Whether the window has focus |
684
+ | `isMaximized()` | None | boolean | Whether the window is maximized |
685
+ | `isMinimized()` | None | boolean | Whether the window is minimized |
686
+ | `toggleMaximize()` | None | void | Toggles the window maximized state |
687
+ | `toggleMinimize()` | None | void | Toggles the window minimized state |
688
+ | `openDevTools()` | None | void | Opens developer tools |
689
+ | `closeDevTools()` | None | void | Closes developer tools |
690
+ | `id` | None | number | Unique window identifier, auto-incrementing |
625
691
 
626
692
  ## Development
627
693
 
@@ -1,23 +1,23 @@
1
- export {}
1
+ export {};
2
2
 
3
3
  declare global {
4
4
  interface Window {
5
- tell: (to: number, message: string, data?: any) => void
6
- broadcast: (message: string, data?: any) => void
7
- invoke: (event: string, data?: any) => Promise<any>
8
- close: () => void
9
- minimize: () => void
10
- unminimize: () => void
11
- toggleMaximize: () => void
12
- toggleMinimize: () => void
13
- maximize: () => void
14
- unmaximize: () => void
15
- setTitle: (title: string) => void
16
- openDevTools: () => void
17
- closeDevTools: () => void
18
- setGlobal: (name: string, value: any) => void
19
- getGlobal: (name: string) => Promise<any>
20
- id: number
21
- isNexfepLoadDone: boolean
5
+ tell: (to: number, message: string, data?: any) => void;
6
+ broadcast: (message: string, data?: any) => void;
7
+ invoke: (event: string, data?: any) => Promise<any>;
8
+ close: () => void;
9
+ minimize: () => void;
10
+ unminimize: () => void;
11
+ toggleMaximize: () => void;
12
+ toggleMinimize: () => void;
13
+ maximize: () => void;
14
+ unmaximize: () => void;
15
+ setTitle: (title: string) => void;
16
+ openDevTools: () => void;
17
+ closeDevTools: () => void;
18
+ setGlobal: (name: string, value: any) => void;
19
+ getGlobal: (name: string) => Promise<any>;
20
+ id: number;
21
+ isNexfepLoadDone: boolean;
22
22
  }
23
- }
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexfep",
3
- "version": "0.5.5",
3
+ "version": "0.6.1",
4
4
  "description": "A desktop application framework based on @webviewjs/webview",
5
5
  "keywords": [
6
6
  "@webviewjs/webview",
@@ -20,12 +20,6 @@
20
20
  "bin": {
21
21
  "nexfep": "cli/index.mjs"
22
22
  },
23
- "typesVersions": {
24
- "*": {
25
- ".": ["./index.d.ts"],
26
- "frontend": ["./frontend/index.d.ts"]
27
- }
28
- },
29
23
  "files": [
30
24
  "index.js",
31
25
  "index.d.ts",
@@ -47,10 +41,22 @@
47
41
  "src/Logger.d.ts",
48
42
  "src/SingleInstance.js",
49
43
  "src/SingleInstance.d.ts",
44
+ "src/Icon.js",
45
+ "src/Icon.d.ts",
50
46
  "frontend/index.d.ts"
51
47
  ],
52
48
  "type": "module",
53
49
  "main": "./index.js",
50
+ "typesVersions": {
51
+ "*": {
52
+ ".": [
53
+ "./index.d.ts"
54
+ ],
55
+ "frontend": [
56
+ "./frontend/index.d.ts"
57
+ ]
58
+ }
59
+ },
54
60
  "scripts": {
55
61
  "compile": "tsc",
56
62
  "fmt": "oxfmt --check",
@@ -59,7 +65,7 @@
59
65
  "lint:fix": "oxlint --fix"
60
66
  },
61
67
  "dependencies": {
62
- "@nexfteam/single-instance": "^0.0.7",
68
+ "@nexfteam/single-instance": "0.0.8",
63
69
  "@webviewjs/webview": "0.4.1"
64
70
  },
65
71
  "devDependencies": {
@@ -1,12 +1,15 @@
1
- import { Application as WebviewApplication, TrayIconImage, Notification } from "@webviewjs/webview";
1
+ import { Application as WebviewApplication, Notification } from "@webviewjs/webview";
2
2
  import { WindowPool } from "./WindowManager.js";
3
3
  import { Tray } from "./Tray.js";
4
4
  import { Logger } from "./Logger.js";
5
5
  import { Locker } from "./SingleInstance.js";
6
+ import { Icon } from "./Icon.js";
6
7
  declare class __Utils {
7
8
  app: WebviewApplication;
8
9
  constructor(app: WebviewApplication);
9
- notify(title: string, body?: string): Notification;
10
+ notify(title: string, options?: {
11
+ body?: string;
12
+ }): Notification;
10
13
  }
11
14
  declare class Application {
12
15
  app: WebviewApplication;
@@ -20,7 +23,7 @@ declare class Application {
20
23
  createTray(options: {
21
24
  id: string;
22
25
  tooltip: string;
23
- icon: TrayIconImage | undefined;
26
+ icon?: Icon;
24
27
  menuItems: Array<{
25
28
  id: string;
26
29
  label: string;
@@ -29,4 +32,4 @@ declare class Application {
29
32
  createLocker(appName: string): Locker;
30
33
  exit(): void;
31
34
  }
32
- export { Application };
35
+ export { Application, Icon };
@@ -3,13 +3,14 @@ import { WindowPool } from "./WindowManager.js";
3
3
  import { Tray } from "./Tray.js";
4
4
  import { Logger } from "./Logger.js";
5
5
  import { Locker } from "./SingleInstance.js";
6
+ import { Icon } from "./Icon.js";
6
7
  class __Utils {
7
8
  app;
8
9
  constructor(app) {
9
10
  this.app = app;
10
11
  }
11
- notify(title, body) {
12
- const notification = new Notification(title, { body });
12
+ notify(title, options) {
13
+ const notification = new Notification(title, { body: options?.body });
13
14
  return notification;
14
15
  }
15
16
  }
@@ -39,4 +40,4 @@ class Application {
39
40
  this.app.exit();
40
41
  }
41
42
  }
42
- export { Application };
43
+ export { Application, Icon };
package/src/Icon.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { TrayIconImage } from "@webviewjs/webview";
2
+ declare class Icon {
3
+ data: Uint8Array;
4
+ width?: number;
5
+ height?: number;
6
+ constructor(data: Uint8Array, width?: number, height?: number);
7
+ static from(input: string | Buffer | Uint8Array | {
8
+ data: Uint8Array;
9
+ width?: number;
10
+ height?: number;
11
+ } | {
12
+ data: Buffer;
13
+ width?: number;
14
+ height?: number;
15
+ }): Icon;
16
+ toTrayIconImage(): TrayIconImage;
17
+ toBuffer(): Buffer;
18
+ }
19
+ export { Icon };
package/src/Icon.js ADDED
@@ -0,0 +1,36 @@
1
+ import fs from "fs";
2
+ class Icon {
3
+ data;
4
+ width;
5
+ height;
6
+ constructor(data, width, height) {
7
+ this.data = data;
8
+ this.width = width;
9
+ this.height = height;
10
+ }
11
+ static from(input) {
12
+ if (typeof input === "string") {
13
+ return new Icon(new Uint8Array(fs.readFileSync(input)));
14
+ }
15
+ else if (input instanceof Uint8Array) {
16
+ return new Icon(input);
17
+ }
18
+ else if (input instanceof Buffer) {
19
+ return new Icon(new Uint8Array(input));
20
+ }
21
+ else if (typeof input === "object" && input.data instanceof Uint8Array) {
22
+ return new Icon(input.data, input.width, input.height);
23
+ }
24
+ else if (typeof input === "object" && input.data instanceof Buffer) {
25
+ return new Icon(new Uint8Array(input.data), input.width, input.height);
26
+ }
27
+ throw new Error("Unsupported input type");
28
+ }
29
+ toTrayIconImage() {
30
+ return { data: Buffer.from(this.data), width: this.width, height: this.height };
31
+ }
32
+ toBuffer() {
33
+ return Buffer.from(this.data);
34
+ }
35
+ }
36
+ export { Icon };
package/src/Logger.d.ts CHANGED
@@ -8,5 +8,6 @@ declare class Logger {
8
8
  warn(args: string[] | string): void;
9
9
  info(args: string[] | string): void;
10
10
  debug(args: string[] | string): void;
11
+ clear(): void;
11
12
  }
12
13
  export { Logger };