@livekit/rtc-node 0.12.1 → 0.12.2
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/audio_frame.d.cts +32 -0
- package/dist/audio_frame.d.ts +12 -5
- package/dist/audio_resampler.d.cts +60 -0
- package/dist/audio_resampler.d.ts +12 -3
- package/dist/audio_source.d.cts +37 -0
- package/dist/audio_source.d.ts +13 -5
- package/dist/audio_stream.d.cts +38 -0
- package/dist/audio_stream.d.ts +17 -5
- package/dist/e2ee.d.cts +48 -0
- package/dist/e2ee.d.ts +12 -8
- package/dist/ffi_client.d.cts +35 -0
- package/dist/ffi_client.d.ts +22 -10
- package/dist/index.d.cts +57 -0
- package/dist/index.d.ts +28 -20
- package/dist/napi/native.d.d.cts +21 -0
- package/dist/napi/native.d.d.ts +21 -0
- package/dist/participant.d.cts +126 -0
- package/dist/participant.d.ts +28 -14
- package/dist/proto/audio_frame_pb.d.cts +813 -0
- package/dist/proto/audio_frame_pb.d.ts +90 -86
- package/dist/proto/e2ee_pb.d.cts +585 -0
- package/dist/proto/e2ee_pb.d.ts +60 -58
- package/dist/proto/ffi_pb.d.cts +851 -0
- package/dist/proto/ffi_pb.d.ts +35 -30
- package/dist/proto/handle_pb.d.cts +33 -0
- package/dist/proto/handle_pb.d.ts +8 -6
- package/dist/proto/participant_pb.d.cts +93 -0
- package/dist/proto/participant_pb.d.ts +13 -11
- package/dist/proto/room_pb.d.cts +2072 -0
- package/dist/proto/room_pb.d.ts +198 -196
- package/dist/proto/rpc_pb.d.cts +237 -0
- package/dist/proto/rpc_pb.d.ts +28 -26
- package/dist/proto/stats_pb.d.cts +1653 -0
- package/dist/proto/stats_pb.d.ts +96 -94
- package/dist/proto/track_pb.d.cts +402 -0
- package/dist/proto/track_pb.d.ts +47 -45
- package/dist/proto/video_frame_pb.d.cts +617 -0
- package/dist/proto/video_frame_pb.d.ts +64 -60
- package/dist/room.d.cts +134 -0
- package/dist/room.d.ts +36 -22
- package/dist/rpc.d.cts +82 -0
- package/dist/rpc.d.ts +11 -7
- package/dist/track.d.cts +46 -0
- package/dist/track.d.ts +25 -14
- package/dist/track_publication.d.cts +48 -0
- package/dist/track_publication.d.ts +20 -8
- package/dist/transcription.d.cts +15 -0
- package/dist/transcription.d.ts +4 -3
- package/dist/types.d.cts +9 -0
- package/dist/types.d.ts +3 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +3 -0
- package/dist/version.d.ts +3 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.d.cts +25 -0
- package/dist/video_frame.d.ts +11 -4
- package/dist/video_source.d.cts +22 -0
- package/dist/video_source.d.ts +13 -6
- package/dist/video_stream.d.cts +41 -0
- package/dist/video_stream.d.ts +18 -6
- package/package.json +14 -9
- package/src/version.ts +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { FfiHandle } from './napi/native.d.cjs';
|
|
2
|
+
import { TrackPublishOptions } from './proto/room_pb.cjs';
|
|
3
|
+
import { ParticipantInfo, OwnedParticipant, ParticipantKind } from './proto/participant_pb.cjs';
|
|
4
|
+
import { PerformRpcParams, RpcInvocationData } from './rpc.cjs';
|
|
5
|
+
import { LocalTrack } from './track.cjs';
|
|
6
|
+
import { TrackPublication, LocalTrackPublication, RemoteTrackPublication } from './track_publication.cjs';
|
|
7
|
+
import { Transcription } from './transcription.cjs';
|
|
8
|
+
import { ChatMessage } from './types.cjs';
|
|
9
|
+
import '@bufbuild/protobuf/codegenv1';
|
|
10
|
+
import './proto/e2ee_pb.cjs';
|
|
11
|
+
import '@bufbuild/protobuf';
|
|
12
|
+
import './proto/handle_pb.cjs';
|
|
13
|
+
import './proto/track_pb.cjs';
|
|
14
|
+
import './proto/stats_pb.cjs';
|
|
15
|
+
import './proto/video_frame_pb.cjs';
|
|
16
|
+
import './proto/rpc_pb.cjs';
|
|
17
|
+
import './audio_source.cjs';
|
|
18
|
+
import './audio_frame.cjs';
|
|
19
|
+
import './proto/audio_frame_pb.cjs';
|
|
20
|
+
import './video_source.cjs';
|
|
21
|
+
import './video_frame.cjs';
|
|
22
|
+
|
|
23
|
+
declare abstract class Participant {
|
|
24
|
+
/** @internal */
|
|
25
|
+
info: ParticipantInfo;
|
|
26
|
+
/** @internal */
|
|
27
|
+
ffi_handle: FfiHandle;
|
|
28
|
+
trackPublications: Map<string, TrackPublication>;
|
|
29
|
+
constructor(owned_info: OwnedParticipant);
|
|
30
|
+
get sid(): string;
|
|
31
|
+
get name(): string;
|
|
32
|
+
get identity(): string;
|
|
33
|
+
get metadata(): string;
|
|
34
|
+
get attributes(): Record<string, string>;
|
|
35
|
+
get kind(): ParticipantKind;
|
|
36
|
+
}
|
|
37
|
+
type DataPublishOptions = {
|
|
38
|
+
/**
|
|
39
|
+
* whether to send this as reliable or lossy.
|
|
40
|
+
* For data that you need delivery guarantee (such as chat messages), use Reliable.
|
|
41
|
+
* For data that should arrive as quickly as possible, but you are ok with dropped
|
|
42
|
+
* packets, use Lossy.
|
|
43
|
+
*/
|
|
44
|
+
reliable?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* the identities of participants who will receive the message, will be sent to every one if empty
|
|
47
|
+
*/
|
|
48
|
+
destination_identities?: string[];
|
|
49
|
+
/** the topic under which the message gets published */
|
|
50
|
+
topic?: string;
|
|
51
|
+
};
|
|
52
|
+
declare class LocalParticipant extends Participant {
|
|
53
|
+
private rpcHandlers;
|
|
54
|
+
trackPublications: Map<string, LocalTrackPublication>;
|
|
55
|
+
publishData(data: Uint8Array, options: DataPublishOptions): Promise<void>;
|
|
56
|
+
publishDtmf(code: number, digit: string): Promise<void>;
|
|
57
|
+
publishTranscription(transcription: Transcription): Promise<void>;
|
|
58
|
+
updateMetadata(metadata: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Sends a chat message to participants in the room
|
|
61
|
+
*
|
|
62
|
+
* @param text - The text content of the chat message.
|
|
63
|
+
* @param destinationIdentities - An optional array of recipient identities to whom the message will be sent. If omitted, the message is broadcast to all participants.
|
|
64
|
+
* @param senderIdentity - An optional identity of the sender. If omitted, the default sender identity is used.
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
sendChatMessage(text: string, destinationIdentities?: Array<string>, senderIdentity?: string): Promise<ChatMessage>;
|
|
68
|
+
/**
|
|
69
|
+
* @experimental
|
|
70
|
+
*/
|
|
71
|
+
editChatMessage(editText: string, originalMessage: ChatMessage, destinationIdentities?: Array<string>, senderIdentity?: string): Promise<ChatMessage>;
|
|
72
|
+
updateName(name: string): Promise<void>;
|
|
73
|
+
setAttributes(attributes: Record<string, string>): Promise<void>;
|
|
74
|
+
publishTrack(track: LocalTrack, options: TrackPublishOptions): Promise<LocalTrackPublication>;
|
|
75
|
+
unpublishTrack(trackSid: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Initiate an RPC call to a remote participant.
|
|
78
|
+
* @param params - Parameters for initiating the RPC call, see {@link PerformRpcParams}
|
|
79
|
+
* @returns A promise that resolves with the response payload or rejects with an error.
|
|
80
|
+
* @throws Error on failure. Details in `message`.
|
|
81
|
+
*/
|
|
82
|
+
performRpc({ destinationIdentity, method, payload, responseTimeout, }: PerformRpcParams): Promise<string>;
|
|
83
|
+
/**
|
|
84
|
+
* Establishes the participant as a receiver for calls of the specified RPC method.
|
|
85
|
+
* Will overwrite any existing callback for the same method.
|
|
86
|
+
*
|
|
87
|
+
* @param method - The name of the indicated RPC method
|
|
88
|
+
* @param handler - Will be invoked when an RPC request for this method is received
|
|
89
|
+
* @returns A promise that resolves when the method is successfully registered
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* room.localParticipant?.registerRpcMethod(
|
|
94
|
+
* 'greet',
|
|
95
|
+
* async (data: RpcInvocationData) => {
|
|
96
|
+
* console.log(`Received greeting from ${data.callerIdentity}: ${data.payload}`);
|
|
97
|
+
* return `Hello, ${data.callerIdentity}!`;
|
|
98
|
+
* }
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* See {@link RpcInvocationData} for more details on invocation params.
|
|
103
|
+
*
|
|
104
|
+
* The handler should return a Promise that resolves to a string.
|
|
105
|
+
* If unable to respond within `responseTimeout`, the request will result in an error on the caller's side.
|
|
106
|
+
*
|
|
107
|
+
* You may throw errors of type `RpcError` with a string `message` in the handler,
|
|
108
|
+
* and they will be received on the caller's side with the message intact.
|
|
109
|
+
* Other errors thrown in your handler will not be transmitted as-is, and will instead arrive to the caller as `1500` ("Application Error").
|
|
110
|
+
*/
|
|
111
|
+
registerRpcMethod(method: string, handler: (data: RpcInvocationData) => Promise<string>): void;
|
|
112
|
+
/**
|
|
113
|
+
* Unregisters a previously registered RPC method.
|
|
114
|
+
*
|
|
115
|
+
* @param method - The name of the RPC method to unregister
|
|
116
|
+
*/
|
|
117
|
+
unregisterRpcMethod(method: string): void;
|
|
118
|
+
/** @internal */
|
|
119
|
+
handleRpcMethodInvocation(invocationId: bigint, method: string, requestId: string, callerIdentity: string, payload: string, responseTimeout: number): Promise<void>;
|
|
120
|
+
}
|
|
121
|
+
declare class RemoteParticipant extends Participant {
|
|
122
|
+
trackPublications: Map<string, RemoteTrackPublication>;
|
|
123
|
+
constructor(owned_info: OwnedParticipant);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { type DataPublishOptions, LocalParticipant, Participant, RemoteParticipant };
|
package/dist/participant.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { FfiHandle } from './
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { FfiHandle } from './napi/native.d.js';
|
|
2
|
+
import { TrackPublishOptions } from './proto/room_pb.js';
|
|
3
|
+
import { ParticipantInfo, OwnedParticipant, ParticipantKind } from './proto/participant_pb.js';
|
|
4
|
+
import { PerformRpcParams, RpcInvocationData } from './rpc.js';
|
|
5
|
+
import { LocalTrack } from './track.js';
|
|
6
|
+
import { TrackPublication, LocalTrackPublication, RemoteTrackPublication } from './track_publication.js';
|
|
7
|
+
import { Transcription } from './transcription.js';
|
|
8
|
+
import { ChatMessage } from './types.js';
|
|
9
|
+
import '@bufbuild/protobuf/codegenv1';
|
|
10
|
+
import './proto/e2ee_pb.js';
|
|
11
|
+
import '@bufbuild/protobuf';
|
|
12
|
+
import './proto/handle_pb.js';
|
|
13
|
+
import './proto/track_pb.js';
|
|
14
|
+
import './proto/stats_pb.js';
|
|
15
|
+
import './proto/video_frame_pb.js';
|
|
16
|
+
import './proto/rpc_pb.js';
|
|
17
|
+
import './audio_source.js';
|
|
18
|
+
import './audio_frame.js';
|
|
19
|
+
import './proto/audio_frame_pb.js';
|
|
20
|
+
import './video_source.js';
|
|
21
|
+
import './video_frame.js';
|
|
22
|
+
|
|
23
|
+
declare abstract class Participant {
|
|
11
24
|
/** @internal */
|
|
12
25
|
info: ParticipantInfo;
|
|
13
26
|
/** @internal */
|
|
@@ -21,7 +34,7 @@ export declare abstract class Participant {
|
|
|
21
34
|
get attributes(): Record<string, string>;
|
|
22
35
|
get kind(): ParticipantKind;
|
|
23
36
|
}
|
|
24
|
-
|
|
37
|
+
type DataPublishOptions = {
|
|
25
38
|
/**
|
|
26
39
|
* whether to send this as reliable or lossy.
|
|
27
40
|
* For data that you need delivery guarantee (such as chat messages), use Reliable.
|
|
@@ -36,7 +49,7 @@ export type DataPublishOptions = {
|
|
|
36
49
|
/** the topic under which the message gets published */
|
|
37
50
|
topic?: string;
|
|
38
51
|
};
|
|
39
|
-
|
|
52
|
+
declare class LocalParticipant extends Participant {
|
|
40
53
|
private rpcHandlers;
|
|
41
54
|
trackPublications: Map<string, LocalTrackPublication>;
|
|
42
55
|
publishData(data: Uint8Array, options: DataPublishOptions): Promise<void>;
|
|
@@ -105,8 +118,9 @@ export declare class LocalParticipant extends Participant {
|
|
|
105
118
|
/** @internal */
|
|
106
119
|
handleRpcMethodInvocation(invocationId: bigint, method: string, requestId: string, callerIdentity: string, payload: string, responseTimeout: number): Promise<void>;
|
|
107
120
|
}
|
|
108
|
-
|
|
121
|
+
declare class RemoteParticipant extends Participant {
|
|
109
122
|
trackPublications: Map<string, RemoteTrackPublication>;
|
|
110
123
|
constructor(owned_info: OwnedParticipant);
|
|
111
124
|
}
|
|
112
|
-
|
|
125
|
+
|
|
126
|
+
export { type DataPublishOptions, LocalParticipant, Participant, RemoteParticipant };
|