react-websocket 4.22.2 → 4.22.3

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 (46) hide show
  1. package/dist/ag-ui.cjs +1 -2
  2. package/dist/ag-ui.d.cts +0 -6
  3. package/dist/ag-ui.d.ts +0 -2
  4. package/dist/ag-ui.js +1 -2
  5. package/dist/chaos.cjs +1 -2
  6. package/dist/chaos.d.cts +0 -2
  7. package/dist/chaos.d.ts +0 -2
  8. package/dist/chaos.js +1 -2
  9. package/dist/core.cjs +11 -22
  10. package/dist/core.cjs.map +1 -1
  11. package/dist/core.d.cts +0 -22
  12. package/dist/core.d.ts +0 -22
  13. package/dist/core.js +11 -22
  14. package/dist/core.js.map +1 -1
  15. package/dist/devtools.cjs +1 -2
  16. package/dist/devtools.d.cts +0 -2
  17. package/dist/devtools.d.ts +0 -2
  18. package/dist/devtools.js +1 -2
  19. package/dist/index.cjs +1 -2
  20. package/dist/index.d.cts +0 -28
  21. package/dist/index.d.ts +0 -22
  22. package/dist/index.development.cjs +1 -2
  23. package/dist/index.development.js +1 -2
  24. package/dist/index.js +1 -2
  25. package/dist/outbox.cjs +1 -2
  26. package/dist/outbox.d.cts +1 -3
  27. package/dist/outbox.d.ts +0 -2
  28. package/dist/outbox.js +1 -2
  29. package/dist/replay.cjs +1 -2
  30. package/dist/replay.d.cts +0 -2
  31. package/dist/replay.d.ts +0 -2
  32. package/dist/replay.js +1 -2
  33. package/dist/tabs.cjs +1 -2
  34. package/dist/tabs.d.cts +0 -2
  35. package/dist/tabs.d.ts +0 -2
  36. package/dist/tabs.js +1 -2
  37. package/dist/timeline.cjs +1 -2
  38. package/dist/timeline.d.cts +1 -5
  39. package/dist/timeline.d.ts +0 -2
  40. package/dist/timeline.js +1 -2
  41. package/dist/{types-Bb3sBG8L.d.cts → types-DyZm2F7B.d.cts} +1 -3
  42. package/dist/webtransport.cjs +1 -2
  43. package/dist/webtransport.d.cts +0 -2
  44. package/dist/webtransport.d.ts +0 -2
  45. package/dist/webtransport.js +1 -2
  46. package/package.json +4 -4
package/dist/devtools.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  let react = require("react");
4
- //#region src/devtools.ts
4
+ // src/devtools.ts
5
5
  const INSPECT = Symbol.for("react-websocket.inspect");
6
6
  const REGISTRY = Symbol.for("react-websocket.registry");
7
7
  const isClient = (value) => typeof value?.acquire === "function" && typeof value.send === "function" && "socket" in value;
@@ -180,7 +180,6 @@ function WebSocketDevtools({ sources = [], open: initiallyOpen = false, position
180
180
  padding: "8px 12px"
181
181
  } }, "No clients yet.")));
182
182
  }
183
- //#endregion
184
183
  exports.WebSocketDevtools = WebSocketDevtools;
185
184
 
186
185
  //# sourceMappingURL=devtools.cjs.map
@@ -1,6 +1,5 @@
1
1
 
2
2
  import { ReactElement } from "react";
3
- //#region src/devtools.d.ts
4
3
  /** Props for {@link WebSocketDevtools}. */
5
4
  export interface WebSocketDevtoolsProps {
6
5
  /**
@@ -28,5 +27,4 @@ export interface WebSocketDevtoolsProps {
28
27
  * ```
29
28
  */
30
29
  export declare function WebSocketDevtools({ sources, open: initiallyOpen, position }: WebSocketDevtoolsProps): ReactElement | null;
31
- //#endregion
32
30
  //# sourceMappingURL=devtools.d.cts.map
@@ -1,6 +1,5 @@
1
1
 
2
2
  import { ReactElement } from "react";
3
- //#region src/devtools.d.ts
4
3
  /** Props for {@link WebSocketDevtools}. */
5
4
  export interface WebSocketDevtoolsProps {
6
5
  /**
@@ -28,5 +27,4 @@ export interface WebSocketDevtoolsProps {
28
27
  * ```
29
28
  */
30
29
  export declare function WebSocketDevtools({ sources, open: initiallyOpen, position }: WebSocketDevtoolsProps): ReactElement | null;
31
- //#endregion
32
30
  //# sourceMappingURL=devtools.d.ts.map
package/dist/devtools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { createElement, useEffect, useReducer, useState, useSyncExternalStore } from "react";
3
- //#region src/devtools.ts
3
+ // src/devtools.ts
4
4
  const INSPECT = Symbol.for("react-websocket.inspect");
5
5
  const REGISTRY = Symbol.for("react-websocket.registry");
6
6
  const isClient = (value) => typeof value?.acquire === "function" && typeof value.send === "function" && "socket" in value;
@@ -179,7 +179,6 @@ function WebSocketDevtools({ sources = [], open: initiallyOpen = false, position
179
179
  padding: "8px 12px"
180
180
  } }, "No clients yet.")));
181
181
  }
182
- //#endregion
183
182
  export { WebSocketDevtools };
184
183
 
185
184
  //# sourceMappingURL=devtools.js.map
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  let __core_cjs = require("./core.cjs");
4
4
  let react = require("react");
5
- //#region src/react.ts
5
+ // src/react.ts
6
6
  const IDLE = Object.freeze({
7
7
  status: "idle",
8
8
  lastMessage: void 0,
@@ -435,7 +435,6 @@ function useWebSocketStream(rpc, options = {}) {
435
435
  ...actions
436
436
  };
437
437
  }
438
- //#endregion
439
438
  exports.useAgUiAgent = useAgUiAgent;
440
439
  exports.useAgentApproval = useAgentApproval;
441
440
  exports.useAgentRun = useAgentRun;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
 
2
2
  import { RefObject } from "react";
3
- //#region src/types.d.ts
4
3
  /**
5
4
  * Where to connect: a URL, or a function that returns one (sync or async).
6
5
  *
@@ -483,8 +482,6 @@ interface WebSocketClient<In = unknown, Out = unknown> {
483
482
  */
484
483
  acquire(): () => void;
485
484
  }
486
- //#endregion
487
- //#region src/client.d.ts
488
485
  /**
489
486
  * The default `reconnect.shouldReconnect`: retry every close except `1002` (protocol error),
490
487
  * `1003` (unsupported data) and `1008` (policy violation, often a rejected login), which
@@ -533,8 +530,6 @@ export declare function retryAfter(close: CloseInfo): number | undefined;
533
530
  * ```
534
531
  */
535
532
  export declare function createWebSocket<In = unknown, Out = unknown>(url: UrlSource, options?: WebSocketOptions<In, Out>): WebSocketClient<In, Out>;
536
- //#endregion
537
- //#region src/topics.d.ts
538
533
  /** @internal Option key for a callback run when nothing holds a topic anymore. Used by feeds. */
539
534
  declare const ON_RELEASE: unique symbol;
540
535
  /** Options for {@link createWebSocketTopics}: the messages your server expects. */
@@ -583,8 +578,6 @@ interface WebSocketTopics {
583
578
  export declare function createWebSocketTopics<const Out>(client: WebSocketClient<any, Out>, options: WebSocketTopicsOptions<NoInfer<Out>> & {
584
579
  [ON_RELEASE]?: (topic: string) => void;
585
580
  }): WebSocketTopics;
586
- //#endregion
587
- //#region src/feeds.d.ts
588
581
  /** Where a numbered message belongs: its topic, and its sequence number in that topic. */
589
582
  interface FeedPosition {
590
583
  readonly topic: string;
@@ -664,8 +657,6 @@ interface WebSocketFeeds<In> extends WebSocketTopics {
664
657
  * ```
665
658
  */
666
659
  export declare function createWebSocketFeeds<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketFeedsOptions<NoInfer<In>, NoInfer<Out>>): WebSocketFeeds<In>;
667
- //#endregion
668
- //#region src/latency.d.ts
669
660
  /** Options for {@link createWebSocketLatency}: how pings and pongs look on the wire. */
670
661
  interface WebSocketLatencyOptions<In, Out> {
671
662
  /** The ping message, tagged with `id`. Sent with `volatile`, so pings are never queued. */
@@ -741,8 +732,6 @@ interface WebSocketLatency {
741
732
  * ```
742
733
  */
743
734
  export declare function createWebSocketLatency<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketLatencyOptions<NoInfer<In>, NoInfer<Out>>): WebSocketLatency;
744
- //#endregion
745
- //#region src/presence.d.ts
746
735
  /** Another client's shared state, such as its cursor or what it's selected. */
747
736
  interface PresencePeer<P> {
748
737
  /** The peer's id, as the server reports it. */
@@ -826,8 +815,6 @@ interface WebSocketPresence<P> {
826
815
  * ```
827
816
  */
828
817
  export declare function createWebSocketPresence<P, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketPresenceOptions<P, NoInfer<In>, NoInfer<Out>>): WebSocketPresence<P>;
829
- //#endregion
830
- //#region src/requests.d.ts
831
818
  /** Options for {@link createWebSocketRequests}: how requests and replies look on the wire. */
832
819
  interface WebSocketRequestsOptions<Req, In, Out> {
833
820
  /**
@@ -931,8 +918,6 @@ interface WebSocketRequests<Req, In> {
931
918
  * ```
932
919
  */
933
920
  export declare function createWebSocketRequests<Req, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRequestsOptions<Req, NoInfer<In>, NoInfer<Out>>): WebSocketRequests<Req, In>;
934
- //#endregion
935
- //#region src/responder.d.ts
936
921
  /** What `request` returns for a request: any object with these fields, such as the message itself. */
937
922
  type RequestFields = {
938
923
  id: number | string;
@@ -1068,8 +1053,6 @@ interface WebSocketResponder<P = unknown, R = unknown> {
1068
1053
  * ```
1069
1054
  */
1070
1055
  export declare function createWebSocketResponder<Q extends RequestFields, R, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketResponderOptions<Q, R, NoInfer<In>, NoInfer<Out>>): WebSocketResponder<ParamsOf<Q>, R>;
1071
- //#endregion
1072
- //#region src/runs.d.ts
1073
1056
  /**
1074
1057
  * What happens to a run when its connection drops: `keep` resumes it on the next connection,
1075
1058
  * for agents that keep working in the background; `cancel` aborts it and tells the server, for
@@ -1207,8 +1190,6 @@ interface WebSocketRuns<Req, T> {
1207
1190
  * ```
1208
1191
  */
1209
1192
  export declare function createWebSocketRuns<Req, T, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRunsOptions<Req, T, NoInfer<In>, NoInfer<Out>>): WebSocketRuns<Req, T>;
1210
- //#endregion
1211
- //#region src/sendrate.d.ts
1212
1193
  /** Options for {@link createWebSocketSendRate}. */
1213
1194
  interface WebSocketSendRateOptions {
1214
1195
  /**
@@ -1286,8 +1267,6 @@ interface WebSocketSendRate<Out> {
1286
1267
  * ```
1287
1268
  */
1288
1269
  export declare function createWebSocketSendRate<Out>(client: WebSocketClient<any, Out>, options?: WebSocketSendRateOptions): WebSocketSendRate<Out>;
1289
- //#endregion
1290
- //#region src/state.d.ts
1291
1270
  /** Options for {@link createWebSocketState}. */
1292
1271
  interface WebSocketStateOptions<S, In> {
1293
1272
  /** The state before any message arrives, and what `reset()` returns to. */
@@ -1362,8 +1341,6 @@ interface WebSocketState<S> {
1362
1341
  * ```
1363
1342
  */
1364
1343
  export declare function createWebSocketState<S, In>(source: WebSocketClient<In, any> | MessageSource<In>, options: WebSocketStateOptions<S, NoInfer<In>>): WebSocketState<S>;
1365
- //#endregion
1366
- //#region src/ag-ui.d.ts
1367
1344
  /** A tool call on an assistant message, as in AG-UI. */
1368
1345
  interface AgUiToolCall {
1369
1346
  readonly id: string;
@@ -1455,8 +1432,6 @@ interface AgUiAgent<S> {
1455
1432
  /** Stop following runs, and release the connection. */
1456
1433
  dispose(): void;
1457
1434
  }
1458
- //#endregion
1459
- //#region src/outbox.d.ts
1460
1435
  /** What an outbox stores for each message. */
1461
1436
  interface OutboxRecord<M = unknown> {
1462
1437
  /** The message's idempotency key, sent with it every time. */
@@ -1504,8 +1479,6 @@ interface WebSocketOutbox<M> {
1504
1479
  /** Stop sending and listening, and release the connection. Stored entries stay stored. */
1505
1480
  dispose(): void;
1506
1481
  }
1507
- //#endregion
1508
- //#region src/react.d.ts
1509
1482
  /**
1510
1483
  * Per-component event handlers. They always see the component's latest props and
1511
1484
  * state, and changing them never reconnects.
@@ -1777,6 +1750,5 @@ export declare function useWebSocketStream<Req, In, T>(rpc: WebSocketRequests<Re
1777
1750
  export declare function useWebSocketStream<Req, In>(rpc: WebSocketRequests<Req, In> | null | undefined, options?: {
1778
1751
  batch?: 'frame';
1779
1752
  }): UseWebSocketStreamResult<Req, readonly In[]>;
1780
- //#endregion
1781
1753
  export type { AgentRun, CloseInfo, EventMap, FeedPosition, HeartbeatOptions, IncomingRequest, Latency, MessageSource, MigrateOptions, PresencePeer, QueueOptions, ReconnectOptions, RequestHandler, RequestOptions, RunPolicy, RunStatus, RunStorage, SendData, SendOptions, SendRate, Snapshot, StandardSchemaV1, Status, UrlSource, UseWebSocketOptions, UseWebSocketResult, UseWebSocketStreamOptions, UseWebSocketStreamResult, WebSocketClient, WebSocketFeeds, WebSocketFeedsOptions, WebSocketHandlers, WebSocketLatency, WebSocketLatencyOptions, WebSocketOptions, WebSocketPresence, WebSocketPresenceOptions, WebSocketRequests, WebSocketRequestsOptions, WebSocketResponder, WebSocketResponderOptions, WebSocketRuns, WebSocketRunsOptions, WebSocketSendRate, WebSocketSendRateOptions, WebSocketState, WebSocketStateOptions, WebSocketTopics, WebSocketTopicsOptions };
1782
1754
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  import { RunPolicy, WebSocketClient, WebSocketRuns } from "./core.js";
3
3
  import { RefObject } from "react";
4
4
  export * from "./core.js";
5
- //#region src/ag-ui.d.ts
6
5
  /** A tool call on an assistant message, as in AG-UI. */
7
6
  interface AgUiToolCall {
8
7
  readonly id: string;
@@ -94,8 +93,6 @@ interface AgUiAgent<S> {
94
93
  /** Stop following runs, and release the connection. */
95
94
  dispose(): void;
96
95
  }
97
- //#endregion
98
- //#region src/types.d.ts
99
96
  /**
100
97
  * Where to connect: a URL, or a function that returns one (sync or async).
101
98
  *
@@ -578,8 +575,6 @@ interface WebSocketClient$1<In = unknown, Out = unknown> {
578
575
  */
579
576
  acquire(): () => void;
580
577
  }
581
- //#endregion
582
- //#region src/latency.d.ts
583
578
  /** Latest latency measurements. A new object is created on every change. */
584
579
  interface Latency {
585
580
  /** Round-trip time in ms: the median of recent pings. `undefined` until the first pong. */
@@ -605,8 +600,6 @@ interface WebSocketLatency {
605
600
  /** Stop pinging and listening. Only needed for instances created dynamically. */
606
601
  dispose(): void;
607
602
  }
608
- //#endregion
609
- //#region src/outbox.d.ts
610
603
  /** What an outbox stores for each message. */
611
604
  interface OutboxRecord<M = unknown> {
612
605
  /** The message's idempotency key, sent with it every time. */
@@ -654,8 +647,6 @@ interface WebSocketOutbox<M> {
654
647
  /** Stop sending and listening, and release the connection. Stored entries stay stored. */
655
648
  dispose(): void;
656
649
  }
657
- //#endregion
658
- //#region src/presence.d.ts
659
650
  /** Another client's shared state, such as its cursor or what it's selected. */
660
651
  interface PresencePeer<P> {
661
652
  /** The peer's id, as the server reports it. */
@@ -682,8 +673,6 @@ interface WebSocketPresence<P> {
682
673
  /** Stop sharing and listening. */
683
674
  dispose(): void;
684
675
  }
685
- //#endregion
686
- //#region src/requests.d.ts
687
676
  /** Per-call options for {@link WebSocketRequests.request} and {@link WebSocketRequests.stream}. */
688
677
  interface RequestOptions extends SendOptions {
689
678
  /**
@@ -732,8 +721,6 @@ interface WebSocketRequests<Req, In> {
732
721
  /** Reject every pending request and stop listening. Only needed for managers created dynamically. */
733
722
  dispose(): void;
734
723
  }
735
- //#endregion
736
- //#region src/responder.d.ts
737
724
  /** A request from the server that hasn't been answered yet. */
738
725
  interface IncomingRequest<P = unknown, R = unknown> {
739
726
  /** The id the server sent. Replies carry it back. */
@@ -793,8 +780,6 @@ interface WebSocketResponder<P = unknown, R = unknown> {
793
780
  */
794
781
  dispose(): void;
795
782
  }
796
- //#endregion
797
- //#region src/runs.d.ts
798
783
  /**
799
784
  * What happens to a run when its connection drops: `keep` resumes it on the next connection,
800
785
  * for agents that keep working in the background; `cancel` aborts it and tells the server, for
@@ -855,8 +840,6 @@ interface WebSocketRuns$1<Req, T> {
855
840
  /** Stop following runs, and release the connection. Remembered runs stay remembered. */
856
841
  dispose(): void;
857
842
  }
858
- //#endregion
859
- //#region src/state.d.ts
860
843
  interface WebSocketState<S> {
861
844
  /** The client whose messages this store reduces. Hooks reading the store keep it connected. */
862
845
  readonly client: WebSocketClient$1<any, any>;
@@ -873,8 +856,6 @@ interface WebSocketState<S> {
873
856
  /** Stop reducing messages. Only needed for stores created dynamically rather than at module level. */
874
857
  dispose(): void;
875
858
  }
876
- //#endregion
877
- //#region src/topics.d.ts
878
859
  /** Reference-counted topic subscriptions on one client. Create with {@link createWebSocketTopics}. */
879
860
  interface WebSocketTopics {
880
861
  /** The client the subscription messages are sent on. */
@@ -889,8 +870,6 @@ interface WebSocketTopics {
889
870
  /** Stop managing subscriptions. Only needed for managers created dynamically. */
890
871
  dispose(): void;
891
872
  }
892
- //#endregion
893
- //#region src/react.d.ts
894
873
  /**
895
874
  * Per-component event handlers. They always see the component's latest props and
896
875
  * state, and changing them never reconnects.
@@ -1162,6 +1141,5 @@ export declare function useWebSocketStream<Req, In, T>(rpc: WebSocketRequests<Re
1162
1141
  export declare function useWebSocketStream<Req, In>(rpc: WebSocketRequests<Req, In> | null | undefined, options?: {
1163
1142
  batch?: 'frame';
1164
1143
  }): UseWebSocketStreamResult<Req, readonly In[]>;
1165
- //#endregion
1166
1144
  export type { UseWebSocketOptions, UseWebSocketResult, UseWebSocketStreamOptions, UseWebSocketStreamResult, WebSocketHandlers };
1167
1145
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  let __core_cjs = require("./core.cjs");
4
4
  let react = require("react");
5
- //#region src/react.ts
5
+ // src/react.ts
6
6
  const IDLE = Object.freeze({
7
7
  status: "idle",
8
8
  lastMessage: void 0,
@@ -472,7 +472,6 @@ function useWebSocketStream(rpc, options = {}) {
472
472
  ...actions
473
473
  };
474
474
  }
475
- //#endregion
476
475
  exports.useAgUiAgent = useAgUiAgent;
477
476
  exports.useAgentApproval = useAgentApproval;
478
477
  exports.useAgentRun = useAgentRun;
@@ -2,7 +2,7 @@
2
2
  import { createWebSocket } from "./core.js";
3
3
  import { useEffect, useId, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
4
  export * from "./core.js";
5
- //#region src/react.ts
5
+ // src/react.ts
6
6
  const IDLE = Object.freeze({
7
7
  status: "idle",
8
8
  lastMessage: void 0,
@@ -472,7 +472,6 @@ function useWebSocketStream(rpc, options = {}) {
472
472
  ...actions
473
473
  };
474
474
  }
475
- //#endregion
476
475
  export { useAgUiAgent, useAgentApproval, useAgentRun, useInView, useWebSocket, useWebSocketEvent, useWebSocketLatency, useWebSocketOutbox, useWebSocketPresence, useWebSocketState, useWebSocketStatus, useWebSocketStream, useWebSocketTopic };
477
476
 
478
477
  //# sourceMappingURL=index.development.js.map
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createWebSocket } from "./core.js";
3
3
  import { useEffect, useId, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
4
  export * from "./core.js";
5
- //#region src/react.ts
5
+ // src/react.ts
6
6
  const IDLE = Object.freeze({
7
7
  status: "idle",
8
8
  lastMessage: void 0,
@@ -435,7 +435,6 @@ function useWebSocketStream(rpc, options = {}) {
435
435
  ...actions
436
436
  };
437
437
  }
438
- //#endregion
439
438
  export { useAgUiAgent, useAgentApproval, useAgentRun, useInView, useWebSocket, useWebSocketEvent, useWebSocketLatency, useWebSocketOutbox, useWebSocketPresence, useWebSocketState, useWebSocketStatus, useWebSocketStream, useWebSocketTopic };
440
439
 
441
440
  //# sourceMappingURL=index.js.map
package/dist/outbox.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/outbox.ts
2
+ // src/outbox.ts
3
3
  /** Keep outbox entries in IndexedDB, in the database `react-websocket-outbox:<name>`. */
4
4
  function indexedDBStorage(name) {
5
5
  let db;
@@ -234,7 +234,6 @@ function createWebSocketOutbox(client, options) {
234
234
  }
235
235
  };
236
236
  }
237
- //#endregion
238
237
  exports.createWebSocketOutbox = createWebSocketOutbox;
239
238
  exports.indexedDBStorage = indexedDBStorage;
240
239
  exports.memoryStorage = memoryStorage;
package/dist/outbox.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { t as WebSocketClient } from "./types-Bb3sBG8L.cjs";
2
- //#region src/outbox.d.ts
1
+ import { t as WebSocketClient } from "./types-DyZm2F7B.cjs";
3
2
  /** What an outbox stores for each message. */
4
3
  export interface OutboxRecord<M = unknown> {
5
4
  /** The message's idempotency key, sent with it every time. */
@@ -123,5 +122,4 @@ export declare function memoryStorage(): OutboxStorage;
123
122
  * ```
124
123
  */
125
124
  export declare function createWebSocketOutbox<M, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketOutboxOptions<M, NoInfer<In>, NoInfer<Out>>): WebSocketOutbox<M>;
126
- //#endregion
127
125
  //# sourceMappingURL=outbox.d.cts.map
package/dist/outbox.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { WebSocketClient } from "./core.js";
2
- //#region src/outbox.d.ts
3
2
  /** What an outbox stores for each message. */
4
3
  export interface OutboxRecord<M = unknown> {
5
4
  /** The message's idempotency key, sent with it every time. */
@@ -123,5 +122,4 @@ export declare function memoryStorage(): OutboxStorage;
123
122
  * ```
124
123
  */
125
124
  export declare function createWebSocketOutbox<M, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketOutboxOptions<M, NoInfer<In>, NoInfer<Out>>): WebSocketOutbox<M>;
126
- //#endregion
127
125
  //# sourceMappingURL=outbox.d.ts.map
package/dist/outbox.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/outbox.ts
1
+ // src/outbox.ts
2
2
  /** Keep outbox entries in IndexedDB, in the database `react-websocket-outbox:<name>`. */
3
3
  function indexedDBStorage(name) {
4
4
  let db;
@@ -233,7 +233,6 @@ function createWebSocketOutbox(client, options) {
233
233
  }
234
234
  };
235
235
  }
236
- //#endregion
237
236
  export { createWebSocketOutbox, indexedDBStorage, memoryStorage };
238
237
 
239
238
  //# sourceMappingURL=outbox.js.map
package/dist/replay.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/replay.ts
2
+ // src/replay.ts
3
3
  const CONNECTING = 0;
4
4
  const OPEN = 1;
5
5
  const CLOSING = 2;
@@ -322,7 +322,6 @@ function createReplayWebSocket(recording, options = {}) {
322
322
  }
323
323
  return ReplaySocket;
324
324
  }
325
- //#endregion
326
325
  exports.createRecordingWebSocket = createRecordingWebSocket;
327
326
  exports.createReplayWebSocket = createReplayWebSocket;
328
327
 
package/dist/replay.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/replay.d.ts
2
1
  /** Data in a recording: text as it was, binary as base64. */
3
2
  export type RecordedData = string | {
4
3
  readonly binary: string;
@@ -126,6 +125,5 @@ export declare function createRecordingWebSocket(options?: {
126
125
  * ```
127
126
  */
128
127
  export declare function createReplayWebSocket(recording: WebSocketRecording, options?: ReplayOptions): ReplayWebSocket;
129
- //#endregion
130
128
  export {};
131
129
  //# sourceMappingURL=replay.d.cts.map
package/dist/replay.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/replay.d.ts
2
1
  /** Data in a recording: text as it was, binary as base64. */
3
2
  export type RecordedData = string | {
4
3
  readonly binary: string;
@@ -126,6 +125,5 @@ export declare function createRecordingWebSocket(options?: {
126
125
  * ```
127
126
  */
128
127
  export declare function createReplayWebSocket(recording: WebSocketRecording, options?: ReplayOptions): ReplayWebSocket;
129
- //#endregion
130
128
  export {};
131
129
  //# sourceMappingURL=replay.d.ts.map
package/dist/replay.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/replay.ts
1
+ // src/replay.ts
2
2
  const CONNECTING = 0;
3
3
  const OPEN = 1;
4
4
  const CLOSING = 2;
@@ -321,7 +321,6 @@ function createReplayWebSocket(recording, options = {}) {
321
321
  }
322
322
  return ReplaySocket;
323
323
  }
324
- //#endregion
325
324
  export { createRecordingWebSocket, createReplayWebSocket };
326
325
 
327
326
  //# sourceMappingURL=replay.js.map
package/dist/tabs.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/tabs.ts
2
+ // src/tabs.ts
3
3
  const CONNECTING = 0;
4
4
  const OPEN = 1;
5
5
  const CLOSING = 2;
@@ -327,7 +327,6 @@ function createTabsWebSocket(options = {}) {
327
327
  }
328
328
  return TabSocket;
329
329
  }
330
- //#endregion
331
330
  exports.createTabsWebSocket = createTabsWebSocket;
332
331
 
333
332
  //# sourceMappingURL=tabs.cjs.map
package/dist/tabs.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/tabs.d.ts
2
1
  /**
3
2
  * Recognize topic subscriptions, so tabs sharing a socket don't unsubscribe each other. With
4
3
  * `json`, only messages that parse are passed to these, and one that throws counts as
@@ -84,5 +83,4 @@ export interface TabsWebSocket {
84
83
  * ```
85
84
  */
86
85
  export declare function createTabsWebSocket(options?: TabsWebSocketOptions): TabsWebSocket;
87
- //#endregion
88
86
  //# sourceMappingURL=tabs.d.cts.map
package/dist/tabs.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/tabs.d.ts
2
1
  /**
3
2
  * Recognize topic subscriptions, so tabs sharing a socket don't unsubscribe each other. With
4
3
  * `json`, only messages that parse are passed to these, and one that throws counts as
@@ -84,5 +83,4 @@ export interface TabsWebSocket {
84
83
  * ```
85
84
  */
86
85
  export declare function createTabsWebSocket(options?: TabsWebSocketOptions): TabsWebSocket;
87
- //#endregion
88
86
  //# sourceMappingURL=tabs.d.ts.map
package/dist/tabs.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/tabs.ts
1
+ // src/tabs.ts
2
2
  const CONNECTING = 0;
3
3
  const OPEN = 1;
4
4
  const CLOSING = 2;
@@ -326,7 +326,6 @@ function createTabsWebSocket(options = {}) {
326
326
  }
327
327
  return TabSocket;
328
328
  }
329
- //#endregion
330
329
  export { createTabsWebSocket };
331
330
 
332
331
  //# sourceMappingURL=tabs.js.map
package/dist/timeline.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/timeline.ts
2
+ // src/timeline.ts
3
3
  const MAX_PENDING = 1e3;
4
4
  /**
5
5
  * Keep server snapshots on a timeline for multiplayer games: render what the server moves
@@ -158,7 +158,6 @@ function createWebSocketTimeline(client, options) {
158
158
  }
159
159
  };
160
160
  }
161
- //#endregion
162
161
  exports.createWebSocketTimeline = createWebSocketTimeline;
163
162
 
164
163
  //# sourceMappingURL=timeline.cjs.map
@@ -1,5 +1,4 @@
1
- import { t as WebSocketClient } from "./types-Bb3sBG8L.cjs";
2
- //#region src/latency.d.ts
1
+ import { t as WebSocketClient } from "./types-DyZm2F7B.cjs";
3
2
  /** Latest latency measurements. A new object is created on every change. */
4
3
  interface Latency {
5
4
  /** Round-trip time in ms: the median of recent pings. `undefined` until the first pong. */
@@ -25,8 +24,6 @@ interface WebSocketLatency {
25
24
  /** Stop pinging and listening. Only needed for instances created dynamically. */
26
25
  dispose(): void;
27
26
  }
28
- //#endregion
29
- //#region src/timeline.d.ts
30
27
  /** A server snapshot, as returned by the `snapshot` option. */
31
28
  export interface TimelineSnapshot<S> {
32
29
  /** Server time the state is for, in ms. Must increase from one snapshot to the next. */
@@ -163,6 +160,5 @@ export interface WebSocketTimeline<S, I> {
163
160
  * ```
164
161
  */
165
162
  export declare function createWebSocketTimeline<In, const Out, S, I = never>(client: WebSocketClient<In, Out>, options: WebSocketTimelineOptions<S, I, NoInfer<In>, NoInfer<Out>>): WebSocketTimeline<S, I>;
166
- //#endregion
167
163
  export {};
168
164
  //# sourceMappingURL=timeline.d.cts.map
@@ -1,5 +1,4 @@
1
1
  import { WebSocketClient, WebSocketLatency } from "./core.js";
2
- //#region src/timeline.d.ts
3
2
  /** A server snapshot, as returned by the `snapshot` option. */
4
3
  export interface TimelineSnapshot<S> {
5
4
  /** Server time the state is for, in ms. Must increase from one snapshot to the next. */
@@ -136,5 +135,4 @@ export interface WebSocketTimeline<S, I> {
136
135
  * ```
137
136
  */
138
137
  export declare function createWebSocketTimeline<In, const Out, S, I = never>(client: WebSocketClient<In, Out>, options: WebSocketTimelineOptions<S, I, NoInfer<In>, NoInfer<Out>>): WebSocketTimeline<S, I>;
139
- //#endregion
140
138
  //# sourceMappingURL=timeline.d.ts.map
package/dist/timeline.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/timeline.ts
1
+ // src/timeline.ts
2
2
  const MAX_PENDING = 1e3;
3
3
  /**
4
4
  * Keep server snapshots on a timeline for multiplayer games: render what the server moves
@@ -157,7 +157,6 @@ function createWebSocketTimeline(client, options) {
157
157
  }
158
158
  };
159
159
  }
160
- //#endregion
161
160
  export { createWebSocketTimeline };
162
161
 
163
162
  //# sourceMappingURL=timeline.js.map
@@ -1,4 +1,3 @@
1
- //#region src/types.d.ts
2
1
  /**
3
2
  * Where to connect: a URL, or a function that returns one (sync or async).
4
3
  *
@@ -269,6 +268,5 @@ interface WebSocketClient<In = unknown, Out = unknown> {
269
268
  */
270
269
  acquire(): () => void;
271
270
  }
272
- //#endregion
273
271
  export { WebSocketClient as t };
274
- //# sourceMappingURL=types-Bb3sBG8L.d.cts.map
272
+ //# sourceMappingURL=types-DyZm2F7B.d.cts.map
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/webtransport.ts
2
+ // src/webtransport.ts
3
3
  const CONNECTING = 0;
4
4
  const OPEN = 1;
5
5
  const CLOSING = 2;
@@ -239,7 +239,6 @@ function createWebTransportSocket(options = {}) {
239
239
  }
240
240
  return WebTransportSocket;
241
241
  }
242
- //#endregion
243
242
  exports.createWebTransportSocket = createWebTransportSocket;
244
243
 
245
244
  //# sourceMappingURL=webtransport.cjs.map
@@ -1,4 +1,3 @@
1
- //#region src/webtransport.d.ts
2
1
  /** Options for {@link createWebTransportSocket}. */
3
2
  export interface WebTransportSocketOptions {
4
3
  /**
@@ -63,5 +62,4 @@ export interface WebTransportWebSocket {
63
62
  * ```
64
63
  */
65
64
  export declare function createWebTransportSocket(options?: WebTransportSocketOptions): WebTransportWebSocket;
66
- //#endregion
67
65
  //# sourceMappingURL=webtransport.d.cts.map
@@ -1,4 +1,3 @@
1
- //#region src/webtransport.d.ts
2
1
  /** Options for {@link createWebTransportSocket}. */
3
2
  export interface WebTransportSocketOptions {
4
3
  /**
@@ -63,5 +62,4 @@ export interface WebTransportWebSocket {
63
62
  * ```
64
63
  */
65
64
  export declare function createWebTransportSocket(options?: WebTransportSocketOptions): WebTransportWebSocket;
66
- //#endregion
67
65
  //# sourceMappingURL=webtransport.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/webtransport.ts
1
+ // src/webtransport.ts
2
2
  const CONNECTING = 0;
3
3
  const OPEN = 1;
4
4
  const CLOSING = 2;
@@ -238,7 +238,6 @@ function createWebTransportSocket(options = {}) {
238
238
  }
239
239
  return WebTransportSocket;
240
240
  }
241
- //#endregion
242
241
  export { createWebTransportSocket };
243
242
 
244
243
  //# sourceMappingURL=webtransport.js.map