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.
- package/dist/ag-ui.cjs +1 -2
- package/dist/ag-ui.d.cts +0 -6
- package/dist/ag-ui.d.ts +0 -2
- package/dist/ag-ui.js +1 -2
- package/dist/chaos.cjs +1 -2
- package/dist/chaos.d.cts +0 -2
- package/dist/chaos.d.ts +0 -2
- package/dist/chaos.js +1 -2
- package/dist/core.cjs +11 -22
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +0 -22
- package/dist/core.d.ts +0 -22
- package/dist/core.js +11 -22
- package/dist/core.js.map +1 -1
- package/dist/devtools.cjs +1 -2
- package/dist/devtools.d.cts +0 -2
- package/dist/devtools.d.ts +0 -2
- package/dist/devtools.js +1 -2
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +0 -28
- package/dist/index.d.ts +0 -22
- package/dist/index.development.cjs +1 -2
- package/dist/index.development.js +1 -2
- package/dist/index.js +1 -2
- package/dist/outbox.cjs +1 -2
- package/dist/outbox.d.cts +1 -3
- package/dist/outbox.d.ts +0 -2
- package/dist/outbox.js +1 -2
- package/dist/replay.cjs +1 -2
- package/dist/replay.d.cts +0 -2
- package/dist/replay.d.ts +0 -2
- package/dist/replay.js +1 -2
- package/dist/tabs.cjs +1 -2
- package/dist/tabs.d.cts +0 -2
- package/dist/tabs.d.ts +0 -2
- package/dist/tabs.js +1 -2
- package/dist/timeline.cjs +1 -2
- package/dist/timeline.d.cts +1 -5
- package/dist/timeline.d.ts +0 -2
- package/dist/timeline.js +1 -2
- package/dist/{types-Bb3sBG8L.d.cts → types-DyZm2F7B.d.cts} +1 -3
- package/dist/webtransport.cjs +1 -2
- package/dist/webtransport.d.cts +0 -2
- package/dist/webtransport.d.ts +0 -2
- package/dist/webtransport.js +1 -2
- package/package.json +4 -4
package/dist/core.d.cts
CHANGED
|
@@ -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
|
*
|
|
@@ -481,8 +480,6 @@ interface WebSocketClient<In = unknown, Out = unknown> {
|
|
|
481
480
|
*/
|
|
482
481
|
acquire(): () => void;
|
|
483
482
|
}
|
|
484
|
-
//#endregion
|
|
485
|
-
//#region src/client.d.ts
|
|
486
483
|
/**
|
|
487
484
|
* The default `reconnect.shouldReconnect`: retry every close except `1002` (protocol error),
|
|
488
485
|
* `1003` (unsupported data) and `1008` (policy violation, often a rejected login), which
|
|
@@ -531,8 +528,6 @@ export declare function retryAfter(close: CloseInfo): number | undefined;
|
|
|
531
528
|
* ```
|
|
532
529
|
*/
|
|
533
530
|
export declare function createWebSocket<In = unknown, Out = unknown>(url: UrlSource, options?: WebSocketOptions<In, Out>): WebSocketClient<In, Out>;
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region src/topics.d.ts
|
|
536
531
|
/** @internal Option key for a callback run when nothing holds a topic anymore. Used by feeds. */
|
|
537
532
|
declare const ON_RELEASE: unique symbol;
|
|
538
533
|
/** Options for {@link createWebSocketTopics}: the messages your server expects. */
|
|
@@ -581,8 +576,6 @@ interface WebSocketTopics {
|
|
|
581
576
|
export declare function createWebSocketTopics<const Out>(client: WebSocketClient<any, Out>, options: WebSocketTopicsOptions<NoInfer<Out>> & {
|
|
582
577
|
[ON_RELEASE]?: (topic: string) => void;
|
|
583
578
|
}): WebSocketTopics;
|
|
584
|
-
//#endregion
|
|
585
|
-
//#region src/feeds.d.ts
|
|
586
579
|
/** Where a numbered message belongs: its topic, and its sequence number in that topic. */
|
|
587
580
|
interface FeedPosition {
|
|
588
581
|
readonly topic: string;
|
|
@@ -662,8 +655,6 @@ interface WebSocketFeeds<In> extends WebSocketTopics {
|
|
|
662
655
|
* ```
|
|
663
656
|
*/
|
|
664
657
|
export declare function createWebSocketFeeds<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketFeedsOptions<NoInfer<In>, NoInfer<Out>>): WebSocketFeeds<In>;
|
|
665
|
-
//#endregion
|
|
666
|
-
//#region src/latency.d.ts
|
|
667
658
|
/** Options for {@link createWebSocketLatency}: how pings and pongs look on the wire. */
|
|
668
659
|
interface WebSocketLatencyOptions<In, Out> {
|
|
669
660
|
/** The ping message, tagged with `id`. Sent with `volatile`, so pings are never queued. */
|
|
@@ -739,8 +730,6 @@ interface WebSocketLatency {
|
|
|
739
730
|
* ```
|
|
740
731
|
*/
|
|
741
732
|
export declare function createWebSocketLatency<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketLatencyOptions<NoInfer<In>, NoInfer<Out>>): WebSocketLatency;
|
|
742
|
-
//#endregion
|
|
743
|
-
//#region src/presence.d.ts
|
|
744
733
|
/** Another client's shared state, such as its cursor or what it's selected. */
|
|
745
734
|
interface PresencePeer<P> {
|
|
746
735
|
/** The peer's id, as the server reports it. */
|
|
@@ -824,8 +813,6 @@ interface WebSocketPresence<P> {
|
|
|
824
813
|
* ```
|
|
825
814
|
*/
|
|
826
815
|
export declare function createWebSocketPresence<P, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketPresenceOptions<P, NoInfer<In>, NoInfer<Out>>): WebSocketPresence<P>;
|
|
827
|
-
//#endregion
|
|
828
|
-
//#region src/requests.d.ts
|
|
829
816
|
/** Options for {@link createWebSocketRequests}: how requests and replies look on the wire. */
|
|
830
817
|
interface WebSocketRequestsOptions<Req, In, Out> {
|
|
831
818
|
/**
|
|
@@ -929,8 +916,6 @@ interface WebSocketRequests<Req, In> {
|
|
|
929
916
|
* ```
|
|
930
917
|
*/
|
|
931
918
|
export declare function createWebSocketRequests<Req, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRequestsOptions<Req, NoInfer<In>, NoInfer<Out>>): WebSocketRequests<Req, In>;
|
|
932
|
-
//#endregion
|
|
933
|
-
//#region src/responder.d.ts
|
|
934
919
|
/** What `request` returns for a request: any object with these fields, such as the message itself. */
|
|
935
920
|
type RequestFields = {
|
|
936
921
|
id: number | string;
|
|
@@ -1066,8 +1051,6 @@ interface WebSocketResponder<P = unknown, R = unknown> {
|
|
|
1066
1051
|
* ```
|
|
1067
1052
|
*/
|
|
1068
1053
|
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>;
|
|
1069
|
-
//#endregion
|
|
1070
|
-
//#region src/runs.d.ts
|
|
1071
1054
|
/**
|
|
1072
1055
|
* What happens to a run when its connection drops: `keep` resumes it on the next connection,
|
|
1073
1056
|
* for agents that keep working in the background; `cancel` aborts it and tells the server, for
|
|
@@ -1205,8 +1188,6 @@ interface WebSocketRuns<Req, T> {
|
|
|
1205
1188
|
* ```
|
|
1206
1189
|
*/
|
|
1207
1190
|
export declare function createWebSocketRuns<Req, T, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRunsOptions<Req, T, NoInfer<In>, NoInfer<Out>>): WebSocketRuns<Req, T>;
|
|
1208
|
-
//#endregion
|
|
1209
|
-
//#region src/sendrate.d.ts
|
|
1210
1191
|
/** Options for {@link createWebSocketSendRate}. */
|
|
1211
1192
|
interface WebSocketSendRateOptions {
|
|
1212
1193
|
/**
|
|
@@ -1284,8 +1265,6 @@ interface WebSocketSendRate<Out> {
|
|
|
1284
1265
|
* ```
|
|
1285
1266
|
*/
|
|
1286
1267
|
export declare function createWebSocketSendRate<Out>(client: WebSocketClient<any, Out>, options?: WebSocketSendRateOptions): WebSocketSendRate<Out>;
|
|
1287
|
-
//#endregion
|
|
1288
|
-
//#region src/state.d.ts
|
|
1289
1268
|
/** Options for {@link createWebSocketState}. */
|
|
1290
1269
|
interface WebSocketStateOptions<S, In> {
|
|
1291
1270
|
/** The state before any message arrives, and what `reset()` returns to. */
|
|
@@ -1360,6 +1339,5 @@ interface WebSocketState<S> {
|
|
|
1360
1339
|
* ```
|
|
1361
1340
|
*/
|
|
1362
1341
|
export declare function createWebSocketState<S, In>(source: WebSocketClient<In, any> | MessageSource<In>, options: WebSocketStateOptions<S, NoInfer<In>>): WebSocketState<S>;
|
|
1363
|
-
//#endregion
|
|
1364
1342
|
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, WebSocketClient, WebSocketFeeds, WebSocketFeedsOptions, WebSocketLatency, WebSocketLatencyOptions, WebSocketOptions, WebSocketPresence, WebSocketPresenceOptions, WebSocketRequests, WebSocketRequestsOptions, WebSocketResponder, WebSocketResponderOptions, WebSocketRuns, WebSocketRunsOptions, WebSocketSendRate, WebSocketSendRateOptions, WebSocketState, WebSocketStateOptions, WebSocketTopics, WebSocketTopicsOptions };
|
|
1365
1343
|
//# sourceMappingURL=core.d.cts.map
|
package/dist/core.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -481,8 +480,6 @@ interface WebSocketClient<In = unknown, Out = unknown> {
|
|
|
481
480
|
*/
|
|
482
481
|
acquire(): () => void;
|
|
483
482
|
}
|
|
484
|
-
//#endregion
|
|
485
|
-
//#region src/client.d.ts
|
|
486
483
|
/**
|
|
487
484
|
* The default `reconnect.shouldReconnect`: retry every close except `1002` (protocol error),
|
|
488
485
|
* `1003` (unsupported data) and `1008` (policy violation, often a rejected login), which
|
|
@@ -531,8 +528,6 @@ export declare function retryAfter(close: CloseInfo): number | undefined;
|
|
|
531
528
|
* ```
|
|
532
529
|
*/
|
|
533
530
|
export declare function createWebSocket<In = unknown, Out = unknown>(url: UrlSource, options?: WebSocketOptions<In, Out>): WebSocketClient<In, Out>;
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region src/topics.d.ts
|
|
536
531
|
/** @internal Option key for a callback run when nothing holds a topic anymore. Used by feeds. */
|
|
537
532
|
declare const ON_RELEASE: unique symbol;
|
|
538
533
|
/** Options for {@link createWebSocketTopics}: the messages your server expects. */
|
|
@@ -581,8 +576,6 @@ interface WebSocketTopics {
|
|
|
581
576
|
export declare function createWebSocketTopics<const Out>(client: WebSocketClient<any, Out>, options: WebSocketTopicsOptions<NoInfer<Out>> & {
|
|
582
577
|
[ON_RELEASE]?: (topic: string) => void;
|
|
583
578
|
}): WebSocketTopics;
|
|
584
|
-
//#endregion
|
|
585
|
-
//#region src/feeds.d.ts
|
|
586
579
|
/** Where a numbered message belongs: its topic, and its sequence number in that topic. */
|
|
587
580
|
interface FeedPosition {
|
|
588
581
|
readonly topic: string;
|
|
@@ -662,8 +655,6 @@ interface WebSocketFeeds<In> extends WebSocketTopics {
|
|
|
662
655
|
* ```
|
|
663
656
|
*/
|
|
664
657
|
export declare function createWebSocketFeeds<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketFeedsOptions<NoInfer<In>, NoInfer<Out>>): WebSocketFeeds<In>;
|
|
665
|
-
//#endregion
|
|
666
|
-
//#region src/latency.d.ts
|
|
667
658
|
/** Options for {@link createWebSocketLatency}: how pings and pongs look on the wire. */
|
|
668
659
|
interface WebSocketLatencyOptions<In, Out> {
|
|
669
660
|
/** The ping message, tagged with `id`. Sent with `volatile`, so pings are never queued. */
|
|
@@ -739,8 +730,6 @@ interface WebSocketLatency {
|
|
|
739
730
|
* ```
|
|
740
731
|
*/
|
|
741
732
|
export declare function createWebSocketLatency<In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketLatencyOptions<NoInfer<In>, NoInfer<Out>>): WebSocketLatency;
|
|
742
|
-
//#endregion
|
|
743
|
-
//#region src/presence.d.ts
|
|
744
733
|
/** Another client's shared state, such as its cursor or what it's selected. */
|
|
745
734
|
interface PresencePeer<P> {
|
|
746
735
|
/** The peer's id, as the server reports it. */
|
|
@@ -824,8 +813,6 @@ interface WebSocketPresence<P> {
|
|
|
824
813
|
* ```
|
|
825
814
|
*/
|
|
826
815
|
export declare function createWebSocketPresence<P, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketPresenceOptions<P, NoInfer<In>, NoInfer<Out>>): WebSocketPresence<P>;
|
|
827
|
-
//#endregion
|
|
828
|
-
//#region src/requests.d.ts
|
|
829
816
|
/** Options for {@link createWebSocketRequests}: how requests and replies look on the wire. */
|
|
830
817
|
interface WebSocketRequestsOptions<Req, In, Out> {
|
|
831
818
|
/**
|
|
@@ -929,8 +916,6 @@ interface WebSocketRequests<Req, In> {
|
|
|
929
916
|
* ```
|
|
930
917
|
*/
|
|
931
918
|
export declare function createWebSocketRequests<Req, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRequestsOptions<Req, NoInfer<In>, NoInfer<Out>>): WebSocketRequests<Req, In>;
|
|
932
|
-
//#endregion
|
|
933
|
-
//#region src/responder.d.ts
|
|
934
919
|
/** What `request` returns for a request: any object with these fields, such as the message itself. */
|
|
935
920
|
type RequestFields = {
|
|
936
921
|
id: number | string;
|
|
@@ -1066,8 +1051,6 @@ interface WebSocketResponder<P = unknown, R = unknown> {
|
|
|
1066
1051
|
* ```
|
|
1067
1052
|
*/
|
|
1068
1053
|
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>;
|
|
1069
|
-
//#endregion
|
|
1070
|
-
//#region src/runs.d.ts
|
|
1071
1054
|
/**
|
|
1072
1055
|
* What happens to a run when its connection drops: `keep` resumes it on the next connection,
|
|
1073
1056
|
* for agents that keep working in the background; `cancel` aborts it and tells the server, for
|
|
@@ -1205,8 +1188,6 @@ interface WebSocketRuns<Req, T> {
|
|
|
1205
1188
|
* ```
|
|
1206
1189
|
*/
|
|
1207
1190
|
export declare function createWebSocketRuns<Req, T, In, const Out>(client: WebSocketClient<In, Out>, options: WebSocketRunsOptions<Req, T, NoInfer<In>, NoInfer<Out>>): WebSocketRuns<Req, T>;
|
|
1208
|
-
//#endregion
|
|
1209
|
-
//#region src/sendrate.d.ts
|
|
1210
1191
|
/** Options for {@link createWebSocketSendRate}. */
|
|
1211
1192
|
interface WebSocketSendRateOptions {
|
|
1212
1193
|
/**
|
|
@@ -1284,8 +1265,6 @@ interface WebSocketSendRate<Out> {
|
|
|
1284
1265
|
* ```
|
|
1285
1266
|
*/
|
|
1286
1267
|
export declare function createWebSocketSendRate<Out>(client: WebSocketClient<any, Out>, options?: WebSocketSendRateOptions): WebSocketSendRate<Out>;
|
|
1287
|
-
//#endregion
|
|
1288
|
-
//#region src/state.d.ts
|
|
1289
1268
|
/** Options for {@link createWebSocketState}. */
|
|
1290
1269
|
interface WebSocketStateOptions<S, In> {
|
|
1291
1270
|
/** The state before any message arrives, and what `reset()` returns to. */
|
|
@@ -1360,6 +1339,5 @@ interface WebSocketState<S> {
|
|
|
1360
1339
|
* ```
|
|
1361
1340
|
*/
|
|
1362
1341
|
export declare function createWebSocketState<S, In>(source: WebSocketClient<In, any> | MessageSource<In>, options: WebSocketStateOptions<S, NoInfer<In>>): WebSocketState<S>;
|
|
1363
|
-
//#endregion
|
|
1364
1342
|
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, WebSocketClient, WebSocketFeeds, WebSocketFeedsOptions, WebSocketLatency, WebSocketLatencyOptions, WebSocketOptions, WebSocketPresence, WebSocketPresenceOptions, WebSocketRequests, WebSocketRequestsOptions, WebSocketResponder, WebSocketResponderOptions, WebSocketRuns, WebSocketRunsOptions, WebSocketSendRate, WebSocketSendRateOptions, WebSocketState, WebSocketStateOptions, WebSocketTopics, WebSocketTopicsOptions };
|
|
1365
1343
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/types.ts
|
|
2
2
|
/**
|
|
3
3
|
* Reported via the `error` event (and `onError`) when an incoming message can't be
|
|
4
4
|
* decoded by `parse`/`json` or fails `schema` validation. The message is not delivered.
|
|
@@ -22,8 +22,7 @@ var MessageError = class extends Error {
|
|
|
22
22
|
this.issues = options?.issues;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
//#region src/client.ts
|
|
25
|
+
// src/client.ts
|
|
27
26
|
const OPEN = 1;
|
|
28
27
|
const RECONNECT_DEFAULTS = {
|
|
29
28
|
maxAttempts: Infinity,
|
|
@@ -696,8 +695,7 @@ function createClient(url, options = {}) {
|
|
|
696
695
|
function createWebSocket(url, options) {
|
|
697
696
|
return createClient(url, options);
|
|
698
697
|
}
|
|
699
|
-
|
|
700
|
-
//#region src/topics.ts
|
|
698
|
+
// src/topics.ts
|
|
701
699
|
/** @internal Option key for a callback run when nothing holds a topic anymore. Used by feeds. */
|
|
702
700
|
const ON_RELEASE = Symbol("react-websocket.onRelease");
|
|
703
701
|
/**
|
|
@@ -782,8 +780,7 @@ function createWebSocketTopics(client, options) {
|
|
|
782
780
|
}
|
|
783
781
|
};
|
|
784
782
|
}
|
|
785
|
-
|
|
786
|
-
//#region src/feeds.ts
|
|
783
|
+
// src/feeds.ts
|
|
787
784
|
/**
|
|
788
785
|
* Subscribe to topics whose messages carry a sequence number, and get each message once, in
|
|
789
786
|
* order, across reconnects:
|
|
@@ -872,8 +869,7 @@ function createWebSocketFeeds(client, options) {
|
|
|
872
869
|
}
|
|
873
870
|
};
|
|
874
871
|
}
|
|
875
|
-
|
|
876
|
-
//#region src/latency.ts
|
|
872
|
+
// src/latency.ts
|
|
877
873
|
const EMPTY = Object.freeze({
|
|
878
874
|
rtt: void 0,
|
|
879
875
|
offset: void 0
|
|
@@ -982,8 +978,7 @@ function createWebSocketLatency(client, options) {
|
|
|
982
978
|
}
|
|
983
979
|
};
|
|
984
980
|
}
|
|
985
|
-
|
|
986
|
-
//#region src/presence.ts
|
|
981
|
+
// src/presence.ts
|
|
987
982
|
const VOLATILE$1 = { volatile: true };
|
|
988
983
|
/**
|
|
989
984
|
* Share per-peer state that expires, for presence, live cursors and selections.
|
|
@@ -1104,8 +1099,7 @@ function createWebSocketPresence(client, options) {
|
|
|
1104
1099
|
}
|
|
1105
1100
|
};
|
|
1106
1101
|
}
|
|
1107
|
-
|
|
1108
|
-
//#region src/requests.ts
|
|
1102
|
+
// src/requests.ts
|
|
1109
1103
|
const lastIds = /* @__PURE__ */ new WeakMap();
|
|
1110
1104
|
/** @internal Method key on the client for what the devtools show, such as its queue length. */
|
|
1111
1105
|
const INSPECT = Symbol.for("react-websocket.inspect");
|
|
@@ -1281,8 +1275,7 @@ function createWebSocketRequests(client, options) {
|
|
|
1281
1275
|
}
|
|
1282
1276
|
};
|
|
1283
1277
|
}
|
|
1284
|
-
|
|
1285
|
-
//#region src/responder.ts
|
|
1278
|
+
// src/responder.ts
|
|
1286
1279
|
const abortError = (message) => new DOMException(message, "AbortError");
|
|
1287
1280
|
const MAX_TIMEOUT = 2 ** 31 - 1;
|
|
1288
1281
|
/**
|
|
@@ -1434,8 +1427,7 @@ function createWebSocketResponder(client, options) {
|
|
|
1434
1427
|
}
|
|
1435
1428
|
};
|
|
1436
1429
|
}
|
|
1437
|
-
|
|
1438
|
-
//#region src/runs.ts
|
|
1430
|
+
// src/runs.ts
|
|
1439
1431
|
function randomId() {
|
|
1440
1432
|
return globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
1441
1433
|
}
|
|
@@ -1672,8 +1664,7 @@ function createWebSocketRuns(client, options) {
|
|
|
1672
1664
|
}
|
|
1673
1665
|
};
|
|
1674
1666
|
}
|
|
1675
|
-
|
|
1676
|
-
//#region src/sendrate.ts
|
|
1667
|
+
// src/sendrate.ts
|
|
1677
1668
|
const VOLATILE = { volatile: true };
|
|
1678
1669
|
/**
|
|
1679
1670
|
* Send high-rate state, such as aim, cursor or position, at a rate that adapts to the
|
|
@@ -1789,8 +1780,7 @@ function createWebSocketSendRate(client, options = {}) {
|
|
|
1789
1780
|
}
|
|
1790
1781
|
};
|
|
1791
1782
|
}
|
|
1792
|
-
|
|
1793
|
-
//#region src/state.ts
|
|
1783
|
+
// src/state.ts
|
|
1794
1784
|
/**
|
|
1795
1785
|
* Keep state derived from a client's messages, like a reducer that runs on every message.
|
|
1796
1786
|
* It starts listening immediately and keeps the state across reconnects; it doesn't open
|
|
@@ -1854,7 +1844,6 @@ function createWebSocketState(source, options) {
|
|
|
1854
1844
|
dispose: source.on("message", (message) => update((current) => reduce(current, message), batch === "frame"))
|
|
1855
1845
|
};
|
|
1856
1846
|
}
|
|
1857
|
-
//#endregion
|
|
1858
1847
|
export { MessageError, createWebSocket, createWebSocketFeeds, createWebSocketLatency, createWebSocketPresence, createWebSocketRequests, createWebSocketResponder, createWebSocketRuns, createWebSocketSendRate, createWebSocketState, createWebSocketTopics, retryAfter, retryableClose };
|
|
1859
1848
|
|
|
1860
1849
|
//# sourceMappingURL=core.js.map
|