@actuallab/rpc 12.3.60 → 12.3.70

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/index.d.cts CHANGED
@@ -820,6 +820,11 @@ declare abstract class RpcPeer {
820
820
  set serializationFormat(value: RpcSerializationFormat);
821
821
  call(method: string, args?: unknown[], options?: RpcCallOptions): RpcOutboundCall;
822
822
  callNoWait(method: string, args?: unknown[]): void;
823
+ /** Close the current WS connection without disposing the peer. The
824
+ * `conn.closed` handler flips state to `Disconnected`; for
825
+ * `RpcClientPeer` the run loop then iterates and reopens. The peer
826
+ * stays in the hub and all client proxies bound to it remain valid. */
827
+ disconnect(): void;
823
828
  close(): void;
824
829
  /** Send any messages buffered while disconnected. Call after connection + handshake are ready. */
825
830
  protected _flushPendingSends(): void;
package/dist/index.d.ts CHANGED
@@ -820,6 +820,11 @@ declare abstract class RpcPeer {
820
820
  set serializationFormat(value: RpcSerializationFormat);
821
821
  call(method: string, args?: unknown[], options?: RpcCallOptions): RpcOutboundCall;
822
822
  callNoWait(method: string, args?: unknown[]): void;
823
+ /** Close the current WS connection without disposing the peer. The
824
+ * `conn.closed` handler flips state to `Disconnected`; for
825
+ * `RpcClientPeer` the run loop then iterates and reopens. The peer
826
+ * stays in the hub and all client proxies bound to it remain valid. */
827
+ disconnect(): void;
823
828
  close(): void;
824
829
  /** Send any messages buffered while disconnected. Call after connection + handshake are ready. */
825
830
  protected _flushPendingSends(): void;
package/dist/index.js CHANGED
@@ -128,20 +128,10 @@ function deserializeMessage(raw) {
128
128
  var textEncoder = new TextEncoder();
129
129
  var textDecoder = new TextDecoder();
130
130
  var INITIAL_ENCODER_BUFFER_SIZE = 32 * 1024;
131
- var defaultBinaryEncoder = new Encoder2(
132
- void 0,
133
- void 0,
134
- void 0,
135
- INITIAL_ENCODER_BUFFER_SIZE
136
- );
131
+ var defaultBinaryEncoder = new Encoder2({ initialBufferSize: INITIAL_ENCODER_BUFFER_SIZE, useBigInt64: true });
137
132
  var defaultBinaryDecoder = new Decoder();
138
133
  function createBinaryEncoder() {
139
- return new Encoder2(
140
- void 0,
141
- void 0,
142
- void 0,
143
- INITIAL_ENCODER_BUFFER_SIZE
144
- );
134
+ return new Encoder2({ initialBufferSize: INITIAL_ENCODER_BUFFER_SIZE, useBigInt64: true });
145
135
  }
146
136
  function varUintByteLen(value) {
147
137
  if (value < 0) value = 0;
@@ -2351,6 +2341,13 @@ var RpcPeer = class {
2351
2341
  );
2352
2342
  this._sendWireData(wireData);
2353
2343
  }
2344
+ /** Close the current WS connection without disposing the peer. The
2345
+ * `conn.closed` handler flips state to `Disconnected`; for
2346
+ * `RpcClientPeer` the run loop then iterates and reopens. The peer
2347
+ * stays in the hub and all client proxies bound to it remain valid. */
2348
+ disconnect() {
2349
+ this._connection?.close();
2350
+ }
2354
2351
  close() {
2355
2352
  infoLog?.log(`'${this.ref}': Stopping`);
2356
2353
  this.remoteObjects.disconnectAll();