tasmota-webserial-esptool 9.1.2 → 9.1.4

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.
@@ -18,7 +18,7 @@ export declare class ESPLoader extends EventTarget {
18
18
  __totalBytesRead?: number;
19
19
  private _currentBaudRate;
20
20
  private _maxUSBSerialBaudrate?;
21
- private _reader?;
21
+ _reader?: ReadableStreamDefaultReader<Uint8Array>;
22
22
  private _isESP32S2NativeUSB;
23
23
  private _initializationSucceeded;
24
24
  private __commandLock;
package/js/script.js CHANGED
@@ -267,9 +267,10 @@ async function loadWebUSBSerial() {
267
267
  return;
268
268
  }
269
269
 
270
- // Dynamically load the WebUSB serial script
270
+ // Dynamically load the WebUSB serial script as ES6 module
271
271
  return new Promise((resolve, reject) => {
272
272
  const script = document.createElement("script");
273
+ script.type = "module"; // CRITICAL: Load as ES6 module to support export statements
273
274
  script.src = "js/webusb-serial.js";
274
275
  script.onload = () => {
275
276
  // Verify it loaded correctly
@@ -1024,12 +1024,11 @@ async function requestSerialPort(forceNew = false) {
1024
1024
  throw new Error('Neither Web Serial API nor WebUSB is supported in this browser');
1025
1025
  }
1026
1026
 
1027
- // Export as ES modules
1028
- export { WebUSBSerial, requestSerialPort };
1029
-
1030
1027
  // Also set on globalThis for non-module usage (e.g., dynamic script loading)
1031
1028
  if (typeof globalThis !== 'undefined') {
1032
1029
  globalThis.WebUSBSerial = WebUSBSerial;
1033
1030
  globalThis.requestSerialPort = requestSerialPort;
1034
1031
  }
1032
+
1033
+ // Export as ES modules
1035
1034
  export { WebUSBSerial, requestSerialPort };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tasmota-webserial-esptool",
3
- "version": "9.1.2",
3
+ "version": "9.1.4",
4
4
  "description": "World's first tool for flashing and reading ESP devices on Android mobile devices using WebUSB. Flash & Read ESP devices using WebSerial/WebUSB - up to 10x faster flash read than esptool.py",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
package/src/esp_loader.ts CHANGED
@@ -93,7 +93,7 @@ export class ESPLoader extends EventTarget {
93
93
  __totalBytesRead?: number;
94
94
  private _currentBaudRate: number = ESP_ROM_BAUD;
95
95
  private _maxUSBSerialBaudrate?: number;
96
- private _reader?: ReadableStreamDefaultReader<Uint8Array>;
96
+ public _reader?: ReadableStreamDefaultReader<Uint8Array>;
97
97
  private _isESP32S2NativeUSB: boolean = false;
98
98
  private _initializationSucceeded: boolean = false;
99
99
  private __commandLock: Promise<[number, number[]]> = Promise.resolve([0, []]);