webserial-core 1.1.4 → 1.2.0

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  An easy way to connect to a serial port from a web page.
4
4
 
5
- [![CI](https://github.com/danidoble/webserial-core/actions/workflows/ci.yml/badge.svg)](https://github.com/danidoble/webserial-core/actions/workflows/ci.yml)
5
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/danidoble/webserial-core)
6
6
  [![npm version](https://badge.fury.io/js/webserial-core.svg)](https://www.npmjs.com/package/webserial-core)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
8
 
@@ -37,6 +37,7 @@ type PortInfo = {
37
37
  parser: ParserSocketPort;
38
38
  };
39
39
  type SerialData = {
40
+ transformStream: false | TransformStream;
40
41
  socket: boolean;
41
42
  portInfo: PortInfo;
42
43
  aux_connecting: string;
@@ -92,6 +93,7 @@ interface CoreConstructorParams {
92
93
  device_listen_on_channel?: number | string;
93
94
  bypassSerialBytesConnection?: boolean;
94
95
  socket?: boolean;
96
+ transformStream?: false | TransformStream;
95
97
  }
96
98
  interface CustomCode {
97
99
  code: string | Uint8Array | Array<string> | Array<number>;
@@ -166,7 +168,7 @@ interface ICore {
166
168
  export declare class Core extends Dispatcher implements ICore {
167
169
  #private;
168
170
  protected __internal__: Internal;
169
- constructor({ filters, config_port, no_device, device_listen_on_channel, bypassSerialBytesConnection, socket, }?: CoreConstructorParams);
171
+ constructor({ filters, config_port, no_device, device_listen_on_channel, bypassSerialBytesConnection, socket, transformStream, }?: CoreConstructorParams);
170
172
  set listenOnChannel(channel: string | number);
171
173
  get lastAction(): string | null;
172
174
  get listenOnChannel(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"Core.d.ts","sourceRoot":"","sources":["../../lib/Core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU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,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI;IAgBxG,gBAAgB,IAAI,IAAI;IAIxB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM;IAQ7B,QAAQ,IAAI,MAAM;IAUlB,UAAU,IAAI,IAAI;IAKZ,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B,cAAc,CAAC,EAAE,IAAS,EAAE,GAAE,UAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7E,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IAI1C,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,MAAa,GAAG,eAAe;IAIxE,wBAAwB,CAAC,MAAM,GAAE,MAAW,EAAE,GAAG,GAAE,MAAa,GAAG,UAAU;IAM7E,kBAAkB,CAAC,MAAM,GAAE,MAAW,EAAE,GAAG,GAAE,MAAa,GAAG,MAAM,EAAE;IAKrE,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE;IAI5C,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU;IAI5C,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU;IAatD,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM;IAgB7D,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IASxC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IASvC,2BAA2B,IAAI,OAAO;CAG9C"}
@@ -7,12 +7,13 @@ interface SocketResponseData {
7
7
  }
8
8
  declare class MySocket {
9
9
  #private;
10
- constructor();
10
+ constructor(uri?: string, options?: Partial<ManagerOptions & SocketOptions>);
11
11
  set uri(uri: string);
12
12
  get uri(): string;
13
13
  set options(options: Partial<ManagerOptions & SocketOptions>);
14
14
  get options(): Partial<ManagerOptions & SocketOptions>;
15
15
  get socketId(): string | null;
16
+ configure(uri?: string, options?: Partial<ManagerOptions & SocketOptions>): void;
16
17
  disconnect(): void;
17
18
  prepare(): void;
18
19
  connectDevice(config: object): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Socket.d.ts","sourceRoot":"","sources":["../../lib/Socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAE,aAAa,EAA4B,MAAM,kBAAkB,CAAC;AAI/F,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AASD,cAAM,QAAQ;;;IAgCZ,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,EAOlB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,EAK3D;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,CAErD;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,UAAU;IAcV,OAAO;IAaP,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAOnC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAOtC,oBAAoB,IAAI,IAAI;IAO5B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAOzB,UAAU,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAW1C,WAAW,IAAI,OAAO;IAItB,cAAc,IAAI,OAAO;CAG1B;AAED,eAAO,MAAM,MAAM,UAAiB,CAAC"}
1
+ {"version":3,"file":"Socket.d.ts","sourceRoot":"","sources":["../../lib/Socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAE,aAAa,EAA4B,MAAM,kBAAkB,CAAC;AAI/F,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AASD,cAAM,QAAQ;;gBAWA,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC;IA4B3E,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,EAOlB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,EAK3D;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,CAErD;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,GAAG,IAAI;IAYhF,UAAU;IAcV,OAAO;IAaP,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAOnC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAOtC,oBAAoB,IAAI,IAAI;IAO5B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAOzB,UAAU,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAW1C,WAAW,IAAI,OAAO;IAItB,cAAc,IAAI,OAAO;CAG1B;AAED,eAAO,MAAM,MAAM,UAAiB,CAAC"}
@@ -4,7 +4,7 @@ class g extends CustomEvent {
4
4
  super(e, t);
5
5
  }
6
6
  }
7
- class m extends EventTarget {
7
+ class y extends EventTarget {
8
8
  __listeners__ = {
9
9
  debug: !1
10
10
  };
@@ -105,7 +105,7 @@ class m extends EventTarget {
105
105
  this.__listeners__[e] = !1;
106
106
  }
107
107
  }
108
- class s extends m {
108
+ class s extends y {
109
109
  static instance;
110
110
  static devices = {};
111
111
  constructor() {
@@ -207,22 +207,22 @@ class s extends m {
207
207
  }
208
208
  }
209
209
  s.instance || (s.instance = new s());
210
- function y(o = 100) {
210
+ function m(a = 100) {
211
211
  return new Promise(
212
- (e) => setTimeout(() => e(), o)
212
+ (e) => setTimeout(() => e(), a)
213
213
  );
214
214
  }
215
215
  class C {
216
- #n = "http://localhost:3000";
217
- #i = {
216
+ #i = "http://localhost:3001";
217
+ #t = {
218
218
  transports: ["websocket"]
219
219
  };
220
220
  #e = null;
221
221
  #s = !1;
222
222
  #a = !1;
223
- #t;
224
- constructor() {
225
- this.#t = {
223
+ #n;
224
+ constructor(e, t) {
225
+ e && (this.#i = e), t && (this.#t = { ...this.#t, ...t }), this.#n = {
226
226
  onResponse: this.onResponse.bind(this),
227
227
  onDisconnect: () => {
228
228
  this.#s = !1, window.dispatchEvent(new Event("serial:socket:disconnected"));
@@ -230,8 +230,8 @@ class C {
230
230
  onConnect: () => {
231
231
  this.#s = !0, window.dispatchEvent(new Event("serial:socket:connected"));
232
232
  },
233
- onConnectError: (e) => {
234
- console.debug("Socket connection error", e), this.#s = !1, window.dispatchEvent(new Event("serial:socket:disconnected"));
233
+ onConnectError: (n) => {
234
+ console.debug("Socket connection error", n), this.#s = !1, window.dispatchEvent(new Event("serial:socket:disconnected"));
235
235
  }
236
236
  };
237
237
  }
@@ -239,27 +239,32 @@ class C {
239
239
  const t = new URL(e);
240
240
  if (!["http:", "https:", "ws:", "wss:"].includes(t.protocol))
241
241
  throw new Error("URI must start with http://, https://, ws://, or wss://");
242
- this.#n = e;
242
+ this.#i = e;
243
243
  }
244
244
  get uri() {
245
- return this.#n;
245
+ return this.#i;
246
246
  }
247
247
  set options(e) {
248
248
  if (typeof e != "object")
249
249
  throw new Error("Options must be an object");
250
- this.#i = e;
250
+ this.#t = e;
251
251
  }
252
252
  get options() {
253
- return this.#i;
253
+ return this.#t;
254
254
  }
255
255
  get socketId() {
256
256
  return this.#e && this.#e.id ? this.#e.id : null;
257
257
  }
258
+ configure(e, t) {
259
+ if (this.#a)
260
+ throw new Error("Cannot configure socket after it has been initialized. Call configure() before prepare().");
261
+ e && (this.uri = e), t && (this.#t = { ...this.#t, ...t });
262
+ }
258
263
  disconnect() {
259
- this.#e && (this.#e.off("response", this.#t.onResponse), this.#e.off("disconnect", this.#t.onDisconnect), this.#e.off("connect", this.#t.onConnect), this.#e.off("connect_error", this.#t.onConnectError), this.#e.disconnect(), this.#e = null, this.#a = !1), this.#s = !1;
264
+ this.#e && (this.#e.off("response", this.#n.onResponse), this.#e.off("disconnect", this.#n.onDisconnect), this.#e.off("connect", this.#n.onConnect), this.#e.off("connect_error", this.#n.onConnectError), this.#e.disconnect(), this.#e = null, this.#a = !1), this.#s = !1;
260
265
  }
261
266
  prepare() {
262
- this.#s || this.#a || (this.#e = b(this.#n, this.#i), this.#a = !0, this.#e.on("disconnect", this.#t.onDisconnect), this.#e.on("response", this.#t.onResponse), this.#e.on("connect", this.#t.onConnect), this.#e.on("connect_error", this.#t.onConnectError));
267
+ this.#s || this.#a || (this.#e = b(this.#i, this.#t), this.#a = !0, this.#e.on("disconnect", this.#n.onDisconnect), this.#e.on("response", this.#n.onResponse), this.#e.on("connect", this.#n.onConnect), this.#e.on("connect_error", this.#n.onConnectError));
263
268
  }
264
269
  connectDevice(e) {
265
270
  if (!this.#e)
@@ -292,7 +297,7 @@ class C {
292
297
  return !this.#s;
293
298
  }
294
299
  }
295
- const c = new C(), p = {
300
+ const c = new C(), f = {
296
301
  baudRate: 9600,
297
302
  dataBits: 8,
298
303
  stopBits: 1,
@@ -300,7 +305,7 @@ const c = new C(), p = {
300
305
  bufferSize: 32768,
301
306
  flowControl: "none"
302
307
  };
303
- class S extends m {
308
+ class T extends y {
304
309
  __internal__ = {
305
310
  bypassSerialBytesConnection: !1,
306
311
  auto_response: !1,
@@ -313,6 +318,7 @@ class S extends m {
313
318
  no_code: 0
314
319
  },
315
320
  serial: {
321
+ transformStream: !1,
316
322
  socket: !1,
317
323
  portInfo: {
318
324
  path: null,
@@ -348,7 +354,7 @@ class S extends m {
348
354
  delay_first_connection: 200,
349
355
  bytes_connection: null,
350
356
  filters: [],
351
- config_port: p,
357
+ config_port: f,
352
358
  queue: [],
353
359
  running_queue: !1,
354
360
  auto_response: null,
@@ -374,25 +380,27 @@ class S extends m {
374
380
  reconnection: 0
375
381
  }
376
382
  };
377
- #n = null;
383
+ #i = null;
378
384
  constructor({
379
385
  filters: e = null,
380
- config_port: t = p,
386
+ config_port: t = f,
381
387
  no_device: n = 1,
382
388
  device_listen_on_channel: i = 1,
383
- bypassSerialBytesConnection: a = !1,
384
- socket: r = !1
389
+ bypassSerialBytesConnection: o = !1,
390
+ socket: r = !1,
391
+ transformStream: h = !1
385
392
  } = {
386
393
  filters: null,
387
- config_port: p,
394
+ config_port: f,
388
395
  no_device: 1,
389
396
  device_listen_on_channel: 1,
390
397
  bypassSerialBytesConnection: !1,
391
- socket: !1
398
+ socket: !1,
399
+ transformStream: !1
392
400
  }) {
393
401
  if (super(), !("serial" in navigator))
394
402
  throw new Error("Web Serial not supported");
395
- e && (this.serialFilters = e), t && (this.serialConfigPort = t), a && (this.__internal__.bypassSerialBytesConnection = a), n && this.#b(n), i && ["number", "string"].includes(typeof i) && (this.listenOnChannel = i), this.__internal__.serial.socket = r, this.#g(), this.#y();
403
+ e && (this.serialFilters = e), t && (this.serialConfigPort = t), o && (this.__internal__.bypassSerialBytesConnection = o), n && this.#C(n), i && ["number", "string"].includes(typeof i) && (this.listenOnChannel = i), this.__internal__.serial.socket = r, this.__internal__.serial.transformStream = h, this.#m(), this.#y();
396
404
  }
397
405
  set listenOnChannel(e) {
398
406
  if (typeof e == "string" && (e = parseInt(e)), isNaN(e) || e < 1 || e > 255)
@@ -426,14 +434,14 @@ class S extends m {
426
434
  this.__internal__.serial.useRTSCTS = e;
427
435
  }
428
436
  get isConnected() {
429
- const e = this.__internal__.serial.connected, t = this.#i(this.__internal__.serial.port);
437
+ const e = this.__internal__.serial.connected, t = this.#t(this.__internal__.serial.port);
430
438
  return e && !t && this.#e({ error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
431
439
  }
432
440
  get isConnecting() {
433
441
  return this.__internal__.serial.connecting;
434
442
  }
435
443
  get isDisconnected() {
436
- const e = this.__internal__.serial.connected, t = this.#i(this.__internal__.serial.port);
444
+ const e = this.__internal__.serial.connected, t = this.#t(this.__internal__.serial.port);
437
445
  return !e && t && (this.dispatch("serial:connected"), this.#o(!1), s.$dispatchChange(this)), this.__internal__.serial.connected = t, !this.__internal__.serial.connected;
438
446
  }
439
447
  get deviceNumber() {
@@ -607,7 +615,7 @@ class S extends m {
607
615
  }
608
616
  };
609
617
  }
610
- #i(e) {
618
+ #t(e) {
611
619
  return this.useSocket ? this.__internal__.serial.connected && c.isConnected() : !!(e && e.readable && e.writable);
612
620
  }
613
621
  async timeout(e, t) {
@@ -638,9 +646,9 @@ class S extends m {
638
646
  }
639
647
  async connect() {
640
648
  return this.isConnected ? !0 : (this.__internal__.serial.aux_connecting = "idle", new Promise((e, t) => {
641
- this.#n || (this.#n = this.#s.bind(this)), this.on("internal:connecting", this.#n);
649
+ this.#i || (this.#i = this.#s.bind(this)), this.on("internal:connecting", this.#i);
642
650
  const n = setInterval(() => {
643
- this.__internal__.serial.aux_connecting === "finished" ? (clearInterval(n), this.__internal__.serial.aux_connecting = "idle", this.#n !== null && this.off("internal:connecting", this.#n), this.isConnected ? e(!0) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`)) : this.__internal__.serial.aux_connecting === "connecting" && (this.__internal__.serial.aux_connecting = "idle", this.dispatch("internal:connecting", { active: !0 }), this.dispatch("serial:connecting", { active: !0 }));
651
+ this.__internal__.serial.aux_connecting === "finished" ? (clearInterval(n), this.__internal__.serial.aux_connecting = "idle", this.#i !== null && this.off("internal:connecting", this.#i), this.isConnected ? e(!0) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`)) : this.__internal__.serial.aux_connecting === "connecting" && (this.__internal__.serial.aux_connecting = "idle", this.dispatch("internal:connecting", { active: !0 }), this.dispatch("serial:connecting", { active: !0 }));
644
652
  }, 100);
645
653
  this.serialConnect();
646
654
  }));
@@ -667,7 +675,7 @@ class S extends m {
667
675
  const t = this.validateBytes(e);
668
676
  c.write({ config: this.configDeviceSocket, bytes: Array.from(t) });
669
677
  }
670
- async #t(e) {
678
+ async #n(e) {
671
679
  if (this.useSocket) {
672
680
  await this.#a(e);
673
681
  return;
@@ -687,22 +695,22 @@ class S extends m {
687
695
  throw new Error("Timeout waiting for clearToSend signal");
688
696
  const { clearToSend: i } = await e.getSignals();
689
697
  if (i) return;
690
- await y(100);
698
+ await m(100);
691
699
  }
692
700
  }
693
701
  #r(e = new Uint8Array([]), t = !1) {
694
702
  if (e && e.length > 0) {
695
703
  const n = this.__internal__.serial.connected;
696
- if (this.__internal__.serial.connected = this.#i(this.__internal__.serial.port), s.$dispatchChange(this), !n && this.__internal__.serial.connected && (this.dispatch("serial:connected"), this.#o(!1)), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0), this.__internal__.serial.response.as === "hex")
704
+ if (this.__internal__.serial.connected = this.#t(this.__internal__.serial.port), s.$dispatchChange(this), !n && this.__internal__.serial.connected && (this.dispatch("serial:connected"), this.#o(!1)), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0), this.__internal__.serial.response.as === "hex")
697
705
  t ? this.serialCorruptMessage(this.parseUint8ToHex(e)) : this.serialMessage(this.parseUint8ToHex(e));
698
706
  else if (this.__internal__.serial.response.as === "uint8")
699
707
  t ? this.serialCorruptMessage(e) : this.serialMessage(e);
700
708
  else if (this.__internal__.serial.response.as === "string") {
701
709
  const i = this.parseUint8ArrayToString(e);
702
710
  if (this.__internal__.serial.response.limiter !== null) {
703
- const a = i.split(this.__internal__.serial.response.limiter);
704
- for (const r in a)
705
- a[r] && (t ? this.serialCorruptMessage(a[r]) : this.serialMessage(a[r]));
711
+ const o = i.split(this.__internal__.serial.response.limiter);
712
+ for (const r in o)
713
+ o[r] && (t ? this.serialCorruptMessage(o[r]) : this.serialMessage(o[r]));
706
714
  } else
707
715
  t ? this.serialCorruptMessage(i) : this.serialMessage(i);
708
716
  } else {
@@ -731,9 +739,9 @@ class S extends m {
731
739
  async #_() {
732
740
  const e = this.serialFilters, t = await navigator.serial.getPorts({ filters: e });
733
741
  return e.length === 0 ? t : t.filter((i) => {
734
- const a = i.getInfo();
735
- return e.some((r) => a.usbProductId === r.usbProductId && a.usbVendorId === r.usbVendorId);
736
- }).filter((i) => !this.#i(i));
742
+ const o = i.getInfo();
743
+ return e.some((r) => o.usbProductId === r.usbProductId && o.usbVendorId === r.usbVendorId);
744
+ }).filter((i) => !this.#t(i));
737
745
  }
738
746
  async serialPortsSaved(e) {
739
747
  const t = this.serialFilters;
@@ -801,11 +809,14 @@ class S extends m {
801
809
  }
802
810
  }
803
811
  async #h() {
812
+ this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), this.__internal__.serial.response.buffer && this.#r(this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
813
+ }
814
+ async #u() {
804
815
  this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
805
816
  this.__internal__.serial.response.buffer && this.#r(this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
806
817
  }, this.__internal__.serial.free_timeout_ms || 50);
807
818
  }
808
- async #u() {
819
+ async #d() {
809
820
  const e = this.__internal__.serial.response.length;
810
821
  let t = this.__internal__.serial.response.buffer;
811
822
  if (this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), !(e === null || !t || t.length === 0)) {
@@ -818,7 +829,7 @@ class S extends m {
818
829
  }, this.__internal__.serial.free_timeout_ms || 50));
819
830
  }
820
831
  }
821
- async #d() {
832
+ async #f() {
822
833
  const {
823
834
  limiter: e,
824
835
  prefixLimiter: t = !1,
@@ -830,7 +841,7 @@ class S extends m {
830
841
  if (!e || !i || i.length === 0) return;
831
842
  this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0);
832
843
  let r = new TextDecoder().decode(i);
833
- const u = [];
844
+ const h = [];
834
845
  if (typeof e == "string") {
835
846
  let l;
836
847
  if (t && n)
@@ -841,52 +852,52 @@ class S extends m {
841
852
  l = new RegExp(`([^${e}]+)${e}`, "g");
842
853
  else
843
854
  return;
844
- let h, _ = 0;
845
- for (; (h = l.exec(r)) !== null; )
846
- u.push(new TextEncoder().encode(h[1])), _ = l.lastIndex;
855
+ let u, _ = 0;
856
+ for (; (u = l.exec(r)) !== null; )
857
+ h.push(new TextEncoder().encode(u[1])), _ = l.lastIndex;
847
858
  r = r.slice(_);
848
859
  } else if (e instanceof RegExp) {
849
- let l, h = 0;
860
+ let l, u = 0;
850
861
  if (t && n) {
851
862
  const _ = new RegExp(`${e.source}(.*?)${e.source}`, "g");
852
863
  for (; (l = _.exec(r)) !== null; )
853
- u.push(new TextEncoder().encode(l[1])), h = _.lastIndex;
864
+ h.push(new TextEncoder().encode(l[1])), u = _.lastIndex;
854
865
  } else if (n)
855
866
  for (; (l = e.exec(r)) !== null; ) {
856
- const _ = l.index, d = r.slice(h, _);
857
- u.push(new TextEncoder().encode(d)), h = e.lastIndex;
867
+ const _ = l.index, d = r.slice(u, _);
868
+ h.push(new TextEncoder().encode(d)), u = e.lastIndex;
858
869
  }
859
870
  else if (t) {
860
871
  const _ = r.split(e);
861
872
  _.shift();
862
873
  for (const d of _)
863
- u.push(new TextEncoder().encode(d));
874
+ h.push(new TextEncoder().encode(d));
864
875
  r = "";
865
876
  }
866
- r = r.slice(h);
877
+ r = r.slice(u);
867
878
  }
868
- for (const l of u)
879
+ for (const l of h)
869
880
  this.#r(l);
870
- const f = new TextEncoder().encode(r);
871
- this.__internal__.serial.response.buffer = f, f.length > 0 && (this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
881
+ const p = new TextEncoder().encode(r);
882
+ this.__internal__.serial.response.buffer = p, p.length > 0 && (this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
872
883
  this.#r(this.__internal__.serial.response.buffer, !0), this.__internal__.serial.response.buffer = new Uint8Array(0);
873
884
  }, this.__internal__.serial.free_timeout_ms ?? 50));
874
885
  }
875
886
  async #p() {
876
887
  const e = this.__internal__.serial.port;
877
888
  if (!e || !e.readable) throw new Error("Port is not readable");
878
- const t = e.readable.getReader();
879
- this.__internal__.serial.reader = t;
889
+ const t = this.__internal__.serial.transformStream ? this.__internal__.serial.transformStream : null, n = t ? e.readable.pipeThrough(t).getReader() : e.readable.getReader();
890
+ this.__internal__.serial.reader = n;
880
891
  try {
881
892
  for (; this.__internal__.serial.keep_reading; ) {
882
- const { value: n, done: i } = await t.read();
883
- if (i) break;
884
- this.#c(n), this.__internal__.serial.response.delimited ? await this.#d() : this.__internal__.serial.response.length === null ? await this.#h() : await this.#u();
893
+ const { value: i, done: o } = await n.read();
894
+ if (o) break;
895
+ this.#c(i), this.__internal__.serial.transformStream ? await this.#h() : this.__internal__.serial.response.delimited ? await this.#f() : this.__internal__.serial.response.length === null ? await this.#u() : await this.#d();
885
896
  }
886
- } catch (n) {
887
- this.serialErrors(n);
897
+ } catch (i) {
898
+ this.serialErrors(i);
888
899
  } finally {
889
- t.releaseLock(), this.__internal__.serial.keep_reading = !0, this.__internal__.serial.port && await this.__internal__.serial.port.close();
900
+ n.releaseLock(), this.__internal__.serial.keep_reading = !0, this.__internal__.serial.port && await this.__internal__.serial.port.close();
890
901
  }
891
902
  }
892
903
  #o(e) {
@@ -922,9 +933,9 @@ class S extends m {
922
933
  n.dispatch("serial:connected", i), n.#o(!1), s.$dispatchChange(this), n.__internal__.serial.queue.length > 0 ? n.dispatch("internal:queue", {}) : n.__internal__.serial.running_queue = !1;
923
934
  }, t.ondisconnect = async () => {
924
935
  await n.disconnect();
925
- }, await y(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
936
+ }, await m(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
926
937
  await n.timeout(n.__internal__.serial.bytes_connection ?? [], "connection:start");
927
- }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await this.#t(this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
938
+ }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await this.#n(this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
928
939
  action: "connect",
929
940
  bytes: this.__internal__.serial.bytes_connection
930
941
  }), this.__internal__.auto_response && this.#r(this.__internal__.serial.auto_response), await this.#p();
@@ -933,11 +944,11 @@ class S extends m {
933
944
  this.#o(!1), this.serialErrors(e);
934
945
  }
935
946
  }
936
- async #f() {
947
+ async #g() {
937
948
  return typeof window > "u" ? !1 : "serial" in navigator && "forget" in SerialPort.prototype && this.__internal__.serial.port ? (await this.__internal__.serial.port.forget(), !0) : !1;
938
949
  }
939
950
  async serialForget() {
940
- return await this.#f();
951
+ return await this.#g();
941
952
  }
942
953
  decToHex(e) {
943
954
  return typeof e == "string" && (e = parseInt(e, 10)), e.toString(16);
@@ -957,7 +968,7 @@ class S extends m {
957
968
  bytesToHex(e) {
958
969
  return this.add0x(Array.from(e, (t) => this.hexMaker(t)));
959
970
  }
960
- #g() {
971
+ #m() {
961
972
  [
962
973
  "serial:connected",
963
974
  "serial:connecting",
@@ -981,7 +992,7 @@ class S extends m {
981
992
  #y() {
982
993
  const e = this;
983
994
  this.on("internal:queue", async () => {
984
- await e.#w();
995
+ await e.#b();
985
996
  });
986
997
  const t = () => {
987
998
  e.isConnected && e.#e({ error: "Socket disconnected." });
@@ -989,19 +1000,19 @@ class S extends m {
989
1000
  e.isDisconnected && !e.isConnecting && e.serialConnect().catch(() => {
990
1001
  });
991
1002
  };
992
- this.useSocket && (window.addEventListener("serial:socket:disconnected", t), window.addEventListener("serial:socket:connected", n)), this.#m();
1003
+ this.useSocket && (window.addEventListener("serial:socket:disconnected", t), window.addEventListener("serial:socket:connected", n)), this.#w();
993
1004
  }
994
- #m() {
1005
+ #w() {
995
1006
  const e = this;
996
1007
  navigator.serial.addEventListener("connect", async () => {
997
1008
  e.isDisconnected && await e.serialConnect().catch(() => {
998
1009
  });
999
1010
  });
1000
1011
  }
1001
- async #w() {
1012
+ async #b() {
1002
1013
  if (this.useSocket && c.isDisconnected())
1003
1014
  return;
1004
- if (!this.#i(this.__internal__.serial.port)) {
1015
+ if (!this.#t(this.__internal__.serial.port)) {
1005
1016
  this.#e({ error: "Port is closed, not readable or writable." }), await this.serialConnect();
1006
1017
  return;
1007
1018
  }
@@ -1015,15 +1026,15 @@ class S extends m {
1015
1026
  let t = this.__internal__.time.response_general;
1016
1027
  if (e.action === "connect" && (t = this.__internal__.time.response_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1017
1028
  await this.timeout(e.bytes, e.action);
1018
- }, t), this.__internal__.serial.last_action = e.action ?? "unknown", await this.#t(e.bytes), this.dispatch("serial:sent", {
1029
+ }, t), this.__internal__.serial.last_action = e.action ?? "unknown", await this.#n(e.bytes), this.dispatch("serial:sent", {
1019
1030
  action: e.action,
1020
1031
  bytes: e.bytes
1021
1032
  }), this.__internal__.auto_response) {
1022
1033
  let i = new Uint8Array(0);
1023
1034
  try {
1024
1035
  i = this.validateBytes(this.__internal__.serial.auto_response);
1025
- } catch (a) {
1026
- this.serialErrors(a);
1036
+ } catch (o) {
1037
+ this.serialErrors(o);
1027
1038
  }
1028
1039
  this.#r(i);
1029
1040
  }
@@ -1053,7 +1064,7 @@ class S extends m {
1053
1064
  }
1054
1065
  this.__internal__.serial.queue.push({ bytes: n, action: t }), this.dispatch("internal:queue", {});
1055
1066
  }
1056
- #b(e = 1) {
1067
+ #C(e = 1) {
1057
1068
  this.__internal__.device_number = e, !this.__internal__.bypassSerialBytesConnection && (this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(e));
1058
1069
  }
1059
1070
  serialSetConnectionConstant(e = 1) {
@@ -1066,7 +1077,7 @@ class S extends m {
1066
1077
  serialCorruptMessage(e) {
1067
1078
  throw console.log(e), this.dispatch("serial:corrupt-message", { code: e }), new Error("Method not implemented 'serialCorruptMessage'");
1068
1079
  }
1069
- #C() {
1080
+ #E() {
1070
1081
  this.__internal__.last_error = {
1071
1082
  message: null,
1072
1083
  action: null,
@@ -1093,7 +1104,7 @@ class S extends m {
1093
1104
  });
1094
1105
  }
1095
1106
  softReload() {
1096
- this.#C(), this.dispatch("serial:soft-reload", {});
1107
+ this.#E(), this.dispatch("serial:soft-reload", {});
1097
1108
  }
1098
1109
  async sendConnect() {
1099
1110
  if (!this.__internal__.serial.bytes_connection)
@@ -1151,8 +1162,8 @@ class S extends m {
1151
1162
  asciiToHex(e) {
1152
1163
  const t = [];
1153
1164
  for (let n = 0, i = e.length; n < i; n++) {
1154
- const a = Number(e.charCodeAt(n)).toString(16);
1155
- t.push(a);
1165
+ const o = Number(e.charCodeAt(n)).toString(16);
1166
+ t.push(o);
1156
1167
  }
1157
1168
  return t.join("");
1158
1169
  }
@@ -1160,7 +1171,7 @@ class S extends m {
1160
1171
  return this.isConnected;
1161
1172
  }
1162
1173
  }
1163
- var E = /* @__PURE__ */ ((o) => (o.CONNECTION_FAILED = "CONNECTION_FAILED", o.DISCONNECTION_FAILED = "DISCONNECTION_FAILED", o.WRITE_FAILED = "WRITE_FAILED", o.READ_FAILED = "READ_FAILED", o.TIMEOUT = "TIMEOUT", o.PORT_NOT_FOUND = "PORT_NOT_FOUND", o.PERMISSION_DENIED = "PERMISSION_DENIED", o.DEVICE_NOT_SUPPORTED = "DEVICE_NOT_SUPPORTED", o.INVALID_CONFIGURATION = "INVALID_CONFIGURATION", o.SOCKET_ERROR = "SOCKET_ERROR", o.UNKNOWN_ERROR = "UNKNOWN_ERROR", o))(E || {});
1174
+ var E = /* @__PURE__ */ ((a) => (a.CONNECTION_FAILED = "CONNECTION_FAILED", a.DISCONNECTION_FAILED = "DISCONNECTION_FAILED", a.WRITE_FAILED = "WRITE_FAILED", a.READ_FAILED = "READ_FAILED", a.TIMEOUT = "TIMEOUT", a.PORT_NOT_FOUND = "PORT_NOT_FOUND", a.PERMISSION_DENIED = "PERMISSION_DENIED", a.DEVICE_NOT_SUPPORTED = "DEVICE_NOT_SUPPORTED", a.INVALID_CONFIGURATION = "INVALID_CONFIGURATION", a.SOCKET_ERROR = "SOCKET_ERROR", a.UNKNOWN_ERROR = "UNKNOWN_ERROR", a))(E || {});
1164
1175
  class w extends Error {
1165
1176
  /**
1166
1177
  * Error code identifying the type of error
@@ -1215,9 +1226,9 @@ class w extends Error {
1215
1226
  }
1216
1227
  }
1217
1228
  export {
1218
- S as Core,
1229
+ T as Core,
1219
1230
  s as Devices,
1220
- m as Dispatcher,
1231
+ y as Dispatcher,
1221
1232
  w as SerialError,
1222
1233
  E as SerialErrorCode,
1223
1234
  c as Socket