@laplace.live/ws 7.1.5-beta.0 → 7.1.5-beta.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/dist/browser.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { K as KeepLive, b as LiveWSBase, W as WSOptions } from './ws-Cd0ulctk.js';
2
- export { c as LaplaceRawEvent, d as LiveEventMap, a as LiveOptions } from './ws-Cd0ulctk.js';
1
+ import { K as KeepLive, b as LiveWSBase, W as WSOptions } from './ws-CAEZj7O-.js';
2
+ export { c as LaplaceRawEvent, d as LiveEventMap, a as LiveOptions } from './ws-CAEZj7O-.js';
3
3
  import '@laplace.live/internal';
4
4
 
5
5
  /**
6
6
  * WebSocket client for a Bilibili live room (browser).
7
7
  *
8
- * Uses `pako` for zlib inflate and a bundled JS decoder for brotli
9
- * decompression, requiring no Node.js built-ins.
8
+ * Uses the native `DecompressionStream` API for zlib inflate and a
9
+ * bundled JS decoder for brotli decompression, requiring no Node.js
10
+ * built-ins or third-party dependencies.
10
11
  *
11
12
  * @param roomid - Numeric Bilibili live room ID.
12
13
  * @param opts - Optional WebSocket address and authentication options.
package/dist/browser.js CHANGED
@@ -1781,8 +1781,11 @@ var BrotliDecode = makeBrotliDecode();
1781
1781
 
1782
1782
  // src/inflate/browser.ts
1783
1783
  var inflateAsync = async (d) => {
1784
- const { inflate } = await import("pako");
1785
- return inflate(d);
1784
+ const ds = new DecompressionStream("deflate");
1785
+ const writer = ds.writable.getWriter();
1786
+ await writer.write(d);
1787
+ await writer.close();
1788
+ return new Uint8Array(await new Response(ds.readable).arrayBuffer());
1786
1789
  };
1787
1790
  var brotliDecompressAsync = (d) => Uint8Array.from(BrotliDecode(Int8Array.from(d)));
1788
1791
  var inflates = { inflateAsync, brotliDecompressAsync };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive, b as LiveWSBase, W as WSOptions } from './ws-Cd0ulctk.js';
2
- export { c as LaplaceRawEvent, d as LiveEventMap } from './ws-Cd0ulctk.js';
1
+ import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive, b as LiveWSBase, W as WSOptions } from './ws-CAEZj7O-.js';
2
+ export { c as LaplaceRawEvent, d as LiveEventMap } from './ws-CAEZj7O-.js';
3
3
  import { Socket } from 'node:net';
4
4
  import { BilibiliInternal } from '@laplace.live/internal';
5
5
 
@@ -5,11 +5,11 @@ import { BilibiliInternal } from '@laplace.live/internal';
5
5
  * decoder at construction time.
6
6
  *
7
7
  * - **Node / Bun**: backed by `node:zlib` (`inflate` + `brotliDecompress`).
8
- * - **Browser**: backed by `pako` (inflate) + a bundled JS Brotli decoder.
8
+ * - **Browser**: backed by native `DecompressionStream` (inflate) + a bundled JS Brotli decoder.
9
9
  */
10
10
  type Inflates = {
11
- inflateAsync: (b: Uint8Array) => Uint8Array | Promise<Uint8Array>;
12
- brotliDecompressAsync: (b: Uint8Array) => Uint8Array | Promise<Uint8Array>;
11
+ inflateAsync: (b: Uint8Array<ArrayBuffer>) => Uint8Array | Promise<Uint8Array>;
12
+ brotliDecompressAsync: (b: Uint8Array<ArrayBuffer>) => Uint8Array | Promise<Uint8Array>;
13
13
  };
14
14
 
15
15
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laplace.live/ws",
3
- "version": "7.1.5-beta.0",
3
+ "version": "7.1.5-beta.1",
4
4
  "description": "LAPLACE Live! flavored bilibili live WebSocket/TCP API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -62,14 +62,12 @@
62
62
  "provenance": true
63
63
  },
64
64
  "dependencies": {
65
- "@laplace.live/internal": "^1.3.4",
66
- "pako": "^2.1.0"
65
+ "@laplace.live/internal": "^1.3.4"
67
66
  },
68
67
  "devDependencies": {
69
68
  "@biomejs/biome": "^2.4.6",
70
69
  "@changesets/cli": "^2.30.0",
71
70
  "@types/bun": "^1.3.10",
72
- "@types/pako": "^2.0.4",
73
71
  "tsup": "^8.5.1",
74
72
  "typescript": "^5.9.3"
75
73
  }