@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.
Files changed (64) hide show
  1. package/dist/audio_frame.d.cts +32 -0
  2. package/dist/audio_frame.d.ts +12 -5
  3. package/dist/audio_resampler.d.cts +60 -0
  4. package/dist/audio_resampler.d.ts +12 -3
  5. package/dist/audio_source.d.cts +37 -0
  6. package/dist/audio_source.d.ts +13 -5
  7. package/dist/audio_stream.d.cts +38 -0
  8. package/dist/audio_stream.d.ts +17 -5
  9. package/dist/e2ee.d.cts +48 -0
  10. package/dist/e2ee.d.ts +12 -8
  11. package/dist/ffi_client.d.cts +35 -0
  12. package/dist/ffi_client.d.ts +22 -10
  13. package/dist/index.d.cts +57 -0
  14. package/dist/index.d.ts +28 -20
  15. package/dist/napi/native.d.d.cts +21 -0
  16. package/dist/napi/native.d.d.ts +21 -0
  17. package/dist/participant.d.cts +126 -0
  18. package/dist/participant.d.ts +28 -14
  19. package/dist/proto/audio_frame_pb.d.cts +813 -0
  20. package/dist/proto/audio_frame_pb.d.ts +90 -86
  21. package/dist/proto/e2ee_pb.d.cts +585 -0
  22. package/dist/proto/e2ee_pb.d.ts +60 -58
  23. package/dist/proto/ffi_pb.d.cts +851 -0
  24. package/dist/proto/ffi_pb.d.ts +35 -30
  25. package/dist/proto/handle_pb.d.cts +33 -0
  26. package/dist/proto/handle_pb.d.ts +8 -6
  27. package/dist/proto/participant_pb.d.cts +93 -0
  28. package/dist/proto/participant_pb.d.ts +13 -11
  29. package/dist/proto/room_pb.d.cts +2072 -0
  30. package/dist/proto/room_pb.d.ts +198 -196
  31. package/dist/proto/rpc_pb.d.cts +237 -0
  32. package/dist/proto/rpc_pb.d.ts +28 -26
  33. package/dist/proto/stats_pb.d.cts +1653 -0
  34. package/dist/proto/stats_pb.d.ts +96 -94
  35. package/dist/proto/track_pb.d.cts +402 -0
  36. package/dist/proto/track_pb.d.ts +47 -45
  37. package/dist/proto/video_frame_pb.d.cts +617 -0
  38. package/dist/proto/video_frame_pb.d.ts +64 -60
  39. package/dist/room.d.cts +134 -0
  40. package/dist/room.d.ts +36 -22
  41. package/dist/rpc.d.cts +82 -0
  42. package/dist/rpc.d.ts +11 -7
  43. package/dist/track.d.cts +46 -0
  44. package/dist/track.d.ts +25 -14
  45. package/dist/track_publication.d.cts +48 -0
  46. package/dist/track_publication.d.ts +20 -8
  47. package/dist/transcription.d.cts +15 -0
  48. package/dist/transcription.d.ts +4 -3
  49. package/dist/types.d.cts +9 -0
  50. package/dist/types.d.ts +3 -2
  51. package/dist/version.cjs +1 -1
  52. package/dist/version.cjs.map +1 -1
  53. package/dist/version.d.cts +3 -0
  54. package/dist/version.d.ts +3 -2
  55. package/dist/version.js +1 -1
  56. package/dist/version.js.map +1 -1
  57. package/dist/video_frame.d.cts +25 -0
  58. package/dist/video_frame.d.ts +11 -4
  59. package/dist/video_source.d.cts +22 -0
  60. package/dist/video_source.d.ts +13 -6
  61. package/dist/video_stream.d.cts +41 -0
  62. package/dist/video_stream.d.ts +18 -6
  63. package/package.json +14 -9
  64. 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 };
@@ -1,13 +1,26 @@
1
- import { FfiHandle } from './ffi_client.js';
2
- import type { OwnedParticipant, ParticipantInfo, ParticipantKind } from './proto/participant_pb.js';
3
- import type { TrackPublishOptions } from './proto/room_pb.js';
4
- import { type PerformRpcParams, type RpcInvocationData } from './rpc.js';
5
- import type { LocalTrack } from './track.js';
6
- import type { RemoteTrackPublication, TrackPublication } from './track_publication.js';
7
- import { LocalTrackPublication } from './track_publication.js';
8
- import type { Transcription } from './transcription.js';
9
- import type { ChatMessage } from './types.js';
10
- export declare abstract class Participant {
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
- export type DataPublishOptions = {
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
- export declare class LocalParticipant extends Participant {
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
- export declare class RemoteParticipant extends Participant {
121
+ declare class RemoteParticipant extends Participant {
109
122
  trackPublications: Map<string, RemoteTrackPublication>;
110
123
  constructor(owned_info: OwnedParticipant);
111
124
  }
112
- //# sourceMappingURL=participant.d.ts.map
125
+
126
+ export { type DataPublishOptions, LocalParticipant, Participant, RemoteParticipant };