livekit-client 2.22.3 → 2.23.0
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/README.md +35 -0
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +71 -8
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +1746 -547
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.fm.worker.js +1 -1
- package/dist/livekit-client.fm.worker.js.map +1 -1
- package/dist/livekit-client.fm.worker.mjs +2 -1
- package/dist/livekit-client.fm.worker.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +4 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/api/WebSocketStream.d.ts +1 -0
- package/dist/src/api/WebSocketStream.d.ts.map +1 -1
- package/dist/src/api/utils.d.ts +1 -1
- package/dist/src/api/utils.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/naluUtils.d.ts +12 -1
- package/dist/src/e2ee/worker/naluUtils.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/options.d.ts +14 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/room/DefaultReconnectPolicy.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +100 -7
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +16 -0
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +54 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/data-channel/DataChannelManager.d.ts +9 -8
- package/dist/src/room/data-channel/DataChannelManager.d.ts.map +1 -1
- package/dist/src/room/data-channel/FlowControlledDataChannel.d.ts +25 -12
- package/dist/src/room/data-channel/FlowControlledDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-channel/LossyDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-channel/ReliableDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-stream/incoming/IncomingDataStreamManager.d.ts.map +1 -1
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/errors.d.ts +18 -0
- package/dist/src/room/errors.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +3 -2
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +4 -0
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +1 -1
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
- package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -1
- package/dist/src/room/rpc/utils.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts +24 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +18 -0
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +9 -0
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteAudioTrack.d.ts +6 -0
- package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/processor/types.d.ts +11 -0
- package/dist/src/room/track/processor/types.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +13 -0
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +60 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/compressionStreamStubs.d.ts +12 -0
- package/dist/src/test/compressionStreamStubs.d.ts.map +1 -0
- package/dist/ts4.2/api/SignalClient.d.ts +187 -185
- package/dist/ts4.2/api/SignalClientStateMachine.d.ts +85 -85
- package/dist/ts4.2/api/WebSocketStream.d.ts +34 -33
- package/dist/ts4.2/api/utils.d.ts +9 -9
- package/dist/ts4.2/connectionHelper/ConnectionCheck.d.ts +30 -30
- package/dist/ts4.2/connectionHelper/checks/Checker.d.ts +62 -62
- package/dist/ts4.2/connectionHelper/checks/cloudRegion.d.ts +18 -18
- package/dist/ts4.2/connectionHelper/checks/connectionProtocol.d.ts +20 -20
- package/dist/ts4.2/connectionHelper/checks/publishAudio.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/publishVideo.d.ts +7 -7
- package/dist/ts4.2/connectionHelper/checks/reconnect.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/turn.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/webrtc.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/websocket.d.ts +6 -6
- package/dist/ts4.2/e2ee/E2eeManager.d.ts +111 -111
- package/dist/ts4.2/e2ee/KeyProvider.d.ts +54 -54
- package/dist/ts4.2/e2ee/constants.d.ts +21 -21
- package/dist/ts4.2/e2ee/errors.d.ts +12 -12
- package/dist/ts4.2/e2ee/events.d.ts +39 -39
- package/dist/ts4.2/e2ee/index.d.ts +6 -6
- package/dist/ts4.2/e2ee/types.d.ts +231 -231
- package/dist/ts4.2/e2ee/utils.d.ts +32 -32
- package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +16 -16
- package/dist/ts4.2/e2ee/worker/ErrorRateLimiter.d.ts +21 -21
- package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +209 -209
- package/dist/ts4.2/e2ee/worker/ParticipantKeyHandler.d.ts +81 -84
- package/dist/ts4.2/e2ee/worker/e2ee.worker.d.ts +2 -2
- package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +39 -28
- package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +23 -23
- package/dist/ts4.2/frameMetadata/FrameMetadataManager.d.ts +53 -53
- package/dist/ts4.2/frameMetadata/frameMetadata.d.ts +33 -33
- package/dist/ts4.2/frameMetadata/types.d.ts +62 -62
- package/dist/ts4.2/frameMetadata/utils.d.ts +9 -9
- package/dist/ts4.2/frameMetadata/worker/frameMetadata.worker.d.ts +2 -2
- package/dist/ts4.2/index.d.ts +76 -76
- package/dist/ts4.2/logger.d.ts +66 -66
- package/dist/ts4.2/options.d.ts +163 -149
- package/dist/ts4.2/room/BackOffStrategy.d.ts +27 -27
- package/dist/ts4.2/room/DefaultReconnectPolicy.d.ts +8 -8
- package/dist/ts4.2/room/DeviceManager.d.ts +12 -12
- package/dist/ts4.2/room/PCTransport.d.ts +268 -175
- package/dist/ts4.2/room/PCTransportManager.d.ts +77 -77
- package/dist/ts4.2/room/RTCEngine.d.ts +277 -262
- package/dist/ts4.2/room/ReconnectPolicy.d.ts +24 -24
- package/dist/ts4.2/room/RegionUrlProvider.d.ts +36 -36
- package/dist/ts4.2/room/Room.d.ts +407 -365
- package/dist/ts4.2/room/attribute-typings.d.ts +35 -35
- package/dist/ts4.2/room/data-channel/DataChannelManager.d.ts +63 -62
- package/dist/ts4.2/room/data-channel/FlowControlledDataChannel.d.ts +107 -95
- package/dist/ts4.2/room/data-channel/LossyDataChannel.d.ts +41 -41
- package/dist/ts4.2/room/data-channel/ReliableDataChannel.d.ts +57 -57
- package/dist/ts4.2/room/data-channel/types.d.ts +12 -12
- package/dist/ts4.2/room/data-stream/compression.d.ts +49 -49
- package/dist/ts4.2/room/data-stream/constants.d.ts +18 -18
- package/dist/ts4.2/room/data-stream/incoming/IncomingDataStreamManager.d.ts +29 -29
- package/dist/ts4.2/room/data-stream/incoming/StreamReader.d.ts +80 -80
- package/dist/ts4.2/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts +73 -73
- package/dist/ts4.2/room/data-stream/outgoing/StreamWriter.d.ts +16 -16
- package/dist/ts4.2/room/data-stream/outgoing/header-utils.d.ts +18 -18
- package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +79 -80
- package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +50 -50
- package/dist/ts4.2/room/data-track/depacketizer.d.ts +59 -59
- package/dist/ts4.2/room/data-track/frame.d.ts +22 -22
- package/dist/ts4.2/room/data-track/handle.d.ts +27 -27
- package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +124 -124
- package/dist/ts4.2/room/data-track/incoming/errors.d.ts +24 -24
- package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +41 -41
- package/dist/ts4.2/room/data-track/incoming/types.d.ts +20 -20
- package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +126 -126
- package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +74 -74
- package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +23 -23
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +48 -48
- package/dist/ts4.2/room/data-track/packet/constants.d.ts +20 -20
- package/dist/ts4.2/room/data-track/packet/errors.d.ts +40 -40
- package/dist/ts4.2/room/data-track/packet/extensions.d.ts +69 -69
- package/dist/ts4.2/room/data-track/packet/index.d.ts +98 -98
- package/dist/ts4.2/room/data-track/packet/serializable.d.ts +13 -13
- package/dist/ts4.2/room/data-track/packetizer.d.ts +43 -43
- package/dist/ts4.2/room/data-track/track-interfaces.d.ts +23 -23
- package/dist/ts4.2/room/data-track/types.d.ts +22 -22
- package/dist/ts4.2/room/data-track/utils.d.ts +60 -60
- package/dist/ts4.2/room/debounce.d.ts +11 -11
- package/dist/ts4.2/room/defaults.d.ts +9 -9
- package/dist/ts4.2/room/errors.d.ts +180 -162
- package/dist/ts4.2/room/events.d.ts +638 -637
- package/dist/ts4.2/room/participant/LocalParticipant.d.ts +291 -287
- package/dist/ts4.2/room/participant/Participant.d.ts +142 -144
- package/dist/ts4.2/room/participant/ParticipantTrackPermission.d.ts +26 -26
- package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +85 -86
- package/dist/ts4.2/room/participant/publishUtils.d.ts +53 -53
- package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -43
- package/dist/ts4.2/room/rpc/client/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/index.d.ts +7 -7
- package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -44
- package/dist/ts4.2/room/rpc/server/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/utils.d.ts +131 -131
- package/dist/ts4.2/room/stats.d.ts +71 -71
- package/dist/ts4.2/room/statsSummary.d.ts +13 -13
- package/dist/ts4.2/room/timers.d.ts +12 -12
- package/dist/ts4.2/room/token-source/TokenSource.d.ts +82 -82
- package/dist/ts4.2/room/token-source/types.d.ts +70 -70
- package/dist/ts4.2/room/token-source/utils.d.ts +8 -8
- package/dist/ts4.2/room/track/FrameMetadataExtractor.d.ts +19 -19
- package/dist/ts4.2/room/track/LocalAudioTrack.d.ts +62 -42
- package/dist/ts4.2/room/track/LocalTrack.d.ts +143 -125
- package/dist/ts4.2/room/track/LocalTrackPublication.d.ts +42 -42
- package/dist/ts4.2/room/track/LocalVideoTrack.d.ts +109 -100
- package/dist/ts4.2/room/track/RemoteAudioTrack.d.ts +61 -55
- package/dist/ts4.2/room/track/RemoteTrack.d.ts +38 -38
- package/dist/ts4.2/room/track/RemoteTrackPublication.d.ts +72 -75
- package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +73 -76
- package/dist/ts4.2/room/track/Track.d.ts +156 -166
- package/dist/ts4.2/room/track/TrackPublication.d.ts +75 -81
- package/dist/ts4.2/room/track/create.d.ts +25 -25
- package/dist/ts4.2/room/track/facingMode.d.ts +41 -41
- package/dist/ts4.2/room/track/options.d.ts +403 -403
- package/dist/ts4.2/room/track/processor/types.d.ts +42 -31
- package/dist/ts4.2/room/track/record.d.ts +13 -13
- package/dist/ts4.2/room/track/types.d.ts +28 -28
- package/dist/ts4.2/room/track/utils.d.ts +60 -47
- package/dist/ts4.2/room/types.d.ts +127 -127
- package/dist/ts4.2/room/utils.d.ts +273 -214
- package/dist/ts4.2/test/MockMediaStreamTrack.d.ts +26 -26
- package/dist/ts4.2/test/compressionStreamStubs.d.ts +12 -0
- package/dist/ts4.2/test/mocks.d.ts +12 -12
- package/dist/ts4.2/test/promiseState.d.ts +12 -12
- package/dist/ts4.2/test/signalToken.d.ts +26 -26
- package/dist/ts4.2/type-polyfills/non-shared-typed-arrays.d.ts +2 -2
- package/dist/ts4.2/utils/AsyncQueue.d.ts +23 -23
- package/dist/ts4.2/utils/TypedPromise.d.ts +17 -17
- package/dist/ts4.2/utils/abort-signal-polyfill.d.ts +13 -13
- package/dist/ts4.2/utils/browserParser.d.ts +13 -13
- package/dist/ts4.2/utils/camelToSnakeCase.d.ts +8 -8
- package/dist/ts4.2/utils/cloneDeep.d.ts +2 -2
- package/dist/ts4.2/utils/dataPacketBuffer.d.ts +34 -34
- package/dist/ts4.2/utils/deferrable-map.d.ts +32 -32
- package/dist/ts4.2/utils/machineInspector.d.ts +54 -54
- package/dist/ts4.2/utils/serializer.d.ts +48 -48
- package/dist/ts4.2/utils/subscribeToEvents.d.ts +15 -15
- package/dist/ts4.2/utils/ttlmap.d.ts +20 -20
- package/dist/ts4.2/version.d.ts +15 -15
- package/package.json +5 -4
- package/src/api/SignalClient.e2e.test.ts +1 -3
- package/src/api/SignalClient.test.ts +394 -10
- package/src/api/SignalClient.ts +132 -76
- package/src/api/WebSocketStream.test.ts +11 -0
- package/src/api/WebSocketStream.ts +22 -1
- package/src/api/utils.ts +1 -1
- package/src/e2ee/E2eeManager.test.ts +43 -0
- package/src/e2ee/E2eeManager.ts +6 -2
- package/src/e2ee/worker/FrameCryptor.test.ts +212 -90
- package/src/e2ee/worker/FrameCryptor.ts +21 -4
- package/src/e2ee/worker/naluUtils.test.ts +123 -0
- package/src/e2ee/worker/naluUtils.ts +57 -2
- package/src/index.ts +2 -0
- package/src/options.ts +16 -0
- package/src/room/DefaultReconnectPolicy.test.ts +58 -0
- package/src/room/DefaultReconnectPolicy.ts +14 -2
- package/src/room/PCTransport.test.ts +327 -9
- package/src/room/PCTransport.ts +339 -36
- package/src/room/PCTransportManager.ts +3 -1
- package/src/room/RTCEngine.test.ts +318 -2
- package/src/room/RTCEngine.ts +126 -12
- package/src/room/Room.test.ts +148 -6
- package/src/room/Room.ts +312 -80
- package/src/room/data-channel/DataChannelManager.test.ts +24 -7
- package/src/room/data-channel/DataChannelManager.ts +43 -38
- package/src/room/data-channel/FlowControlledDataChannel.test.ts +60 -18
- package/src/room/data-channel/FlowControlledDataChannel.ts +40 -22
- package/src/room/data-channel/LossyDataChannel.test.ts +38 -0
- package/src/room/data-channel/LossyDataChannel.ts +10 -1
- package/src/room/data-channel/ReliableDataChannel.test.ts +72 -0
- package/src/room/data-channel/ReliableDataChannel.ts +16 -5
- package/src/room/data-stream/incoming/IncomingDataStreamManager.test.ts +47 -20
- package/src/room/data-stream/incoming/IncomingDataStreamManager.ts +16 -5
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.test.ts +60 -39
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +4 -4
- package/src/room/defaults.ts +1 -0
- package/src/room/errors.test.ts +36 -0
- package/src/room/errors.ts +27 -0
- package/src/room/events.ts +2 -1
- package/src/room/participant/LocalParticipant.test.ts +136 -1
- package/src/room/participant/LocalParticipant.ts +66 -17
- package/src/room/participant/Participant.ts +6 -3
- package/src/room/participant/publishUtils.ts +0 -19
- package/src/room/participant/restartOnDefaultAudioDevice.test.ts +177 -0
- package/src/room/rpc/client/RpcClientManager.test.ts +51 -0
- package/src/room/rpc/client/RpcClientManager.ts +32 -15
- package/src/room/rpc/utils.test.ts +32 -0
- package/src/room/rpc/utils.ts +7 -0
- package/src/room/track/LocalAudioTrack.ts +101 -10
- package/src/room/track/LocalTrack.ts +87 -19
- package/src/room/track/LocalVideoTrack.ts +17 -3
- package/src/room/track/RemoteAudioTrack.ts +59 -14
- package/src/room/track/RemoteVideoTrack.test.ts +210 -0
- package/src/room/track/RemoteVideoTrack.ts +29 -3
- package/src/room/track/processor/types.ts +11 -0
- package/src/room/track/utils.test.ts +206 -2
- package/src/room/track/utils.ts +117 -5
- package/src/room/utils.test.ts +250 -0
- package/src/room/utils.ts +152 -19
- package/src/test/compressionStreamStubs.ts +53 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mint a LiveKit access token for the mock test-server (HS256, dev secret).
|
|
3
|
-
*
|
|
4
|
-
* The mock's signal behavior mode is selected via a participant attribute
|
|
5
|
-
* under the reserved key `lk.mock` (dot notation, matching LiveKit's internal
|
|
6
|
-
* attribute convention), whose value is the JSON control object
|
|
7
|
-
* `{"signal":"<mode>"}` — mirroring the X-Lk-Mock header protocol. Attributes
|
|
8
|
-
* are a standard AccessToken field (a string map), so a dedicated `lk-mock`
|
|
9
|
-
* key coexists with any real metadata/attributes and needs no bespoke token
|
|
10
|
-
* construction. The room name is just a room; it no longer encodes behavior.
|
|
11
|
-
*/
|
|
12
|
-
export interface TokenOptions {
|
|
13
|
-
/** Mock behavior mode (e.g. 'no_pong'); omitted → the mock defaults to 'happy'. */
|
|
14
|
-
signal?: string;
|
|
15
|
-
/** LeaveRequest action the leave modes should send (0=DISCONNECT,1=RESUME,2=RECONNECT). */
|
|
16
|
-
leaveAction?: number;
|
|
17
|
-
room?: string;
|
|
18
|
-
identity?: string;
|
|
19
|
-
apiKey?: string;
|
|
20
|
-
secret?: string;
|
|
21
|
-
ttlSeconds?: number;
|
|
22
|
-
}
|
|
23
|
-
export declare function createToken(opts?: TokenOptions): Promise<string>;
|
|
24
|
-
/** A syntactically-valid token signed with the WRONG secret — for 401 tests. */
|
|
25
|
-
export declare function createInvalidToken(): Promise<string>;
|
|
26
|
-
//# sourceMappingURL=signalToken.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* Mint a LiveKit access token for the mock test-server (HS256, dev secret).
|
|
3
|
+
*
|
|
4
|
+
* The mock's signal behavior mode is selected via a participant attribute
|
|
5
|
+
* under the reserved key `lk.mock` (dot notation, matching LiveKit's internal
|
|
6
|
+
* attribute convention), whose value is the JSON control object
|
|
7
|
+
* `{"signal":"<mode>"}` — mirroring the X-Lk-Mock header protocol. Attributes
|
|
8
|
+
* are a standard AccessToken field (a string map), so a dedicated `lk-mock`
|
|
9
|
+
* key coexists with any real metadata/attributes and needs no bespoke token
|
|
10
|
+
* construction. The room name is just a room; it no longer encodes behavior.
|
|
11
|
+
*/
|
|
12
|
+
export interface TokenOptions {
|
|
13
|
+
/** Mock behavior mode (e.g. 'no_pong'); omitted → the mock defaults to 'happy'. */
|
|
14
|
+
signal?: string;
|
|
15
|
+
/** LeaveRequest action the leave modes should send (0=DISCONNECT,1=RESUME,2=RECONNECT). */
|
|
16
|
+
leaveAction?: number;
|
|
17
|
+
room?: string;
|
|
18
|
+
identity?: string;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
secret?: string;
|
|
21
|
+
ttlSeconds?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function createToken(opts?: TokenOptions): Promise<string>;
|
|
24
|
+
/** A syntactically-valid token signed with the WRONG secret — for 401 tests. */
|
|
25
|
+
export declare function createInvalidToken(): Promise<string>;
|
|
26
|
+
//# sourceMappingURL=signalToken.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type NonSharedUint8Array = ReturnType<typeof Uint8Array.from>;
|
|
2
|
-
//# sourceMappingURL=non-shared-typed-arrays.d.ts.map
|
|
1
|
+
export type NonSharedUint8Array = ReturnType<typeof Uint8Array.from>;
|
|
2
|
+
//# sourceMappingURL=non-shared-typed-arrays.d.ts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
type QueueTask<T> = () => PromiseLike<T>;
|
|
2
|
-
declare enum QueueTaskStatus {
|
|
3
|
-
WAITING = 0,
|
|
4
|
-
RUNNING = 1,
|
|
5
|
-
COMPLETED = 2
|
|
6
|
-
}
|
|
7
|
-
type QueueTaskInfo = {
|
|
8
|
-
id: number;
|
|
9
|
-
enqueuedAt: number;
|
|
10
|
-
executedAt?: number;
|
|
11
|
-
status: QueueTaskStatus;
|
|
12
|
-
};
|
|
13
|
-
export declare class AsyncQueue {
|
|
14
|
-
private pendingTasks;
|
|
15
|
-
private taskMutex;
|
|
16
|
-
private nextTaskIndex;
|
|
17
|
-
constructor();
|
|
18
|
-
run<T>(task: QueueTask<T>): Promise<T>;
|
|
19
|
-
flush(): Promise<void>;
|
|
20
|
-
snapshot(): QueueTaskInfo[];
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=AsyncQueue.d.ts.map
|
|
1
|
+
type QueueTask<T> = () => PromiseLike<T>;
|
|
2
|
+
declare enum QueueTaskStatus {
|
|
3
|
+
WAITING = 0,
|
|
4
|
+
RUNNING = 1,
|
|
5
|
+
COMPLETED = 2
|
|
6
|
+
}
|
|
7
|
+
type QueueTaskInfo = {
|
|
8
|
+
id: number;
|
|
9
|
+
enqueuedAt: number;
|
|
10
|
+
executedAt?: number;
|
|
11
|
+
status: QueueTaskStatus;
|
|
12
|
+
};
|
|
13
|
+
export declare class AsyncQueue {
|
|
14
|
+
private pendingTasks;
|
|
15
|
+
private taskMutex;
|
|
16
|
+
private nextTaskIndex;
|
|
17
|
+
constructor();
|
|
18
|
+
run<T>(task: QueueTask<T>): Promise<T>;
|
|
19
|
+
flush(): Promise<void>;
|
|
20
|
+
snapshot(): QueueTaskInfo[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=AsyncQueue.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
type InferErrors<T> = T extends TypedPromise<any, infer E> ? E : never;
|
|
2
|
-
export default class TypedPromise<T, E extends Error> extends Promise<T> {
|
|
3
|
-
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: E) => void) => void);
|
|
4
|
-
catch<TResult = never>(onrejected?: ((reason: E) => TResult | PromiseLike<TResult>) | null | undefined): TypedPromise<T | TResult, E>;
|
|
5
|
-
static resolve: {
|
|
6
|
-
(): TypedPromise<void, never>;
|
|
7
|
-
<V>(value: V): TypedPromise<Awaited<V>, never>;
|
|
8
|
-
};
|
|
9
|
-
static reject<E extends Error>(reason: E): TypedPromise<never, E>;
|
|
10
|
-
static all<T extends readonly unknown[] | [
|
|
11
|
-
]>(values: T): TypedPromise<{
|
|
12
|
-
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
13
|
-
}, InferErrors<T[number]>>;
|
|
14
|
-
static race<T extends readonly (TypedPromise<any, any> | any)[]>(values: T): TypedPromise<T[number] extends TypedPromise<infer U, any> ? U : T[number] extends PromiseLike<infer U> ? U : Awaited<T[number]>, InferErrors<T[number]>>;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=TypedPromise.d.ts.map
|
|
1
|
+
type InferErrors<T> = T extends TypedPromise<any, infer E> ? E : never;
|
|
2
|
+
export default class TypedPromise<T, E extends Error> extends Promise<T> {
|
|
3
|
+
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: E) => void) => void);
|
|
4
|
+
catch<TResult = never>(onrejected?: ((reason: E) => TResult | PromiseLike<TResult>) | null | undefined): TypedPromise<T | TResult, E>;
|
|
5
|
+
static resolve: {
|
|
6
|
+
(): TypedPromise<void, never>;
|
|
7
|
+
<V>(value: V): TypedPromise<Awaited<V>, never>;
|
|
8
|
+
};
|
|
9
|
+
static reject<E extends Error>(reason: E): TypedPromise<never, E>;
|
|
10
|
+
static all<T extends readonly unknown[] | [
|
|
11
|
+
]>(values: T): TypedPromise<{
|
|
12
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
13
|
+
}, InferErrors<T[number]>>;
|
|
14
|
+
static race<T extends readonly (TypedPromise<any, any> | any)[]>(values: T): TypedPromise<T[number] extends TypedPromise<infer U, any> ? U : T[number] extends PromiseLike<infer U> ? U : Awaited<T[number]>, InferErrors<T[number]>>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=TypedPromise.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implementation of AbortSignal.any
|
|
3
|
-
* Creates a signal that will be aborted when any of the given signals is aborted.
|
|
4
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any
|
|
5
|
-
*/
|
|
6
|
-
export declare function abortSignalAny(signals: Array<AbortSignal>): AbortSignal;
|
|
7
|
-
/**
|
|
8
|
-
* Implementation of AbortSignal.timeout
|
|
9
|
-
* Creates a signal that will be aborted after the specified timeout.
|
|
10
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout
|
|
11
|
-
*/
|
|
12
|
-
export declare function abortSignalTimeout(ms: number): AbortSignal;
|
|
13
|
-
//# sourceMappingURL=abort-signal-polyfill.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* Implementation of AbortSignal.any
|
|
3
|
+
* Creates a signal that will be aborted when any of the given signals is aborted.
|
|
4
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any
|
|
5
|
+
*/
|
|
6
|
+
export declare function abortSignalAny(signals: Array<AbortSignal>): AbortSignal;
|
|
7
|
+
/**
|
|
8
|
+
* Implementation of AbortSignal.timeout
|
|
9
|
+
* Creates a signal that will be aborted after the specified timeout.
|
|
10
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout
|
|
11
|
+
*/
|
|
12
|
+
export declare function abortSignalTimeout(ms: number): AbortSignal;
|
|
13
|
+
//# sourceMappingURL=abort-signal-polyfill.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type DetectableBrowser = 'Chrome' | 'Firefox' | 'Safari';
|
|
2
|
-
export type DetectableOS = 'iOS' | 'macOS';
|
|
3
|
-
export type BrowserDetails = {
|
|
4
|
-
name: DetectableBrowser;
|
|
5
|
-
version: string;
|
|
6
|
-
os?: DetectableOS;
|
|
7
|
-
osVersion?: string;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined;
|
|
13
|
-
//# sourceMappingURL=browserParser.d.ts.map
|
|
1
|
+
export type DetectableBrowser = 'Chrome' | 'Firefox' | 'Safari';
|
|
2
|
+
export type DetectableOS = 'iOS' | 'macOS';
|
|
3
|
+
export type BrowserDetails = {
|
|
4
|
+
name: DetectableBrowser;
|
|
5
|
+
version: string;
|
|
6
|
+
os?: DetectableOS;
|
|
7
|
+
osVersion?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined;
|
|
13
|
+
//# sourceMappingURL=browserParser.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type CamelToSnakeCase<Str extends string> = Str extends `${infer First}${infer Rest}` ? `${First extends Capitalize<First> ? '_' : ''}${Lowercase<First>}${CamelToSnakeCase<Rest>}` : Str;
|
|
2
|
-
type ArrayValuesToSnakeCase<Item> = Array<ValueToSnakeCase<Item>>;
|
|
3
|
-
type ObjectKeysToSnakeCase<Obj> = {
|
|
4
|
-
[Key in keyof Obj as CamelToSnakeCase<string & Key>]: NonNullable<ValueToSnakeCase<Obj[Key]>>;
|
|
5
|
-
};
|
|
6
|
-
export type ValueToSnakeCase<Value> = Value extends Array<infer Item> ? ArrayValuesToSnakeCase<Item> : Value extends object ? ObjectKeysToSnakeCase<Value> : Value;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=camelToSnakeCase.d.ts.map
|
|
1
|
+
export type CamelToSnakeCase<Str extends string> = Str extends `${infer First}${infer Rest}` ? `${First extends Capitalize<First> ? '_' : ''}${Lowercase<First>}${CamelToSnakeCase<Rest>}` : Str;
|
|
2
|
+
type ArrayValuesToSnakeCase<Item> = Array<ValueToSnakeCase<Item>>;
|
|
3
|
+
type ObjectKeysToSnakeCase<Obj> = {
|
|
4
|
+
[Key in keyof Obj as CamelToSnakeCase<string & Key>]: NonNullable<ValueToSnakeCase<Obj[Key]>>;
|
|
5
|
+
};
|
|
6
|
+
export type ValueToSnakeCase<Value> = Value extends Array<infer Item> ? ArrayValuesToSnakeCase<Item> : Value extends object ? ObjectKeysToSnakeCase<Value> : Value;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=camelToSnakeCase.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function cloneDeep<T>(value: T): T;
|
|
2
|
-
//# sourceMappingURL=cloneDeep.d.ts.map
|
|
1
|
+
export declare function cloneDeep<T>(value: T): T;
|
|
2
|
+
//# sourceMappingURL=cloneDeep.d.ts.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
2
|
-
export interface DataPacketItem {
|
|
3
|
-
data: NonSharedUint8Array;
|
|
4
|
-
sequence: number;
|
|
5
|
-
/**
|
|
6
|
-
* Whether the packet has been handed to the data channel. Unsent packets are queued for the
|
|
7
|
-
* resume replay (e.g. sends that landed in a reconnect window) and must never be trimmed by
|
|
8
|
-
* {@link DataPacketBuffer.alignBufferedAmount}, which reasons about the channel's buffered
|
|
9
|
-
* bytes — those only ever contain sent packets.
|
|
10
|
-
*/
|
|
11
|
-
sent: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class DataPacketBuffer {
|
|
14
|
-
private buffer;
|
|
15
|
-
private _totalSize;
|
|
16
|
-
private _sentSize;
|
|
17
|
-
push(item: DataPacketItem): void;
|
|
18
|
-
pop(): DataPacketItem | undefined;
|
|
19
|
-
getAll(): DataPacketItem[];
|
|
20
|
-
/** Every queued packet not yet handed to the channel, in sequence order. */
|
|
21
|
-
getUnsent(): DataPacketItem[];
|
|
22
|
-
/** Marks a single queued packet as handed to the channel. */
|
|
23
|
-
markSent(item: DataPacketItem): void;
|
|
24
|
-
/**
|
|
25
|
-
* Marks every queued packet as not-yet-sent. Used at the start of a resume replay: whatever is
|
|
26
|
-
* still buffered was sent on the previous channel (or deferred) and must be re-handed to the
|
|
27
|
-
* current one, so none of it counts as sent until the replay actually transmits it.
|
|
28
|
-
*/
|
|
29
|
-
markAllUnsent(): void;
|
|
30
|
-
popToSequence(sequence: number): void;
|
|
31
|
-
alignBufferedAmount(bufferedAmount: number): void;
|
|
32
|
-
get length(): number;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=dataPacketBuffer.d.ts.map
|
|
1
|
+
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
2
|
+
export interface DataPacketItem {
|
|
3
|
+
data: NonSharedUint8Array;
|
|
4
|
+
sequence: number;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the packet has been handed to the data channel. Unsent packets are queued for the
|
|
7
|
+
* resume replay (e.g. sends that landed in a reconnect window) and must never be trimmed by
|
|
8
|
+
* {@link DataPacketBuffer.alignBufferedAmount}, which reasons about the channel's buffered
|
|
9
|
+
* bytes — those only ever contain sent packets.
|
|
10
|
+
*/
|
|
11
|
+
sent: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class DataPacketBuffer {
|
|
14
|
+
private buffer;
|
|
15
|
+
private _totalSize;
|
|
16
|
+
private _sentSize;
|
|
17
|
+
push(item: DataPacketItem): void;
|
|
18
|
+
pop(): DataPacketItem | undefined;
|
|
19
|
+
getAll(): DataPacketItem[];
|
|
20
|
+
/** Every queued packet not yet handed to the channel, in sequence order. */
|
|
21
|
+
getUnsent(): DataPacketItem[];
|
|
22
|
+
/** Marks a single queued packet as handed to the channel. */
|
|
23
|
+
markSent(item: DataPacketItem): void;
|
|
24
|
+
/**
|
|
25
|
+
* Marks every queued packet as not-yet-sent. Used at the start of a resume replay: whatever is
|
|
26
|
+
* still buffered was sent on the previous channel (or deferred) and must be re-handed to the
|
|
27
|
+
* current one, so none of it counts as sent until the replay actually transmits it.
|
|
28
|
+
*/
|
|
29
|
+
markAllUnsent(): void;
|
|
30
|
+
popToSequence(sequence: number): void;
|
|
31
|
+
alignBufferedAmount(bufferedAmount: number): void;
|
|
32
|
+
get length(): number;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=dataPacketBuffer.d.ts.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
-
/** An error which is thrown if a {@link DeferrableMap#getDeferred} call is aborted midway
|
|
3
|
-
* through. */
|
|
4
|
-
export declare class DeferrableMapAbortError extends DOMException {
|
|
5
|
-
reason: unknown;
|
|
6
|
-
constructor(message: string, reason?: unknown);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A Map-like container keyed by unique strings that supports the ability to wait
|
|
10
|
-
* for future keys to show up in the map.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // An already existing key:
|
|
14
|
-
* const value = map.get("key");
|
|
15
|
-
* // Wait for a key which will be added soon:
|
|
16
|
-
* const value = await map.getDeferred("key");
|
|
17
|
-
*/
|
|
18
|
-
export declare class DeferrableMap<K, V> extends Map<K, V> {
|
|
19
|
-
private pending;
|
|
20
|
-
set(key: K, value: V): this;
|
|
21
|
-
get [Symbol.toStringTag](): string;
|
|
22
|
-
/**
|
|
23
|
-
* Returns the value for `key` immediately if it exists, otherwise returns a
|
|
24
|
-
* promise that resolves once `set(key, value)` is called.
|
|
25
|
-
*
|
|
26
|
-
* If an `AbortSignal` is provided and it is aborted before the key appears,
|
|
27
|
-
* the returned promise rejects with an {@link DeferrableMapAbortError}.
|
|
28
|
-
*/
|
|
29
|
-
getDeferred(key: K): Promise<V>;
|
|
30
|
-
getDeferred(key: K, signal: AbortSignal): Promise<Throws<V, DeferrableMapAbortError>>;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=deferrable-map.d.ts.map
|
|
1
|
+
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
+
/** An error which is thrown if a {@link DeferrableMap#getDeferred} call is aborted midway
|
|
3
|
+
* through. */
|
|
4
|
+
export declare class DeferrableMapAbortError extends DOMException {
|
|
5
|
+
reason: unknown;
|
|
6
|
+
constructor(message: string, reason?: unknown);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A Map-like container keyed by unique strings that supports the ability to wait
|
|
10
|
+
* for future keys to show up in the map.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // An already existing key:
|
|
14
|
+
* const value = map.get("key");
|
|
15
|
+
* // Wait for a key which will be added soon:
|
|
16
|
+
* const value = await map.getDeferred("key");
|
|
17
|
+
*/
|
|
18
|
+
export declare class DeferrableMap<K, V> extends Map<K, V> {
|
|
19
|
+
private pending;
|
|
20
|
+
set(key: K, value: V): this;
|
|
21
|
+
get [Symbol.toStringTag](): string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the value for `key` immediately if it exists, otherwise returns a
|
|
24
|
+
* promise that resolves once `set(key, value)` is called.
|
|
25
|
+
*
|
|
26
|
+
* If an `AbortSignal` is provided and it is aborted before the key appears,
|
|
27
|
+
* the returned promise rejects with an {@link DeferrableMapAbortError}.
|
|
28
|
+
*/
|
|
29
|
+
getDeferred(key: K): Promise<V>;
|
|
30
|
+
getDeferred(key: K, signal: AbortSignal): Promise<Throws<V, DeferrableMapAbortError>>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=deferrable-map.d.ts.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Opt-in registry that lets a development tool observe the state machines driving the connection
|
|
3
|
-
* layer.
|
|
4
|
-
*
|
|
5
|
-
* The machines are private to the objects that own them and, more importantly, do not outlive them:
|
|
6
|
-
* a full reconnect replaces the whole engine along with its `SignalClient`, so anything watching a
|
|
7
|
-
* single machine reference goes blind exactly when the interesting part starts. Machines therefore
|
|
8
|
-
* announce themselves here as they are constructed, and a subscriber sees the whole succession.
|
|
9
|
-
*
|
|
10
|
-
* Nothing is recorded until {@link enableMachineInspector} is called, which no shipping code does —
|
|
11
|
-
* with the registry off, announcing is a comparison and a return.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* The slice of machina's `Fsm` surface an inspector needs. Structural rather than machina's own
|
|
15
|
-
* type so that any machine satisfies it regardless of its state and input unions.
|
|
16
|
-
*/
|
|
17
|
-
export interface InspectableMachine {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly initialState: string;
|
|
20
|
-
readonly states: Record<string, Record<string, unknown>>;
|
|
21
|
-
readonly context?: unknown;
|
|
22
|
-
currentState(): string;
|
|
23
|
-
canHandle(input: string): boolean;
|
|
24
|
-
on(eventName: string, callback: (data: any) => void): {
|
|
25
|
-
off(): void;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface MachineAnnouncement {
|
|
29
|
-
/** What the machine drives, e.g. `signal`. Not unique: each new `SignalClient` announces one. */
|
|
30
|
-
label: string;
|
|
31
|
-
/** How many machines have been announced before this one, so successive instances are tellable apart. */
|
|
32
|
-
seq: number;
|
|
33
|
-
/**
|
|
34
|
-
* When the machine was constructed. Carried on the announcement because subscribers receive the
|
|
35
|
-
* recorded ones on subscribe, and stamping those at replay time would date them all to whenever
|
|
36
|
-
* the tool happened to open.
|
|
37
|
-
*/
|
|
38
|
-
at: number;
|
|
39
|
-
machine: InspectableMachine;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Starts recording machine announcements. Call before the machines of interest are constructed —
|
|
43
|
-
* for the signal machine that means before the `Room` is created.
|
|
44
|
-
*/
|
|
45
|
-
export declare function enableMachineInspector(): void;
|
|
46
|
-
export declare function isMachineInspectorEnabled(): boolean;
|
|
47
|
-
/** Announces a machine to whatever is watching. A no-op unless the inspector was enabled. */
|
|
48
|
-
export declare function announceMachine(label: string, machine: InspectableMachine): void;
|
|
49
|
-
/**
|
|
50
|
-
* Subscribes to machine announcements, replaying the ones already recorded so that a panel opened
|
|
51
|
-
* after connecting still sees the machine currently in charge. Returns an unsubscribe function.
|
|
52
|
-
*/
|
|
53
|
-
export declare function onMachineAnnounced(callback: (announcement: MachineAnnouncement) => void): () => void;
|
|
54
|
-
//# sourceMappingURL=machineInspector.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in registry that lets a development tool observe the state machines driving the connection
|
|
3
|
+
* layer.
|
|
4
|
+
*
|
|
5
|
+
* The machines are private to the objects that own them and, more importantly, do not outlive them:
|
|
6
|
+
* a full reconnect replaces the whole engine along with its `SignalClient`, so anything watching a
|
|
7
|
+
* single machine reference goes blind exactly when the interesting part starts. Machines therefore
|
|
8
|
+
* announce themselves here as they are constructed, and a subscriber sees the whole succession.
|
|
9
|
+
*
|
|
10
|
+
* Nothing is recorded until {@link enableMachineInspector} is called, which no shipping code does —
|
|
11
|
+
* with the registry off, announcing is a comparison and a return.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The slice of machina's `Fsm` surface an inspector needs. Structural rather than machina's own
|
|
15
|
+
* type so that any machine satisfies it regardless of its state and input unions.
|
|
16
|
+
*/
|
|
17
|
+
export interface InspectableMachine {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly initialState: string;
|
|
20
|
+
readonly states: Record<string, Record<string, unknown>>;
|
|
21
|
+
readonly context?: unknown;
|
|
22
|
+
currentState(): string;
|
|
23
|
+
canHandle(input: string): boolean;
|
|
24
|
+
on(eventName: string, callback: (data: any) => void): {
|
|
25
|
+
off(): void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface MachineAnnouncement {
|
|
29
|
+
/** What the machine drives, e.g. `signal`. Not unique: each new `SignalClient` announces one. */
|
|
30
|
+
label: string;
|
|
31
|
+
/** How many machines have been announced before this one, so successive instances are tellable apart. */
|
|
32
|
+
seq: number;
|
|
33
|
+
/**
|
|
34
|
+
* When the machine was constructed. Carried on the announcement because subscribers receive the
|
|
35
|
+
* recorded ones on subscribe, and stamping those at replay time would date them all to whenever
|
|
36
|
+
* the tool happened to open.
|
|
37
|
+
*/
|
|
38
|
+
at: number;
|
|
39
|
+
machine: InspectableMachine;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Starts recording machine announcements. Call before the machines of interest are constructed —
|
|
43
|
+
* for the signal machine that means before the `Room` is created.
|
|
44
|
+
*/
|
|
45
|
+
export declare function enableMachineInspector(): void;
|
|
46
|
+
export declare function isMachineInspectorEnabled(): boolean;
|
|
47
|
+
/** Announces a machine to whatever is watching. A no-op unless the inspector was enabled. */
|
|
48
|
+
export declare function announceMachine(label: string, machine: InspectableMachine): void;
|
|
49
|
+
/**
|
|
50
|
+
* Subscribes to machine announcements, replaying the ones already recorded so that a panel opened
|
|
51
|
+
* after connecting still sees the machine currently in charge. Returns an unsubscribe function.
|
|
52
|
+
*/
|
|
53
|
+
export declare function onMachineAnnounced(callback: (announcement: MachineAnnouncement) => void): () => void;
|
|
54
|
+
//# sourceMappingURL=machineInspector.d.ts.map
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
declare const SerializerSymbol: unique symbol;
|
|
2
|
-
/**
|
|
3
|
-
* A bidirectional data format descriptor for message payloads.
|
|
4
|
-
*
|
|
5
|
-
* - `parse(raw)` decodes an incoming wire string into `Input` (used by handlers)
|
|
6
|
-
* - `serialize(val)` encodes an `Output` value to a wire string (used by handlers)
|
|
7
|
-
*
|
|
8
|
-
* For symmetric serializers (`serializers.raw`), `Input === Output === string`.
|
|
9
|
-
* For `serializers.json`, both default to `any` so each handler can annotate its own types.
|
|
10
|
-
* Use `serializers.custom` to supply your own `parse`/`serialize` pair.
|
|
11
|
-
*
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
export type Serializer<Input, Output> = {
|
|
15
|
-
symbol: typeof SerializerSymbol;
|
|
16
|
-
parse: (raw: string) => Input;
|
|
17
|
-
serialize: (val: Output) => string;
|
|
18
|
-
};
|
|
19
|
-
export declare function isSerializer(v: unknown): v is Serializer<any, any>;
|
|
20
|
-
export type SerializerInput<S> = S extends Serializer<infer Input, any> ? Input : any;
|
|
21
|
-
export type SerializerOutput<S> = S extends Serializer<any, infer Output> ? Output : any;
|
|
22
|
-
/**
|
|
23
|
-
* JSON serializer — `JSON.parse` on the way in, `JSON.stringify` on the way out.
|
|
24
|
-
* Defaults to `any` so individual handlers can annotate their own payload types.
|
|
25
|
-
*/
|
|
26
|
-
declare function json<Input = any, Output = any>(): Serializer<Input, Output>;
|
|
27
|
-
/** Raw string serializer — passes payloads through as plain strings with no encoding. */
|
|
28
|
-
declare function raw(): Serializer<string, string>;
|
|
29
|
-
/** Custom serializer - allows custom defined parse and serialize functions */
|
|
30
|
-
declare function custom<Input = any, Output = any>(params: Omit<Serializer<Input, Output>, 'symbol'>): Serializer<Input, Output>;
|
|
31
|
-
/**
|
|
32
|
-
* Serializer helpers for message payload encoding.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const a = serializers.raw(); // Serializer<string, string>
|
|
37
|
-
* const b = serializer.json<{ foo: string }, { bar: string }>(); // Serializer<{ foo: string }, { bar: string }>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @beta
|
|
41
|
-
*/
|
|
42
|
-
export declare const serializers: {
|
|
43
|
-
json: typeof json;
|
|
44
|
-
raw: typeof raw;
|
|
45
|
-
custom: typeof custom;
|
|
46
|
-
};
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=serializer.d.ts.map
|
|
1
|
+
declare const SerializerSymbol: unique symbol;
|
|
2
|
+
/**
|
|
3
|
+
* A bidirectional data format descriptor for message payloads.
|
|
4
|
+
*
|
|
5
|
+
* - `parse(raw)` decodes an incoming wire string into `Input` (used by handlers)
|
|
6
|
+
* - `serialize(val)` encodes an `Output` value to a wire string (used by handlers)
|
|
7
|
+
*
|
|
8
|
+
* For symmetric serializers (`serializers.raw`), `Input === Output === string`.
|
|
9
|
+
* For `serializers.json`, both default to `any` so each handler can annotate its own types.
|
|
10
|
+
* Use `serializers.custom` to supply your own `parse`/`serialize` pair.
|
|
11
|
+
*
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export type Serializer<Input, Output> = {
|
|
15
|
+
symbol: typeof SerializerSymbol;
|
|
16
|
+
parse: (raw: string) => Input;
|
|
17
|
+
serialize: (val: Output) => string;
|
|
18
|
+
};
|
|
19
|
+
export declare function isSerializer(v: unknown): v is Serializer<any, any>;
|
|
20
|
+
export type SerializerInput<S> = S extends Serializer<infer Input, any> ? Input : any;
|
|
21
|
+
export type SerializerOutput<S> = S extends Serializer<any, infer Output> ? Output : any;
|
|
22
|
+
/**
|
|
23
|
+
* JSON serializer — `JSON.parse` on the way in, `JSON.stringify` on the way out.
|
|
24
|
+
* Defaults to `any` so individual handlers can annotate their own payload types.
|
|
25
|
+
*/
|
|
26
|
+
declare function json<Input = any, Output = any>(): Serializer<Input, Output>;
|
|
27
|
+
/** Raw string serializer — passes payloads through as plain strings with no encoding. */
|
|
28
|
+
declare function raw(): Serializer<string, string>;
|
|
29
|
+
/** Custom serializer - allows custom defined parse and serialize functions */
|
|
30
|
+
declare function custom<Input = any, Output = any>(params: Omit<Serializer<Input, Output>, 'symbol'>): Serializer<Input, Output>;
|
|
31
|
+
/**
|
|
32
|
+
* Serializer helpers for message payload encoding.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const a = serializers.raw(); // Serializer<string, string>
|
|
37
|
+
* const b = serializer.json<{ foo: string }, { bar: string }>(); // Serializer<{ foo: string }, { bar: string }>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @beta
|
|
41
|
+
*/
|
|
42
|
+
export declare const serializers: {
|
|
43
|
+
json: typeof json;
|
|
44
|
+
raw: typeof raw;
|
|
45
|
+
custom: typeof custom;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { EventMap } from 'typed-emitter';
|
|
2
|
-
import type TypedEventEmitter from 'typed-emitter';
|
|
3
|
-
/** A test helper to listen to events received by an event emitter and allow them to be imperatively
|
|
4
|
-
* queried after the fact. */
|
|
5
|
-
export declare function subscribeToEvents<Callbacks extends EventMap, EventNames extends keyof Callbacks = keyof Callbacks>(eventEmitter: TypedEventEmitter<Callbacks>, eventNames: Array<EventNames>): {
|
|
6
|
-
/** Listen for the next occurrance of an event to be emitted, or return the last event that was
|
|
7
|
-
* buffered (but hasn't been processed yet). */
|
|
8
|
-
waitFor<EventPayload extends Parameters<Callbacks[EventName]>[0], EventName extends EventNames = EventNames>(eventName: EventName): Promise<EventPayload>;
|
|
9
|
-
/** Are there events of the given name which are waiting to be processed? Use this to assert
|
|
10
|
-
* that no unexpected events have been emitted. */
|
|
11
|
-
areThereBufferedEvents<EventPayload extends Parameters<Callbacks[EventName]>[0], EventName extends EventNames = EventNames>(eventName: EventName): boolean;
|
|
12
|
-
/** Cleanup any lingering subscriptions. */
|
|
13
|
-
unsubscribe: () => void;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=subscribeToEvents.d.ts.map
|
|
1
|
+
import type { EventMap } from 'typed-emitter';
|
|
2
|
+
import type TypedEventEmitter from 'typed-emitter';
|
|
3
|
+
/** A test helper to listen to events received by an event emitter and allow them to be imperatively
|
|
4
|
+
* queried after the fact. */
|
|
5
|
+
export declare function subscribeToEvents<Callbacks extends EventMap, EventNames extends keyof Callbacks = keyof Callbacks>(eventEmitter: TypedEventEmitter<Callbacks>, eventNames: Array<EventNames>): {
|
|
6
|
+
/** Listen for the next occurrance of an event to be emitted, or return the last event that was
|
|
7
|
+
* buffered (but hasn't been processed yet). */
|
|
8
|
+
waitFor<EventPayload extends Parameters<Callbacks[EventName]>[0], EventName extends EventNames = EventNames>(eventName: EventName): Promise<EventPayload>;
|
|
9
|
+
/** Are there events of the given name which are waiting to be processed? Use this to assert
|
|
10
|
+
* that no unexpected events have been emitted. */
|
|
11
|
+
areThereBufferedEvents<EventPayload extends Parameters<Callbacks[EventName]>[0], EventName extends EventNames = EventNames>(eventName: EventName): boolean;
|
|
12
|
+
/** Cleanup any lingering subscriptions. */
|
|
13
|
+
unsubscribe: () => void;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=subscribeToEvents.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare class TTLMap<K, V> {
|
|
2
|
-
private _map;
|
|
3
|
-
private ttl;
|
|
4
|
-
private _lastCleanup;
|
|
5
|
-
/**
|
|
6
|
-
* @param ttl ttl of the key (ms)
|
|
7
|
-
*/
|
|
8
|
-
constructor(ttl: number);
|
|
9
|
-
set(key: K, value: V): this;
|
|
10
|
-
get(key: K): V | undefined;
|
|
11
|
-
has(key: K): boolean;
|
|
12
|
-
delete(key: K): boolean;
|
|
13
|
-
clear(): void;
|
|
14
|
-
cleanup(): void;
|
|
15
|
-
get size(): number;
|
|
16
|
-
forEach(callback: (value: V, key: K, map: Map<K, V>) => void): void;
|
|
17
|
-
map<U>(callback: (value: V, key: K, map: Map<K, V>) => U): U[];
|
|
18
|
-
private asValueMap;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ttlmap.d.ts.map
|
|
1
|
+
export declare class TTLMap<K, V> {
|
|
2
|
+
private _map;
|
|
3
|
+
private ttl;
|
|
4
|
+
private _lastCleanup;
|
|
5
|
+
/**
|
|
6
|
+
* @param ttl ttl of the key (ms)
|
|
7
|
+
*/
|
|
8
|
+
constructor(ttl: number);
|
|
9
|
+
set(key: K, value: V): this;
|
|
10
|
+
get(key: K): V | undefined;
|
|
11
|
+
has(key: K): boolean;
|
|
12
|
+
delete(key: K): boolean;
|
|
13
|
+
clear(): void;
|
|
14
|
+
cleanup(): void;
|
|
15
|
+
get size(): number;
|
|
16
|
+
forEach(callback: (value: V, key: K, map: Map<K, V>) => void): void;
|
|
17
|
+
map<U>(callback: (value: V, key: K, map: Map<K, V>) => U): U[];
|
|
18
|
+
private asValueMap;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ttlmap.d.ts.map
|