@crewdle/web-sdk-types 1.0.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 +39 -0
- package/dist/core/cluster/Cluster.d.ts +92 -0
- package/dist/core/cluster/Cluster.js +1 -0
- package/dist/core/cluster/ClusterEventEmitter.d.ts +31 -0
- package/dist/core/cluster/ClusterEventEmitter.js +1 -0
- package/dist/core/cluster/ClusterEventKeys.d.ts +6 -0
- package/dist/core/cluster/ClusterEventKeys.js +1 -0
- package/dist/core/cluster/ClusterEvents.d.ts +60 -0
- package/dist/core/cluster/ClusterEvents.js +1 -0
- package/dist/core/cluster/ClusterOnFunction.d.ts +14 -0
- package/dist/core/cluster/ClusterOnFunction.js +1 -0
- package/dist/core/cluster/event/AgentInfoEventPayload.d.ts +16 -0
- package/dist/core/cluster/event/AgentInfoEventPayload.js +1 -0
- package/dist/core/cluster/event/LocalMediaStreamTrackFailEventPayload.d.ts +15 -0
- package/dist/core/cluster/event/LocalMediaStreamTrackFailEventPayload.js +1 -0
- package/dist/core/cluster/event/NodeEventPayload.d.ts +10 -0
- package/dist/core/cluster/event/NodeEventPayload.js +1 -0
- package/dist/core/cluster/event/PublishMediaStreamEventPayload.d.ts +15 -0
- package/dist/core/cluster/event/PublishMediaStreamEventPayload.js +1 -0
- package/dist/core/cluster/event/UnpublishMediaStreamEventPayload.d.ts +14 -0
- package/dist/core/cluster/event/UnpublishMediaStreamEventPayload.js +1 -0
- package/dist/core/cluster/event/UserInfoEventPayload.d.ts +16 -0
- package/dist/core/cluster/event/UserInfoEventPayload.js +1 -0
- package/dist/core/cluster/event/index.d.ts +6 -0
- package/dist/core/cluster/event/index.js +1 -0
- package/dist/core/cluster/index.d.ts +6 -0
- package/dist/core/cluster/index.js +1 -0
- package/dist/core/connection/PeerConnectionConfiguration.d.ts +11 -0
- package/dist/core/connection/PeerConnectionConfiguration.js +1 -0
- package/dist/core/connection/PeerConnectionConnector.d.ts +136 -0
- package/dist/core/connection/PeerConnectionConnector.js +1 -0
- package/dist/core/connection/PeerConnectionConnectorConstructor.d.ts +6 -0
- package/dist/core/connection/PeerConnectionConnectorConstructor.js +1 -0
- package/dist/core/connection/PeerConnectionDataChannelConnector.d.ts +46 -0
- package/dist/core/connection/PeerConnectionDataChannelConnector.js +1 -0
- package/dist/core/connection/PeerConnectionDataChannelEvent.d.ts +11 -0
- package/dist/core/connection/PeerConnectionDataChannelEvent.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidate.d.ts +10 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidate.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidateEvent.d.ts +11 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidateEvent.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeServer.d.ts +18 -0
- package/dist/core/connection/PeerConnectionHandshakeServer.js +1 -0
- package/dist/core/connection/PeerConnectionOfferOptions.d.ts +10 -0
- package/dist/core/connection/PeerConnectionOfferOptions.js +1 -0
- package/dist/core/connection/PeerConnectionSender.d.ts +11 -0
- package/dist/core/connection/PeerConnectionSender.js +1 -0
- package/dist/core/connection/PeerConnectionSenderMap.d.ts +24 -0
- package/dist/core/connection/PeerConnectionSenderMap.js +1 -0
- package/dist/core/connection/PeerConnectionSessionDescription.d.ts +14 -0
- package/dist/core/connection/PeerConnectionSessionDescription.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReport.d.ts +6 -0
- package/dist/core/connection/PeerConnectionStatsReport.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportInbound.d.ts +38 -0
- package/dist/core/connection/PeerConnectionStatsReportInbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportOutbound.d.ts +26 -0
- package/dist/core/connection/PeerConnectionStatsReportOutbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportRemoteInbound.d.ts +22 -0
- package/dist/core/connection/PeerConnectionStatsReportRemoteInbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportUnused.d.ts +14 -0
- package/dist/core/connection/PeerConnectionStatsReportUnused.js +1 -0
- package/dist/core/connection/PeerConnectionTrackEvent.d.ts +14 -0
- package/dist/core/connection/PeerConnectionTrackEvent.js +1 -0
- package/dist/core/connection/index.d.ts +18 -0
- package/dist/core/connection/index.js +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +5 -0
- package/dist/core/node/AuthNode.d.ts +18 -0
- package/dist/core/node/AuthNode.js +1 -0
- package/dist/core/node/LocalNode.d.ts +7 -0
- package/dist/core/node/LocalNode.js +1 -0
- package/dist/core/node/Node.d.ts +23 -0
- package/dist/core/node/Node.js +1 -0
- package/dist/core/node/NodeMetadata.d.ts +7 -0
- package/dist/core/node/NodeMetadata.js +1 -0
- package/dist/core/node/NodeType.d.ts +14 -0
- package/dist/core/node/NodeType.js +15 -0
- package/dist/core/node/agent/Agent.d.ts +11 -0
- package/dist/core/node/agent/Agent.js +1 -0
- package/dist/core/node/agent/AgentCredentials.d.ts +10 -0
- package/dist/core/node/agent/AgentCredentials.js +1 -0
- package/dist/core/node/agent/AgentMetadata.d.ts +11 -0
- package/dist/core/node/agent/AgentMetadata.js +1 -0
- package/dist/core/node/agent/AuthAgent.d.ts +11 -0
- package/dist/core/node/agent/AuthAgent.js +1 -0
- package/dist/core/node/agent/LocalAgent.d.ts +7 -0
- package/dist/core/node/agent/LocalAgent.js +1 -0
- package/dist/core/node/agent/index.d.ts +5 -0
- package/dist/core/node/agent/index.js +1 -0
- package/dist/core/node/index.d.ts +7 -0
- package/dist/core/node/index.js +3 -0
- package/dist/core/node/user/AuthUser.d.ts +31 -0
- package/dist/core/node/user/AuthUser.js +1 -0
- package/dist/core/node/user/LocalUser.d.ts +17 -0
- package/dist/core/node/user/LocalUser.js +1 -0
- package/dist/core/node/user/User.d.ts +21 -0
- package/dist/core/node/user/User.js +1 -0
- package/dist/core/node/user/UserCredentials.d.ts +18 -0
- package/dist/core/node/user/UserCredentials.js +1 -0
- package/dist/core/node/user/UserMetadata.d.ts +19 -0
- package/dist/core/node/user/UserMetadata.js +1 -0
- package/dist/core/node/user/index.d.ts +5 -0
- package/dist/core/node/user/index.js +1 -0
- package/dist/core/sdk/LoggingConnector.d.ts +25 -0
- package/dist/core/sdk/LoggingConnector.js +1 -0
- package/dist/core/sdk/LoggingConnectorEvent.d.ts +12 -0
- package/dist/core/sdk/LoggingConnectorEvent.js +1 -0
- package/dist/core/sdk/SDK.d.ts +28 -0
- package/dist/core/sdk/SDK.js +1 -0
- package/dist/core/sdk/SDKOptions.d.ts +61 -0
- package/dist/core/sdk/SDKOptions.js +1 -0
- package/dist/core/sdk/index.d.ts +4 -0
- package/dist/core/sdk/index.js +1 -0
- package/dist/core/stream/ContentType.d.ts +30 -0
- package/dist/core/stream/ContentType.js +32 -0
- package/dist/core/stream/DataStream.d.ts +12 -0
- package/dist/core/stream/DataStream.js +1 -0
- package/dist/core/stream/Stream.d.ts +18 -0
- package/dist/core/stream/Stream.js +1 -0
- package/dist/core/stream/index.d.ts +3 -0
- package/dist/core/stream/index.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/key-value-database/DatabaseEvent.d.ts +20 -0
- package/dist/key-value-database/DatabaseEvent.js +11 -0
- package/dist/key-value-database/DatabaseLayout.d.ts +27 -0
- package/dist/key-value-database/DatabaseLayout.js +1 -0
- package/dist/key-value-database/DatabaseTable.d.ts +62 -0
- package/dist/key-value-database/DatabaseTable.js +1 -0
- package/dist/key-value-database/DatabaseTableAction.d.ts +5 -0
- package/dist/key-value-database/DatabaseTableAction.js +1 -0
- package/dist/key-value-database/DatabaseTableEvent.d.ts +15 -0
- package/dist/key-value-database/DatabaseTableEvent.js +1 -0
- package/dist/key-value-database/DatabaseTableIndex.d.ts +10 -0
- package/dist/key-value-database/DatabaseTableIndex.js +1 -0
- package/dist/key-value-database/DatabaseTableLayout.d.ts +11 -0
- package/dist/key-value-database/DatabaseTableLayout.js +1 -0
- package/dist/key-value-database/DatabaseTableQuery.d.ts +27 -0
- package/dist/key-value-database/DatabaseTableQuery.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereBetween.d.ts +20 -0
- package/dist/key-value-database/DatabaseTableQueryWhereBetween.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValue.d.ts +19 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValue.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValues.d.ts +19 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValues.js +1 -0
- package/dist/key-value-database/KeyValueDatabase.d.ts +35 -0
- package/dist/key-value-database/KeyValueDatabase.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseConnector.d.ts +30 -0
- package/dist/key-value-database/KeyValueDatabaseConnector.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseConnectorConstructor.d.ts +6 -0
- package/dist/key-value-database/KeyValueDatabaseConnectorConstructor.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseTableConnector.d.ts +56 -0
- package/dist/key-value-database/KeyValueDatabaseTableConnector.js +1 -0
- package/dist/key-value-database/LayoutBuilder.d.ts +18 -0
- package/dist/key-value-database/LayoutBuilder.js +1 -0
- package/dist/key-value-database/QueryBuilder.d.ts +54 -0
- package/dist/key-value-database/QueryBuilder.js +1 -0
- package/dist/key-value-database/SupportedIndexType.d.ts +5 -0
- package/dist/key-value-database/SupportedIndexType.js +1 -0
- package/dist/key-value-database/TableBuilder.d.ts +12 -0
- package/dist/key-value-database/TableBuilder.js +1 -0
- package/dist/key-value-database/ValueType.d.ts +11 -0
- package/dist/key-value-database/ValueType.js +1 -0
- package/dist/key-value-database/ValueTypeOmitId.d.ts +6 -0
- package/dist/key-value-database/ValueTypeOmitId.js +1 -0
- package/dist/key-value-database/index.d.ts +21 -0
- package/dist/key-value-database/index.js +1 -0
- package/dist/media-stream/AudioSubscriptionParams.d.ts +5 -0
- package/dist/media-stream/AudioSubscriptionParams.js +1 -0
- package/dist/media-stream/DynamicMediaStream.d.ts +12 -0
- package/dist/media-stream/DynamicMediaStream.js +1 -0
- package/dist/media-stream/LocalDynamicMediaStream.d.ts +23 -0
- package/dist/media-stream/LocalDynamicMediaStream.js +1 -0
- package/dist/media-stream/LocalMediaStream.d.ts +16 -0
- package/dist/media-stream/LocalMediaStream.js +1 -0
- package/dist/media-stream/MediaStream.d.ts +17 -0
- package/dist/media-stream/MediaStream.js +1 -0
- package/dist/media-stream/MediaStreamPriority.d.ts +18 -0
- package/dist/media-stream/MediaStreamPriority.js +19 -0
- package/dist/media-stream/MediaStreamSource.d.ts +5 -0
- package/dist/media-stream/MediaStreamSource.js +1 -0
- package/dist/media-stream/MediaStreamTransformer.d.ts +7 -0
- package/dist/media-stream/MediaStreamTransformer.js +1 -0
- package/dist/media-stream/MediaSubscriptionParams.d.ts +15 -0
- package/dist/media-stream/MediaSubscriptionParams.js +1 -0
- package/dist/media-stream/MediaTrackKind.d.ts +5 -0
- package/dist/media-stream/MediaTrackKind.js +1 -0
- package/dist/media-stream/RemoteMediaStream.d.ts +40 -0
- package/dist/media-stream/RemoteMediaStream.js +1 -0
- package/dist/media-stream/Resolution.d.ts +14 -0
- package/dist/media-stream/Resolution.js +1 -0
- package/dist/media-stream/TrackSubscriptionParams.d.ts +6 -0
- package/dist/media-stream/TrackSubscriptionParams.js +1 -0
- package/dist/media-stream/VideoSubscriptionParams.d.ts +15 -0
- package/dist/media-stream/VideoSubscriptionParams.js +1 -0
- package/dist/media-stream/index.d.ts +15 -0
- package/dist/media-stream/index.js +2 -0
- package/dist/media-stream/isValidMediaSubscriptionParams.d.ts +8 -0
- package/dist/media-stream/isValidMediaSubscriptionParams.js +28 -0
- package/dist/object-storage/FileDescriptor.d.ts +31 -0
- package/dist/object-storage/FileDescriptor.js +1 -0
- package/dist/object-storage/FilePayload.d.ts +19 -0
- package/dist/object-storage/FilePayload.js +1 -0
- package/dist/object-storage/FolderDescriptor.d.ts +27 -0
- package/dist/object-storage/FolderDescriptor.js +1 -0
- package/dist/object-storage/FolderPayload.d.ts +15 -0
- package/dist/object-storage/FolderPayload.js +1 -0
- package/dist/object-storage/MovePayload.d.ts +19 -0
- package/dist/object-storage/MovePayload.js +1 -0
- package/dist/object-storage/ObjectDescriptor.d.ts +6 -0
- package/dist/object-storage/ObjectDescriptor.js +1 -0
- package/dist/object-storage/ObjectKind.d.ts +14 -0
- package/dist/object-storage/ObjectKind.js +15 -0
- package/dist/object-storage/ObjectStoreBucket.d.ts +55 -0
- package/dist/object-storage/ObjectStoreBucket.js +1 -0
- package/dist/object-storage/ObjectStoreConnector.d.ts +49 -0
- package/dist/object-storage/ObjectStoreConnector.js +1 -0
- package/dist/object-storage/ObjectStoreConnectorConstructor.d.ts +6 -0
- package/dist/object-storage/ObjectStoreConnectorConstructor.js +1 -0
- package/dist/object-storage/Payload.d.ts +6 -0
- package/dist/object-storage/Payload.js +1 -0
- package/dist/object-storage/PayloadAction.d.ts +18 -0
- package/dist/object-storage/PayloadAction.js +19 -0
- package/dist/object-storage/event/FileDeleteEvent.d.ts +15 -0
- package/dist/object-storage/event/FileDeleteEvent.js +1 -0
- package/dist/object-storage/event/FileMoveEvent.d.ts +15 -0
- package/dist/object-storage/event/FileMoveEvent.js +1 -0
- package/dist/object-storage/event/FileWriteEvent.d.ts +15 -0
- package/dist/object-storage/event/FileWriteEvent.js +1 -0
- package/dist/object-storage/event/FileWriteEventPayload.d.ts +11 -0
- package/dist/object-storage/event/FileWriteEventPayload.js +1 -0
- package/dist/object-storage/event/FolderCreateEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderCreateEvent.js +1 -0
- package/dist/object-storage/event/FolderCreateEventPayload.d.ts +11 -0
- package/dist/object-storage/event/FolderCreateEventPayload.js +1 -0
- package/dist/object-storage/event/FolderDeleteEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderDeleteEvent.js +1 -0
- package/dist/object-storage/event/FolderMoveEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderMoveEvent.js +1 -0
- package/dist/object-storage/event/ObjectDeleteEventPayload.d.ts +18 -0
- package/dist/object-storage/event/ObjectDeleteEventPayload.js +1 -0
- package/dist/object-storage/event/ObjectMoveEventPayload.d.ts +30 -0
- package/dist/object-storage/event/ObjectMoveEventPayload.js +1 -0
- package/dist/object-storage/event/StorageEvent.d.ts +6 -0
- package/dist/object-storage/event/StorageEvent.js +1 -0
- package/dist/object-storage/event/StorageEventType.d.ts +30 -0
- package/dist/object-storage/event/StorageEventType.js +31 -0
- package/dist/object-storage/event/index.d.ts +12 -0
- package/dist/object-storage/event/index.js +1 -0
- package/dist/object-storage/index.d.ts +13 -0
- package/dist/object-storage/index.js +3 -0
- package/dist/pubsub/PubSubTopic.d.ts +37 -0
- package/dist/pubsub/PubSubTopic.js +1 -0
- package/dist/pubsub/SubscribeFunction.d.ts +14 -0
- package/dist/pubsub/SubscribeFunction.js +1 -0
- package/dist/pubsub/SubscriptionKeys.d.ts +6 -0
- package/dist/pubsub/SubscriptionKeys.js +1 -0
- package/dist/pubsub/Subscriptions.d.ts +18 -0
- package/dist/pubsub/Subscriptions.js +1 -0
- package/dist/pubsub/index.d.ts +4 -0
- package/dist/pubsub/index.js +1 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Crewdle Web SDK Types
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
The Web SDK Types package contains all the public types and interfaces of the Crewdle Web SDK. This package is essential for developers who are looking to build connectors or extend the functionalities of the Crewdle Web SDK. It provides a comprehensive set of types that ensure type safety and consistency across different implementations.
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
Before you begin, make sure you are familiar with the [Crewdle Web SDK](https://www.npmjs.com/package/@crewdle/web-sdk). Understanding its architecture and functionalities will help you effectively utilize the types and interfaces provided in this package.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @crewdle/web-sdk-types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Import the necessary types and interfaces into your TypeScript project to ensure type safety and leverage auto-completion features.
|
|
20
|
+
|
|
21
|
+
```TypeScript
|
|
22
|
+
import { IObjectStoreConnector } from '@crewdle/web-sdk-types';
|
|
23
|
+
|
|
24
|
+
class MyCustomStoreConnector implements IObjectStoreConnector {
|
|
25
|
+
// implementation here
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Documentation
|
|
30
|
+
|
|
31
|
+
For detailed information on the types and interfaces, refer to the [SDK Reference](https://docs.crewdle.com). Here, you'll find comprehensive details on each type and how to use them effectively in your projects.
|
|
32
|
+
|
|
33
|
+
## Need Help?
|
|
34
|
+
|
|
35
|
+
Reach out to support@crewdle.com or raise an issue in our repository for any assistance.
|
|
36
|
+
|
|
37
|
+
## Join Our Community
|
|
38
|
+
|
|
39
|
+
For an engaging discussion about your specific use cases or to connect with fellow developers, we invite you to join our Discord community. Follow this link to become a part of our vibrant group: [Join us on Discord](https://discord.gg/XJ3scBYX).
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { IClusterEventEmitter } from '.';
|
|
2
|
+
import { IKeyValueDatabase, IDatabaseLayout, ILayoutBuilder } from '../../key-value-database';
|
|
3
|
+
import { ILocalMediaStream, ILocalDynamicMediaStream, IRemoteMediaStream, MediaStreamSource } from '../../media-stream';
|
|
4
|
+
import { IObjectStoreBucket } from '../../object-storage';
|
|
5
|
+
import { IPubSubTopic } from '../../pubsub';
|
|
6
|
+
import { LocalNode, Node } from '../node';
|
|
7
|
+
/**
|
|
8
|
+
* The cluster interface.
|
|
9
|
+
* @category Core
|
|
10
|
+
*/
|
|
11
|
+
export interface ICluster extends IClusterEventEmitter {
|
|
12
|
+
/**
|
|
13
|
+
* Leave the cluster.
|
|
14
|
+
*/
|
|
15
|
+
leave(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Open a pub/sub topic.
|
|
18
|
+
* @param name The name of the PubSub Topic.
|
|
19
|
+
* @throws {@link SDKClientErrorCodes.PubSubTopicAlreadyExists} if the topic already exists
|
|
20
|
+
* @throws {@link SDKClientErrorCodes.PubSubTopicNameNotString} if the name is not a string.
|
|
21
|
+
* @returns The pub/sub topic.
|
|
22
|
+
*/
|
|
23
|
+
openPubSubTopic<T>(name: string): IPubSubTopic<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Open a object store bucket.
|
|
26
|
+
* @param name The name of the Object Store bucket.
|
|
27
|
+
* @throws {@link SDKClientErrorCodes.ObjectStoreAlreadyExists} if the data stream is already open.
|
|
28
|
+
* @throws {@link SDKClientErrorCodes.ObjectStoreNameNotString} if the name is not a string.
|
|
29
|
+
* @returns A promise that resolves with the data stream.
|
|
30
|
+
*/
|
|
31
|
+
openObjectStoreBucket(name: string): Promise<IObjectStoreBucket>;
|
|
32
|
+
/**
|
|
33
|
+
* Open a key-value database.
|
|
34
|
+
* @param name The name of the key-value database.
|
|
35
|
+
* @param layout The {@link IDatabaseLayout | layout} of the key-value database.
|
|
36
|
+
* @throws {@link SDKClientErrorCodes.KeyValueDatabaseAlreadyExists} if the key-value database is already open.
|
|
37
|
+
* @throws {@link SDKClientErrorCodes.KeyValueDatabaseInvalidLayout} if the layout is invalid.
|
|
38
|
+
* @throws {@link SDKClientErrorCodes.KeyValueDatabaseNameNotString} if the name is not a string.
|
|
39
|
+
* @returns A promise that resolves with the key-value database.
|
|
40
|
+
*/
|
|
41
|
+
openKeyValueDatabase(name: string, layout: IDatabaseLayout | ILayoutBuilder): Promise<IKeyValueDatabase>;
|
|
42
|
+
/**
|
|
43
|
+
* Publish a local media stream.
|
|
44
|
+
* @param label The label of the media stream.
|
|
45
|
+
* @param mediaSource The media source to publish.
|
|
46
|
+
* @throws {@link SDKClientErrorCodes.LocalMediaStreamAlreadyExists} if the media stream is already published.
|
|
47
|
+
* @returns The local media stream.
|
|
48
|
+
*/
|
|
49
|
+
publishLocalMediaStream(label: string, mediaSource: MediaStreamSource): ILocalMediaStream;
|
|
50
|
+
/**
|
|
51
|
+
* Publish a local dynamic media stream. Like a local media stream but can be modified after creation.
|
|
52
|
+
* @param label The label of the media stream.
|
|
53
|
+
* @param mediaSource The media source to publish.
|
|
54
|
+
* @throws {@link SDKClientErrorCodes.LocalMediaStreamAlreadyExists} if the media stream is already published.
|
|
55
|
+
* @returns The local dynamic media stream.
|
|
56
|
+
*/
|
|
57
|
+
publishLocalDynamicMediaStream(label: string, mediaSource: MediaStreamSource): ILocalDynamicMediaStream;
|
|
58
|
+
/**
|
|
59
|
+
* Get an array of opened pub/sub topics.
|
|
60
|
+
* @param strategy The strategy to use to filter the topics.
|
|
61
|
+
*/
|
|
62
|
+
getPubSubTopics(strategy?: (item: IPubSubTopic<unknown>) => boolean): IPubSubTopic<unknown>[];
|
|
63
|
+
/**
|
|
64
|
+
* Get an array of opened object store buckets.
|
|
65
|
+
* @param strategy The strategy to use to filter the data streams.
|
|
66
|
+
*/
|
|
67
|
+
getObjectStoreBuckets(strategy?: (item: IObjectStoreBucket) => boolean): IObjectStoreBucket[];
|
|
68
|
+
/**
|
|
69
|
+
* Get an array of opened key-value databases.
|
|
70
|
+
* @param strategy The strategy to use to filter the key-value databases.
|
|
71
|
+
*/
|
|
72
|
+
getKeyValueDatabases(strategy?: (item: IKeyValueDatabase) => boolean): IKeyValueDatabase[];
|
|
73
|
+
/**
|
|
74
|
+
* Get an array of published local media streams.
|
|
75
|
+
* @param strategy The strategy to use to filter the media streams.
|
|
76
|
+
*/
|
|
77
|
+
getLocalMediaStreams(strategy?: (item: ILocalMediaStream) => boolean): ILocalMediaStream[];
|
|
78
|
+
/**
|
|
79
|
+
* Get an array of published remote media streams.
|
|
80
|
+
* @param strategy The strategy to use to filter the media streams.
|
|
81
|
+
*/
|
|
82
|
+
getRemoteMediaStreams(strategy?: (item: IRemoteMediaStream) => boolean): IRemoteMediaStream[];
|
|
83
|
+
/**
|
|
84
|
+
* Get the local node for this cluster.
|
|
85
|
+
*/
|
|
86
|
+
getLocalNode(): LocalNode;
|
|
87
|
+
/**
|
|
88
|
+
* Get an array of all connected remote nodes.
|
|
89
|
+
* @param strategy The strategy to use to filter the nodes.
|
|
90
|
+
*/
|
|
91
|
+
getRemoteNodes(strategy?: (item: Node) => boolean): Node[];
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ClusterOnFunction } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The cluster event emitter interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IClusterEventEmitter {
|
|
7
|
+
/**
|
|
8
|
+
* Allows listening to events published on the cluster.
|
|
9
|
+
* @typeParam U - Any of the events defined in {@link IClusterEvents}.
|
|
10
|
+
* @param event - One of the events defined in {@link IClusterEvents}.
|
|
11
|
+
* @param listener - The callback when the event is received. Listeners' payload are defined in {@link IClusterEvents}.
|
|
12
|
+
*/
|
|
13
|
+
on: ClusterOnFunction;
|
|
14
|
+
/**
|
|
15
|
+
* @overload
|
|
16
|
+
* Unsubscribe from all events on the cluster
|
|
17
|
+
*/
|
|
18
|
+
off(): void;
|
|
19
|
+
/**
|
|
20
|
+
* @overload
|
|
21
|
+
* Unsubscribe to an event.
|
|
22
|
+
* @param event - The event to unsubscribe from.
|
|
23
|
+
*/
|
|
24
|
+
off(event: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* @overload
|
|
27
|
+
* Unsubscribe from all events, or a specific list of events.
|
|
28
|
+
* @param events - The list of events to unsubscribe from.
|
|
29
|
+
*/
|
|
30
|
+
off(events: string[]): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IAgentInfoEventPayload, ILocalMediaStreamTrackFailEventPayload, INodeEventPayload, IPublishMediaStreamEventPayload, IUnpublishMediaStreamEventPayload, IUserInfoEventPayload } from './event';
|
|
2
|
+
/**
|
|
3
|
+
* The cluster events interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IClusterEvents {
|
|
7
|
+
/**
|
|
8
|
+
* @event user-join - Event fired when a user joins the cluster.
|
|
9
|
+
* @param payload The user info event payload.
|
|
10
|
+
*/
|
|
11
|
+
'user-join': (payload: IUserInfoEventPayload) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @event user-update - Event fired when a user updates its information.
|
|
14
|
+
* @param payload The user info event payload.
|
|
15
|
+
*/
|
|
16
|
+
'user-update': (payload: IUserInfoEventPayload) => void;
|
|
17
|
+
/**
|
|
18
|
+
* @event user-leave - Event fired when a user leaves the cluster.
|
|
19
|
+
* @param payload The node event payload.
|
|
20
|
+
*/
|
|
21
|
+
'user-leave': (payload: INodeEventPayload) => void;
|
|
22
|
+
/**
|
|
23
|
+
* @event agent-join - Event fired when an agent joins the cluster.
|
|
24
|
+
* @param payload The agent info event payload.
|
|
25
|
+
*/
|
|
26
|
+
'agent-join': (payload: IAgentInfoEventPayload) => void;
|
|
27
|
+
/**
|
|
28
|
+
* @event agent-update - Event fired when an agent updates its information.
|
|
29
|
+
* @param payload The agent info event payload.
|
|
30
|
+
*/
|
|
31
|
+
'agent-update': (payload: IAgentInfoEventPayload) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @event agent-leave - Event fired when an agent leaves the cluster.
|
|
34
|
+
* @param payload The node event payload.
|
|
35
|
+
*/
|
|
36
|
+
'agent-leave': (payload: INodeEventPayload) => void;
|
|
37
|
+
/**
|
|
38
|
+
* @event content-publish-media - Event fired when a node publishes a new media stream.
|
|
39
|
+
* @param payload The publish media stream event payload.
|
|
40
|
+
*/
|
|
41
|
+
'content-publish-media': (payload: IPublishMediaStreamEventPayload) => void;
|
|
42
|
+
/**
|
|
43
|
+
* @event content-unpublish-media - Event fired when a node unpublishes a media stream.
|
|
44
|
+
* @param payload The unpublish media stream event payload.
|
|
45
|
+
*/
|
|
46
|
+
'content-unpublish-media': (payload: IUnpublishMediaStreamEventPayload) => void;
|
|
47
|
+
/**
|
|
48
|
+
* @event cluster-disconnect - Event fired when the current node is disconnected from the cluster.
|
|
49
|
+
* @param payload The node event payload.
|
|
50
|
+
*/
|
|
51
|
+
'cluster-disconnect': (payload: INodeEventPayload) => void;
|
|
52
|
+
/**
|
|
53
|
+
* @event local-media-stream-track-fail - Event fired when a local media stream track fails.
|
|
54
|
+
* @param payload The local media stream track fail event payload.
|
|
55
|
+
*
|
|
56
|
+
* If the local media stream is a ILocalDynamicMediaStream, you can remove the failed track from the stream and add a new one to the stream.
|
|
57
|
+
* If the local media stream is a ILocalMediaStream, you will have to unpublish the stream and publish a new one with new tracks.
|
|
58
|
+
*/
|
|
59
|
+
'local-media-stream-track-fail': (payload: ILocalMediaStreamTrackFailEventPayload) => void;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClusterEventKeys, IClusterEvents } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* A function that can be used to listen for events on a cluster.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export type ClusterOnFunction = {
|
|
7
|
+
/**
|
|
8
|
+
* Allows listening to events published on the cluster.
|
|
9
|
+
* @typeParam U - Any of the events defined in {@link IClusterEvents}.
|
|
10
|
+
* @param event - One of the events defined in {@link IClusterEvents}.
|
|
11
|
+
* @param listener - The callback when the event is received. Listeners' payload are defined in {@link IClusterEvents}.
|
|
12
|
+
*/
|
|
13
|
+
<U extends ClusterEventKeys>(event: U, listener: IClusterEvents[U]): void;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IAgentMetadata } from '../../node/agent';
|
|
2
|
+
import { INodeEventPayload } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* The agent info event payload interface.
|
|
5
|
+
* @category Core
|
|
6
|
+
*/
|
|
7
|
+
export interface IAgentInfoEventPayload extends INodeEventPayload {
|
|
8
|
+
/**
|
|
9
|
+
* The meta data of the agent.
|
|
10
|
+
*/
|
|
11
|
+
metaData: IAgentMetadata;
|
|
12
|
+
/**
|
|
13
|
+
* The remote connections of the agent.
|
|
14
|
+
*/
|
|
15
|
+
remoteConnections: string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MediaTrackKind } from '../../../media-stream';
|
|
2
|
+
/**
|
|
3
|
+
* The local media stream track fail event payload interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface ILocalMediaStreamTrackFailEventPayload {
|
|
7
|
+
/**
|
|
8
|
+
* The label of the media stream.
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* The kind of the track.
|
|
13
|
+
*/
|
|
14
|
+
trackKinds: MediaTrackKind[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IRemoteMediaStream } from '../../../media-stream';
|
|
2
|
+
/**
|
|
3
|
+
* The publish media stream event payload interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IPublishMediaStreamEventPayload {
|
|
7
|
+
/**
|
|
8
|
+
* The owner ID of the media stream.
|
|
9
|
+
*/
|
|
10
|
+
ownerId: string;
|
|
11
|
+
/**
|
|
12
|
+
* The remote media stream.
|
|
13
|
+
*/
|
|
14
|
+
stream: IRemoteMediaStream;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The unpublish media stream event payload interface.
|
|
3
|
+
* @category Core
|
|
4
|
+
*/
|
|
5
|
+
export interface IUnpublishMediaStreamEventPayload {
|
|
6
|
+
/**
|
|
7
|
+
* The owner ID of the media stream.
|
|
8
|
+
*/
|
|
9
|
+
ownerId: string;
|
|
10
|
+
/**
|
|
11
|
+
* The label of the media stream.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IUserMetadata } from '../../node/user';
|
|
2
|
+
import { INodeEventPayload } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* The user info event payload interface.
|
|
5
|
+
* @category Core
|
|
6
|
+
*/
|
|
7
|
+
export interface IUserInfoEventPayload extends INodeEventPayload {
|
|
8
|
+
/**
|
|
9
|
+
* The meta data of the user.
|
|
10
|
+
*/
|
|
11
|
+
metaData: IUserMetadata;
|
|
12
|
+
/**
|
|
13
|
+
* The remote connections of the user.
|
|
14
|
+
*/
|
|
15
|
+
remoteConnections: string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { IAgentInfoEventPayload } from './AgentInfoEventPayload';
|
|
2
|
+
export { ILocalMediaStreamTrackFailEventPayload } from './LocalMediaStreamTrackFailEventPayload';
|
|
3
|
+
export { INodeEventPayload } from './NodeEventPayload';
|
|
4
|
+
export { IPublishMediaStreamEventPayload } from './PublishMediaStreamEventPayload';
|
|
5
|
+
export { IUnpublishMediaStreamEventPayload } from './UnpublishMediaStreamEventPayload';
|
|
6
|
+
export { IUserInfoEventPayload } from './UserInfoEventPayload';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './event';
|
|
2
|
+
export { ICluster } from './Cluster';
|
|
3
|
+
export { IClusterEventEmitter } from './ClusterEventEmitter';
|
|
4
|
+
export { ClusterEventKeys } from './ClusterEventKeys';
|
|
5
|
+
export { IClusterEvents } from './ClusterEvents';
|
|
6
|
+
export { ClusterOnFunction } from './ClusterOnFunction';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './event';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPeerConnectionHandshakeServer } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The peer connection configuration interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IPeerConnectionConfiguration {
|
|
7
|
+
/**
|
|
8
|
+
* The handshake servers to use for the connection.
|
|
9
|
+
*/
|
|
10
|
+
handshakeServers?: IPeerConnectionHandshakeServer[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { MediaStreamPriority } from '../../media-stream';
|
|
2
|
+
import { IPeerConnectionDataChannelConnector, IPeerConnectionDataChannelEvent, IPeerConnectionHandshakeCandidate, IPeerConnectionHandshakeCandidateEvent, IPeerConnectionOfferOptions, IPeerConnectionSender, IPeerConnectionSenderMap, IPeerConnectionSessionDescription, IPeerConnectionTrackEvent, PeerConnectionStatsReport } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* The peer connection connector interface - used to establish a connection between two peers.
|
|
5
|
+
* @category Core
|
|
6
|
+
*/
|
|
7
|
+
export interface IPeerConnectionConnector {
|
|
8
|
+
/**
|
|
9
|
+
* Whether or not candidates can be added to the connection.
|
|
10
|
+
*/
|
|
11
|
+
readonly canAddCandidates: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether or not the handshake function exists.
|
|
14
|
+
*/
|
|
15
|
+
readonly canRestartHandshake: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The current connection state.
|
|
18
|
+
*/
|
|
19
|
+
readonly connectionState: string;
|
|
20
|
+
/**
|
|
21
|
+
* The current gathering state.
|
|
22
|
+
*/
|
|
23
|
+
readonly gatheringState: string;
|
|
24
|
+
/**
|
|
25
|
+
* The current handshake state.
|
|
26
|
+
*/
|
|
27
|
+
readonly handshakeState: string;
|
|
28
|
+
/**
|
|
29
|
+
* The current signaling state.
|
|
30
|
+
*/
|
|
31
|
+
readonly signalingState: string;
|
|
32
|
+
/**
|
|
33
|
+
* The callback for when a candidate is received.
|
|
34
|
+
*/
|
|
35
|
+
onCandidate: ((event: IPeerConnectionHandshakeCandidateEvent) => void) | null;
|
|
36
|
+
/**
|
|
37
|
+
* The callback for when the connection state changes.
|
|
38
|
+
*/
|
|
39
|
+
onConnectionStateChange: (() => void) | null;
|
|
40
|
+
/**
|
|
41
|
+
* The callback for when a data channel is received.
|
|
42
|
+
*/
|
|
43
|
+
onDataChannel: ((event: IPeerConnectionDataChannelEvent) => void) | null;
|
|
44
|
+
/**
|
|
45
|
+
* The callback for when the candidate gathering state changes.
|
|
46
|
+
*/
|
|
47
|
+
onGatheringStateChange: (() => void) | null;
|
|
48
|
+
/**
|
|
49
|
+
* The callback for when the handshake state changes.
|
|
50
|
+
*/
|
|
51
|
+
onHandshakeStateChange: (() => void) | null;
|
|
52
|
+
/**
|
|
53
|
+
* The callback for when a track is received.
|
|
54
|
+
*/
|
|
55
|
+
onTrack: ((event: IPeerConnectionTrackEvent) => void) | null;
|
|
56
|
+
/**
|
|
57
|
+
* Adds a candidate to the connection.
|
|
58
|
+
* @param candidate - The candidate to add.
|
|
59
|
+
* @returns A promise that resolves when the candidate has been added.
|
|
60
|
+
*/
|
|
61
|
+
addCandidate(candidate: IPeerConnectionHandshakeCandidate): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Adds a track to the connection.
|
|
64
|
+
* @param track - The track to add.
|
|
65
|
+
* @param stream - The stream to add the track to.
|
|
66
|
+
* @returns The sender for the track.
|
|
67
|
+
*/
|
|
68
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): IPeerConnectionSender;
|
|
69
|
+
/**
|
|
70
|
+
* Closes the connection.
|
|
71
|
+
*/
|
|
72
|
+
close(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Collects the stats for the receivers. The collector must be called with the stats for each stream.
|
|
75
|
+
* @param receivers - The receivers to collect stats for.
|
|
76
|
+
* @param collector - The callback to send the stats to.
|
|
77
|
+
* @returns A promise that resolves when the stats have been collected.
|
|
78
|
+
*/
|
|
79
|
+
collectReceiversStats(receivers: Map<string, Set<MediaStreamTrack>>, collector: (stats: PeerConnectionStatsReport[][], streamId: string) => void): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Collects the stats for the senders. The collector must be called with the stats for each stream.
|
|
82
|
+
* @param senders - The senders to collect stats for.
|
|
83
|
+
* @param collector - The callback to send the stats to.
|
|
84
|
+
* @returns A promise that resolves when the stats have been collected.
|
|
85
|
+
*/
|
|
86
|
+
collectSendersStats(senders: Map<string, IPeerConnectionSenderMap>, collector: (stats: PeerConnectionStatsReport[][], streamId: string) => void): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Creates an answer to an offer.
|
|
89
|
+
* @param offer - The offer to answer.
|
|
90
|
+
* @returns A promise that resolves with the answer.
|
|
91
|
+
*/
|
|
92
|
+
createAnswer(offer: IPeerConnectionSessionDescription): Promise<IPeerConnectionSessionDescription>;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a data channel.
|
|
95
|
+
* @param label - The label for the data channel.
|
|
96
|
+
* @returns The data channel connector.
|
|
97
|
+
*/
|
|
98
|
+
createDataChannel(label: string): IPeerConnectionDataChannelConnector;
|
|
99
|
+
/**
|
|
100
|
+
* Creates an offer.
|
|
101
|
+
* @param options - The options for creating the offer.
|
|
102
|
+
* @returns A promise that resolves with the offer.
|
|
103
|
+
*/
|
|
104
|
+
createOffer(options?: IPeerConnectionOfferOptions): Promise<IPeerConnectionSessionDescription>;
|
|
105
|
+
/**
|
|
106
|
+
* Handles an answer to an offer.
|
|
107
|
+
* @param answer - The answer to handle.
|
|
108
|
+
* @param negotiationHandler - The handler to call after the answer has been handled.
|
|
109
|
+
* @returns A promise that resolves when the answer has been handled.
|
|
110
|
+
*/
|
|
111
|
+
handleAnswer(answer: IPeerConnectionSessionDescription, negotiationHandler: () => void): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Removes a track from the connection.
|
|
114
|
+
* @param sender - The sender for the track to remove.
|
|
115
|
+
*/
|
|
116
|
+
removeTrack(sender: IPeerConnectionSender): void;
|
|
117
|
+
/**
|
|
118
|
+
* Replaces a track in the connection.
|
|
119
|
+
* @param track - The track to replace the current track with.
|
|
120
|
+
* @param sender - The sender for the track to replace.
|
|
121
|
+
*/
|
|
122
|
+
replaceTrack(track: MediaStreamTrack, sender: IPeerConnectionSender): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Restarts the handshake.
|
|
125
|
+
*/
|
|
126
|
+
restartHandshake(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Sets the encoding parameters for the sender.
|
|
129
|
+
* @param sender - The sender to set the encoding parameters for.
|
|
130
|
+
* @param scaleResolutionDownBy - The scale resolution down by value.
|
|
131
|
+
* @param maxFramerate - The max framerate value.
|
|
132
|
+
* @param maxBitrate - The max bitrate value.
|
|
133
|
+
* @param priority - The priority for the media stream.
|
|
134
|
+
*/
|
|
135
|
+
setEncodingParameters(sender: IPeerConnectionSender, scaleResolutionDownBy: number, maxFramerate: number, maxBitrate: number, priority: MediaStreamPriority): void;
|
|
136
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IPeerConnectionConfiguration, IPeerConnectionConnector } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The peer connection connector constructor type.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export type PeerConnectionConnectorConstructor = new (configuration: IPeerConnectionConfiguration) => IPeerConnectionConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The peer connection data channel connector interface.
|
|
3
|
+
* @category Core
|
|
4
|
+
*/
|
|
5
|
+
export interface IPeerConnectionDataChannelConnector {
|
|
6
|
+
/**
|
|
7
|
+
* The current buffered amount.
|
|
8
|
+
*/
|
|
9
|
+
readonly bufferedAmount: number;
|
|
10
|
+
/**
|
|
11
|
+
* The current state of the data channel.
|
|
12
|
+
*/
|
|
13
|
+
readonly state: string;
|
|
14
|
+
/**
|
|
15
|
+
* The low threshold for the buffered amount.
|
|
16
|
+
*/
|
|
17
|
+
bufferedAmountLowThreshold: number;
|
|
18
|
+
/**
|
|
19
|
+
* The callback for when the buffered amount is low.
|
|
20
|
+
*/
|
|
21
|
+
onBufferedAmountLow: (() => void) | null;
|
|
22
|
+
/**
|
|
23
|
+
* The callback for when the data channel closes.
|
|
24
|
+
*/
|
|
25
|
+
onClose: (() => void) | null;
|
|
26
|
+
/**
|
|
27
|
+
* The callback for when a message is received on the data channel.
|
|
28
|
+
*/
|
|
29
|
+
onMessage: ((message: MessageEvent) => void) | null;
|
|
30
|
+
/**
|
|
31
|
+
* Closes the data channel.
|
|
32
|
+
*/
|
|
33
|
+
close(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @overload
|
|
36
|
+
* Sends data on the data channel.
|
|
37
|
+
* @param data - The data to send.
|
|
38
|
+
*/
|
|
39
|
+
send(data: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* @overload
|
|
42
|
+
* Sends data on the data channel.
|
|
43
|
+
* @param data - The data to send.
|
|
44
|
+
*/
|
|
45
|
+
send(data: ArrayBuffer): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPeerConnectionDataChannelConnector } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The peer connection data channel event interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IPeerConnectionDataChannelEvent {
|
|
7
|
+
/**
|
|
8
|
+
* The data channel received.
|
|
9
|
+
*/
|
|
10
|
+
readonly channel: IPeerConnectionDataChannelConnector;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|