@livekit/rtc-node 0.12.0 → 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 (80) 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.cjs +0 -6
  12. package/dist/ffi_client.cjs.map +1 -1
  13. package/dist/ffi_client.d.cts +35 -0
  14. package/dist/ffi_client.d.ts +22 -10
  15. package/dist/ffi_client.d.ts.map +1 -1
  16. package/dist/ffi_client.js +0 -6
  17. package/dist/ffi_client.js.map +1 -1
  18. package/dist/index.cjs +0 -22
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +57 -0
  21. package/dist/index.d.ts +27 -19
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +9 -20
  24. package/dist/index.js.map +1 -1
  25. package/dist/napi/native.d.cjs.map +1 -1
  26. package/dist/napi/native.d.d.cts +21 -0
  27. package/dist/napi/native.d.d.ts +21 -0
  28. package/dist/napi/native.d.ts +5 -5
  29. package/dist/native.d.ts +5 -5
  30. package/dist/participant.d.cts +126 -0
  31. package/dist/participant.d.ts +28 -14
  32. package/dist/proto/audio_frame_pb.d.cts +813 -0
  33. package/dist/proto/audio_frame_pb.d.ts +90 -86
  34. package/dist/proto/e2ee_pb.d.cts +585 -0
  35. package/dist/proto/e2ee_pb.d.ts +60 -58
  36. package/dist/proto/ffi_pb.d.cts +851 -0
  37. package/dist/proto/ffi_pb.d.ts +35 -30
  38. package/dist/proto/handle_pb.d.cts +33 -0
  39. package/dist/proto/handle_pb.d.ts +8 -6
  40. package/dist/proto/participant_pb.d.cts +93 -0
  41. package/dist/proto/participant_pb.d.ts +13 -11
  42. package/dist/proto/room_pb.d.cts +2072 -0
  43. package/dist/proto/room_pb.d.ts +198 -196
  44. package/dist/proto/rpc_pb.d.cts +237 -0
  45. package/dist/proto/rpc_pb.d.ts +28 -26
  46. package/dist/proto/stats_pb.d.cts +1653 -0
  47. package/dist/proto/stats_pb.d.ts +96 -94
  48. package/dist/proto/track_pb.d.cts +402 -0
  49. package/dist/proto/track_pb.d.ts +47 -45
  50. package/dist/proto/video_frame_pb.d.cts +617 -0
  51. package/dist/proto/video_frame_pb.d.ts +64 -60
  52. package/dist/room.d.cts +134 -0
  53. package/dist/room.d.ts +36 -22
  54. package/dist/rpc.d.cts +82 -0
  55. package/dist/rpc.d.ts +11 -7
  56. package/dist/track.d.cts +46 -0
  57. package/dist/track.d.ts +25 -14
  58. package/dist/track_publication.d.cts +48 -0
  59. package/dist/track_publication.d.ts +20 -8
  60. package/dist/transcription.d.cts +15 -0
  61. package/dist/transcription.d.ts +4 -3
  62. package/dist/types.d.cts +9 -0
  63. package/dist/types.d.ts +3 -2
  64. package/dist/version.cjs +1 -1
  65. package/dist/version.cjs.map +1 -1
  66. package/dist/version.d.cts +3 -0
  67. package/dist/version.d.ts +3 -2
  68. package/dist/version.js +1 -1
  69. package/dist/version.js.map +1 -1
  70. package/dist/video_frame.d.cts +25 -0
  71. package/dist/video_frame.d.ts +11 -4
  72. package/dist/video_source.d.cts +22 -0
  73. package/dist/video_source.d.ts +13 -6
  74. package/dist/video_stream.d.cts +41 -0
  75. package/dist/video_stream.d.ts +18 -6
  76. package/package.json +14 -9
  77. package/src/ffi_client.ts +4 -4
  78. package/src/index.ts +14 -8
  79. package/src/napi/native.d.ts +5 -5
  80. package/src/version.ts +1 -1
package/dist/index.cjs CHANGED
@@ -23,54 +23,43 @@ __export(src_exports, {
23
23
  AudioResamplerQuality: () => import_audio_resampler.AudioResamplerQuality,
24
24
  AudioSource: () => import_audio_source.AudioSource,
25
25
  AudioStream: () => import_audio_stream.AudioStream,
26
- AudioTrack: () => import_track.AudioTrack,
27
26
  ConnectError: () => import_room.ConnectError,
28
27
  ConnectionQuality: () => import_room_pb2.ConnectionQuality,
29
28
  ConnectionState: () => import_room_pb2.ConnectionState,
30
29
  ContinualGatheringPolicy: () => import_room_pb2.ContinualGatheringPolicy,
31
30
  DataPacketKind: () => import_room_pb2.DataPacketKind,
32
31
  E2EEManager: () => import_e2ee.E2EEManager,
33
- E2EEOptions: () => import_e2ee.E2EEOptions,
34
32
  EncryptionState: () => import_e2ee_pb.EncryptionState,
35
33
  EncryptionType: () => import_e2ee_pb.EncryptionType,
36
34
  FrameCryptor: () => import_e2ee.FrameCryptor,
37
35
  IceServer: () => IceServer,
38
36
  IceTransportType: () => import_room_pb2.IceTransportType,
39
37
  KeyProvider: () => import_e2ee.KeyProvider,
40
- KeyProviderOptions: () => import_e2ee.KeyProviderOptions,
41
38
  LocalAudioTrack: () => import_track.LocalAudioTrack,
42
39
  LocalParticipant: () => import_participant.LocalParticipant,
43
- LocalTrack: () => import_track.LocalTrack,
44
40
  LocalTrackPublication: () => import_track_publication.LocalTrackPublication,
45
41
  LocalVideoTrack: () => import_track.LocalVideoTrack,
46
42
  Participant: () => import_participant.Participant,
47
43
  ParticipantKind: () => import_participant_pb.ParticipantKind,
48
44
  RemoteAudioTrack: () => import_track.RemoteAudioTrack,
49
45
  RemoteParticipant: () => import_participant.RemoteParticipant,
50
- RemoteTrack: () => import_track.RemoteTrack,
51
46
  RemoteTrackPublication: () => import_track_publication.RemoteTrackPublication,
52
47
  RemoteVideoTrack: () => import_track.RemoteVideoTrack,
53
48
  Room: () => import_room.Room,
54
49
  RoomEvent: () => import_room.RoomEvent,
55
- RoomOptions: () => import_room.RoomOptions,
56
50
  RpcError: () => import_rpc.RpcError,
57
- RtcConfiguration: () => import_room.RtcConfiguration,
58
51
  StreamState: () => import_track_pb2.StreamState,
59
52
  Track: () => import_track.Track,
60
53
  TrackKind: () => import_track_pb2.TrackKind,
61
54
  TrackPublication: () => import_track_publication.TrackPublication,
62
55
  TrackPublishOptions: () => TrackPublishOptions,
63
56
  TrackSource: () => import_track_pb2.TrackSource,
64
- Transcription: () => import_transcription.Transcription,
65
- TranscriptionSegment: () => import_transcription.TranscriptionSegment,
66
57
  VideoBufferType: () => import_video_frame_pb2.VideoBufferType,
67
58
  VideoCodec: () => import_video_frame_pb2.VideoCodec,
68
59
  VideoFrame: () => import_video_frame.VideoFrame,
69
- VideoFrameEvent: () => import_video_stream.VideoFrameEvent,
70
60
  VideoRotation: () => import_video_frame_pb2.VideoRotation,
71
61
  VideoSource: () => import_video_source.VideoSource,
72
62
  VideoStream: () => import_video_stream.VideoStream,
73
- VideoTrack: () => import_track.VideoTrack,
74
63
  combineAudioFrames: () => import_audio_frame.combineAudioFrames,
75
64
  dispose: () => import_ffi_client.dispose
76
65
  });
@@ -134,54 +123,43 @@ class TrackPublishOptions {
134
123
  AudioResamplerQuality,
135
124
  AudioSource,
136
125
  AudioStream,
137
- AudioTrack,
138
126
  ConnectError,
139
127
  ConnectionQuality,
140
128
  ConnectionState,
141
129
  ContinualGatheringPolicy,
142
130
  DataPacketKind,
143
131
  E2EEManager,
144
- E2EEOptions,
145
132
  EncryptionState,
146
133
  EncryptionType,
147
134
  FrameCryptor,
148
135
  IceServer,
149
136
  IceTransportType,
150
137
  KeyProvider,
151
- KeyProviderOptions,
152
138
  LocalAudioTrack,
153
139
  LocalParticipant,
154
- LocalTrack,
155
140
  LocalTrackPublication,
156
141
  LocalVideoTrack,
157
142
  Participant,
158
143
  ParticipantKind,
159
144
  RemoteAudioTrack,
160
145
  RemoteParticipant,
161
- RemoteTrack,
162
146
  RemoteTrackPublication,
163
147
  RemoteVideoTrack,
164
148
  Room,
165
149
  RoomEvent,
166
- RoomOptions,
167
150
  RpcError,
168
- RtcConfiguration,
169
151
  StreamState,
170
152
  Track,
171
153
  TrackKind,
172
154
  TrackPublication,
173
155
  TrackPublishOptions,
174
156
  TrackSource,
175
- Transcription,
176
- TranscriptionSegment,
177
157
  VideoBufferType,
178
158
  VideoCodec,
179
159
  VideoFrame,
180
- VideoFrameEvent,
181
160
  VideoRotation,
182
161
  VideoSource,
183
162
  VideoStream,
184
- VideoTrack,
185
163
  combineAudioFrames,
186
164
  dispose
187
165
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n LocalTrack,\n RemoteTrack,\n VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { Transcription, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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ChE;AACA,SAAK,MAAM,OAAO;AAClB,SAAK,YAAY,aAAa;AAC9B,SAAK,SAAS,UAAU,4BAAY;AACpC,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["import_room_pb","import_track_pb","import_video_frame_pb"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n type AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { type Transcription, type TranscriptionSegment } from './transcription.js';\nexport {\n E2EEManager,\n type E2EEOptions,\n type KeyProviderOptions,\n KeyProvider,\n FrameCryptor,\n} from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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C,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["import_room_pb","import_track_pb","import_video_frame_pb"]}
@@ -0,0 +1,57 @@
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { IceServer as IceServer$1, TrackPublishOptions as TrackPublishOptions$1, VideoEncoding, AudioEncoding, TrackPublishOptionsSchema, IceServerSchema } from './proto/room_pb.cjs';
3
+ export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceTransportType } from './proto/room_pb.cjs';
4
+ import { TrackSource } from './proto/track_pb.cjs';
5
+ export { StreamState, TrackKind } from './proto/track_pb.cjs';
6
+ import { VideoCodec } from './proto/video_frame_pb.cjs';
7
+ export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.cjs';
8
+ export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.cjs';
9
+ export { LocalParticipant, Participant, RemoteParticipant } from './participant.cjs';
10
+ export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.cjs';
11
+ export { VideoFrame } from './video_frame.cjs';
12
+ export { AudioFrame, combineAudioFrames } from './audio_frame.cjs';
13
+ export { AudioStream } from './audio_stream.cjs';
14
+ export { AudioResampler, AudioResamplerQuality } from './audio_resampler.cjs';
15
+ export { VideoFrameEvent, VideoStream } from './video_stream.cjs';
16
+ export { AudioSource } from './audio_source.cjs';
17
+ export { VideoSource } from './video_source.cjs';
18
+ export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.cjs';
19
+ export { Transcription, TranscriptionSegment } from './transcription.cjs';
20
+ export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.cjs';
21
+ export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.cjs';
22
+ export { EncryptionState, EncryptionType } from './proto/e2ee_pb.cjs';
23
+ export { ParticipantKind } from './proto/participant_pb.cjs';
24
+ export { livekitDispose as dispose } from './napi/native.d.cjs';
25
+ export { ChatMessage } from './types.cjs';
26
+ import '@bufbuild/protobuf/codegenv1';
27
+ import './proto/handle_pb.cjs';
28
+ import './proto/stats_pb.cjs';
29
+ import '@livekit/typed-emitter';
30
+ import './proto/audio_frame_pb.cjs';
31
+ import '@livekit/mutex';
32
+ import './proto/rpc_pb.cjs';
33
+
34
+ type IceServerInit = MessageInitShape<typeof IceServerSchema> & {
35
+ urls: string[];
36
+ };
37
+ declare class IceServer implements IceServer$1 {
38
+ $typeName: "livekit.proto.IceServer";
39
+ urls: string[];
40
+ username: string;
41
+ password: string;
42
+ constructor(init: IceServerInit);
43
+ }
44
+ declare class TrackPublishOptions implements TrackPublishOptions$1 {
45
+ $typeName: "livekit.proto.TrackPublishOptions";
46
+ videoCodec: VideoCodec;
47
+ videoEncoding?: VideoEncoding | undefined;
48
+ audioEncoding?: AudioEncoding | undefined;
49
+ dtx: boolean;
50
+ simulcast: boolean;
51
+ source: TrackSource;
52
+ stream: string;
53
+ red: boolean;
54
+ constructor(init?: MessageInitShape<typeof TrackPublishOptionsSchema>);
55
+ }
56
+
57
+ export { IceServer, TrackPublishOptions, TrackSource, VideoCodec };
package/dist/index.d.ts CHANGED
@@ -1,40 +1,47 @@
1
- import type { MessageInitShape } from '@bufbuild/protobuf';
2
- import type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';
3
- import { IceServerSchema, type IceServer as IceServerType, type TrackPublishOptions as TrackPublishOptionsType } from './proto/room_pb.js';
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { IceServer as IceServer$1, TrackPublishOptions as TrackPublishOptions$1, VideoEncoding, AudioEncoding, TrackPublishOptionsSchema, IceServerSchema } from './proto/room_pb.js';
3
+ export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceTransportType } from './proto/room_pb.js';
4
4
  import { TrackSource } from './proto/track_pb.js';
5
+ export { StreamState, TrackKind } from './proto/track_pb.js';
5
6
  import { VideoCodec } from './proto/video_frame_pb.js';
6
- export { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';
7
- export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
8
- export { Track, LocalTrack, RemoteTrack, VideoTrack, LocalAudioTrack, LocalVideoTrack, RemoteAudioTrack, RemoteVideoTrack, AudioTrack, } from './track.js';
7
+ export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js';
8
+ export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.js';
9
+ export { LocalParticipant, Participant, RemoteParticipant } from './participant.js';
10
+ export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.js';
9
11
  export { VideoFrame } from './video_frame.js';
10
12
  export { AudioFrame, combineAudioFrames } from './audio_frame.js';
11
13
  export { AudioStream } from './audio_stream.js';
12
14
  export { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';
13
- export { VideoStream, VideoFrameEvent } from './video_stream.js';
15
+ export { VideoFrameEvent, VideoStream } from './video_stream.js';
14
16
  export { AudioSource } from './audio_source.js';
15
17
  export { VideoSource } from './video_source.js';
16
- export { TrackPublication, RemoteTrackPublication, LocalTrackPublication, } from './track_publication.js';
18
+ export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.js';
17
19
  export { Transcription, TranscriptionSegment } from './transcription.js';
18
- export { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';
19
- export { ConnectionQuality, IceTransportType, DataPacketKind, ContinualGatheringPolicy, ConnectionState, } from './proto/room_pb.js';
20
- export { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';
21
- export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';
22
- export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';
23
- export { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';
20
+ export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.js';
21
+ export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.js';
22
+ export { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';
24
23
  export { ParticipantKind } from './proto/participant_pb.js';
25
- export { dispose } from './ffi_client.js';
26
- export type { ChatMessage } from './types.js';
24
+ export { livekitDispose as dispose } from './napi/native.d.js';
25
+ export { ChatMessage } from './types.js';
26
+ import '@bufbuild/protobuf/codegenv1';
27
+ import './proto/handle_pb.js';
28
+ import './proto/stats_pb.js';
29
+ import '@livekit/typed-emitter';
30
+ import './proto/audio_frame_pb.js';
31
+ import '@livekit/mutex';
32
+ import './proto/rpc_pb.js';
33
+
27
34
  type IceServerInit = MessageInitShape<typeof IceServerSchema> & {
28
35
  urls: string[];
29
36
  };
30
- export declare class IceServer implements IceServerType {
37
+ declare class IceServer implements IceServer$1 {
31
38
  $typeName: "livekit.proto.IceServer";
32
39
  urls: string[];
33
40
  username: string;
34
41
  password: string;
35
42
  constructor(init: IceServerInit);
36
43
  }
37
- export declare class TrackPublishOptions implements TrackPublishOptionsType {
44
+ declare class TrackPublishOptions implements TrackPublishOptions$1 {
38
45
  $typeName: "livekit.proto.TrackPublishOptions";
39
46
  videoCodec: VideoCodec;
40
47
  videoEncoding?: VideoEncoding | undefined;
@@ -46,4 +53,5 @@ export declare class TrackPublishOptions implements TrackPublishOptionsType {
46
53
  red: boolean;
47
54
  constructor(init?: MessageInitShape<typeof TrackPublishOptionsSchema>);
48
55
  }
49
- //# sourceMappingURL=index.d.ts.map
56
+
57
+ export { IceServer, TrackPublishOptions, TrackSource, VideoCodec };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,y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CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;gBAED,IAAI,GAAE,gBAAgB,CAAC,OAAO,yBAAyB,CAAM;CAe1E"}
package/dist/index.js CHANGED
@@ -6,24 +6,20 @@ import {
6
6
  } from "./proto/room_pb.js";
7
7
  import { TrackSource } from "./proto/track_pb.js";
8
8
  import { VideoCodec } from "./proto/video_frame_pb.js";
9
- import { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from "./room.js";
9
+ import { Room, RoomEvent, ConnectError } from "./room.js";
10
10
  import { Participant, RemoteParticipant, LocalParticipant } from "./participant.js";
11
11
  import {
12
12
  Track,
13
- LocalTrack,
14
- RemoteTrack,
15
- VideoTrack,
16
13
  LocalAudioTrack,
17
14
  LocalVideoTrack,
18
15
  RemoteAudioTrack,
19
- RemoteVideoTrack,
20
- AudioTrack
16
+ RemoteVideoTrack
21
17
  } from "./track.js";
22
18
  import { VideoFrame } from "./video_frame.js";
23
19
  import { AudioFrame, combineAudioFrames } from "./audio_frame.js";
24
20
  import { AudioStream } from "./audio_stream.js";
25
21
  import { AudioResampler, AudioResamplerQuality } from "./audio_resampler.js";
26
- import { VideoStream, VideoFrameEvent } from "./video_stream.js";
22
+ import { VideoStream } from "./video_stream.js";
27
23
  import { AudioSource } from "./audio_source.js";
28
24
  import { VideoSource } from "./video_source.js";
29
25
  import {
@@ -31,8 +27,12 @@ import {
31
27
  RemoteTrackPublication,
32
28
  LocalTrackPublication
33
29
  } from "./track_publication.js";
34
- import { Transcription, TranscriptionSegment } from "./transcription.js";
35
- import { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from "./e2ee.js";
30
+ import {} from "./transcription.js";
31
+ import {
32
+ E2EEManager,
33
+ KeyProvider,
34
+ FrameCryptor
35
+ } from "./e2ee.js";
36
36
  import {
37
37
  ConnectionQuality,
38
38
  IceTransportType,
@@ -80,54 +80,43 @@ export {
80
80
  AudioResamplerQuality,
81
81
  AudioSource,
82
82
  AudioStream,
83
- AudioTrack,
84
83
  ConnectError,
85
84
  ConnectionQuality,
86
85
  ConnectionState,
87
86
  ContinualGatheringPolicy,
88
87
  DataPacketKind,
89
88
  E2EEManager,
90
- E2EEOptions,
91
89
  EncryptionState,
92
90
  EncryptionType,
93
91
  FrameCryptor,
94
92
  IceServer,
95
93
  IceTransportType,
96
94
  KeyProvider,
97
- KeyProviderOptions,
98
95
  LocalAudioTrack,
99
96
  LocalParticipant,
100
- LocalTrack,
101
97
  LocalTrackPublication,
102
98
  LocalVideoTrack,
103
99
  Participant,
104
100
  ParticipantKind,
105
101
  RemoteAudioTrack,
106
102
  RemoteParticipant,
107
- RemoteTrack,
108
103
  RemoteTrackPublication,
109
104
  RemoteVideoTrack,
110
105
  Room,
111
106
  RoomEvent,
112
- RoomOptions,
113
107
  RpcError,
114
- RtcConfiguration,
115
108
  StreamState,
116
109
  Track,
117
110
  TrackKind,
118
111
  TrackPublication,
119
112
  TrackPublishOptions,
120
113
  TrackSource2 as TrackSource,
121
- Transcription,
122
- TranscriptionSegment,
123
114
  VideoBufferType,
124
115
  VideoCodec2 as VideoCodec,
125
116
  VideoFrame,
126
- VideoFrameEvent,
127
117
  VideoRotation,
128
118
  VideoSource,
129
119
  VideoStream,
130
- VideoTrack,
131
120
  combineAudioFrames,
132
121
  dispose
133
122
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n LocalTrack,\n RemoteTrack,\n VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { Transcription, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":"AAIA,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,MAAM,WAAW,cAAc,aAAa,wBAAwB;AAC7E,SAAS,aAAa,mBAAmB,wBAAwB;AACjE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY,0BAA0B;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,aAAa,uBAAuB;AAC7C,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,4BAA4B;AACpD,SAAS,aAAa,aAAa,oBAAoB,aAAa,oBAAoB;AAExF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAA+D;AACxE,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,aAAa,WAAW,eAAAA,oBAAmB;AACpD,SAAS,iBAAiB,eAAe,cAAAC,mBAAkB;AAC3D,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAQjB,MAAM,UAAmC;AAAA,EAK9C,YAAY,MAAqB;AAJjC,qBAAY;AAKV,UAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,SAAK,OAAO;AACZ,SAAK,WAAW,YAAY;AAC5B,SAAK,WAAW,YAAY;AAC5B,WAAO,iBAAiB,IAAI;AAAA,EAC9B;AACF;AAEO,MAAM,oBAAuD;AAAA,EAWlE,YAAY,OAA2D,CAAC,GAAG;AAV3E,qBAAY;AAWV,UAAM,EAAE,YAAY,eAAe,eAAe,KAAK,WAAW,QAAQ,QAAQ,IAAI,IAAI;AAC1F,SAAK,aAAa,cAAc,WAAW;AAC3C,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,SAAK,MAAM,OAAO;AAClB,SAAK,YAAY,aAAa;AAC9B,SAAK,SAAS,UAAU,YAAY;AACpC,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["TrackSource","VideoCodec"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n type AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { type Transcription, type TranscriptionSegment } from './transcription.js';\nexport {\n E2EEManager,\n type E2EEOptions,\n type KeyProviderOptions,\n KeyProvider,\n FrameCryptor,\n} from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":"AAIA,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,MAAM,WAAW,oBAA6D;AACvF,SAAS,aAAa,mBAAmB,wBAAwB;AACjE;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY,0BAA0B;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,mBAAyC;AAClD,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,eAA8D;AAC9D;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAA+D;AACxE,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,aAAa,WAAW,eAAAA,oBAAmB;AACpD,SAAS,iBAAiB,eAAe,cAAAC,mBAAkB;AAC3D,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAQjB,MAAM,UAAmC;AAAA,EAK9C,YAAY,MAAqB;AAJjC,qBAAY;AAKV,UAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,SAAK,OAAO;AACZ,SAAK,WAAW,YAAY;AAC5B,SAAK,WAAW,YAAY;AAC5B,WAAO,iBAAiB,IAAI;AAAA,EAC9B;AACF;AAEO,MAAM,oBAAuD;AAAA,EAWlE,YAAY,OAA2D,CAAC,GAAG;AAV3E,qBAAY;AAWV,UAAM,EAAE,YAAY,eAAe,eAAe,KAAK,WAAW,QAAQ,QAAQ,IAAI,IAAI;AAC1F,SAAK,aAAa,cAAc,WAAW;AAC3C,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,SAAK,MAAM,OAAO;AAClB,SAAK,YAAY,aAAa;AAC9B,SAAK,SAAS,UAAU,YAAY;AACpC,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["TrackSource","VideoCodec"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/napi/native.d.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n\n/* auto-generated by NAPI-RS */\n\nexport function livekitInitialize(\n callback: (data: Uint8Array) => void,\n captureLogs: boolean,\n sdkVersion: string,\n): void;\nexport function livekitFfiRequest(data: Uint8Array): Uint8Array;\nexport function livekitRetrievePtr(handle: Uint8Array): bigint;\nexport function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;\nexport function livekitDispose(): Promise<void>;\nexport declare class FfiHandle {\n constructor(handle: bigint);\n dispose(): void;\n get handle(): bigint;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/napi/native.d.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n\n/* auto-generated by NAPI-RS */\n\nexport declare function livekitInitialize(\n callback: (data: Uint8Array) => void,\n captureLogs: boolean,\n sdkVersion: string,\n): void;\nexport declare function livekitFfiRequest(data: Uint8Array): Uint8Array;\nexport declare function livekitRetrievePtr(handle: Uint8Array): bigint;\nexport declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;\nexport declare function livekitDispose(): Promise<void>;\nexport declare class FfiHandle {\n constructor(handle: bigint);\n dispose(): void;\n get handle(): bigint;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ declare function livekitInitialize(
7
+ callback: (data: Uint8Array) => void,
8
+ captureLogs: boolean,
9
+ sdkVersion: string,
10
+ ): void;
11
+ declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ declare function livekitDispose(): Promise<void>;
15
+ declare class FfiHandle {
16
+ constructor(handle: bigint);
17
+ dispose(): void;
18
+ get handle(): bigint;
19
+ }
20
+
21
+ export { FfiHandle, livekitCopyBuffer, livekitDispose, livekitFfiRequest, livekitInitialize, livekitRetrievePtr };
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ declare function livekitInitialize(
7
+ callback: (data: Uint8Array) => void,
8
+ captureLogs: boolean,
9
+ sdkVersion: string,
10
+ ): void;
11
+ declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ declare function livekitDispose(): Promise<void>;
15
+ declare class FfiHandle {
16
+ constructor(handle: bigint);
17
+ dispose(): void;
18
+ get handle(): bigint;
19
+ }
20
+
21
+ export { FfiHandle, livekitCopyBuffer, livekitDispose, livekitFfiRequest, livekitInitialize, livekitRetrievePtr };
@@ -3,15 +3,15 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export function livekitInitialize(
6
+ export declare function livekitInitialize(
7
7
  callback: (data: Uint8Array) => void,
8
8
  captureLogs: boolean,
9
9
  sdkVersion: string,
10
10
  ): void;
11
- export function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
- export function livekitRetrievePtr(handle: Uint8Array): bigint;
13
- export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
- export function livekitDispose(): Promise<void>;
11
+ export declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ export declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ export declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ export declare function livekitDispose(): Promise<void>;
15
15
  export declare class FfiHandle {
16
16
  constructor(handle: bigint);
17
17
  dispose(): void;
package/dist/native.d.ts CHANGED
@@ -3,15 +3,15 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export function livekitInitialize(
6
+ export declare function livekitInitialize(
7
7
  callback: (data: Uint8Array) => void,
8
8
  captureLogs: boolean,
9
9
  sdkVersion: string,
10
10
  ): void;
11
- export function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
- export function livekitRetrievePtr(handle: Uint8Array): bigint;
13
- export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
- export function livekitDispose(): Promise<void>;
11
+ export declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ export declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ export declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ export declare function livekitDispose(): Promise<void>;
15
15
  export declare class FfiHandle {
16
16
  constructor(handle: bigint);
17
17
  dispose(): void;
@@ -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 };