@livekit/rtc-node 0.11.0 → 0.12.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.
Files changed (153) hide show
  1. package/dist/audio_frame.cjs +94 -0
  2. package/dist/audio_frame.cjs.map +1 -0
  3. package/dist/audio_frame.js +64 -67
  4. package/dist/audio_frame.js.map +1 -1
  5. package/dist/audio_resampler.cjs +153 -0
  6. package/dist/audio_resampler.cjs.map +1 -0
  7. package/dist/audio_resampler.js +129 -134
  8. package/dist/audio_resampler.js.map +1 -1
  9. package/dist/audio_source.cjs +116 -0
  10. package/dist/audio_source.cjs.map +1 -0
  11. package/dist/audio_source.js +92 -85
  12. package/dist/audio_source.js.map +1 -1
  13. package/dist/audio_stream.cjs +104 -0
  14. package/dist/audio_stream.cjs.map +1 -0
  15. package/dist/audio_stream.js +77 -78
  16. package/dist/audio_stream.js.map +1 -1
  17. package/dist/e2ee.cjs +268 -0
  18. package/dist/e2ee.cjs.map +1 -0
  19. package/dist/e2ee.d.ts.map +1 -1
  20. package/dist/e2ee.js +244 -221
  21. package/dist/e2ee.js.map +1 -1
  22. package/dist/ffi_client.cjs +101 -0
  23. package/dist/ffi_client.cjs.map +1 -0
  24. package/dist/ffi_client.js +73 -48
  25. package/dist/ffi_client.js.map +1 -1
  26. package/dist/index.cjs +188 -0
  27. package/dist/index.cjs.map +1 -0
  28. package/dist/index.js +130 -48
  29. package/dist/index.js.map +1 -1
  30. package/dist/napi/native.d.cjs +17 -0
  31. package/dist/napi/native.d.cjs.map +1 -0
  32. package/dist/napi/native.d.js +1 -0
  33. package/dist/napi/native.d.js.map +1 -0
  34. package/dist/napi/native.d.ts +5 -5
  35. package/dist/native.cjs +301 -0
  36. package/dist/native.d.ts +19 -0
  37. package/dist/native.js +15 -0
  38. package/dist/participant.cjs +388 -0
  39. package/dist/participant.cjs.map +1 -0
  40. package/dist/participant.js +363 -339
  41. package/dist/participant.js.map +1 -1
  42. package/dist/proto/audio_frame_pb.cjs +193 -0
  43. package/dist/proto/audio_frame_pb.cjs.map +1 -0
  44. package/dist/proto/audio_frame_pb.d.ts +8 -8
  45. package/dist/proto/audio_frame_pb.d.ts.map +1 -1
  46. package/dist/proto/audio_frame_pb.js +122 -322
  47. package/dist/proto/audio_frame_pb.js.map +1 -1
  48. package/dist/proto/e2ee_pb.cjs +131 -0
  49. package/dist/proto/e2ee_pb.cjs.map +1 -0
  50. package/dist/proto/e2ee_pb.js +76 -202
  51. package/dist/proto/e2ee_pb.js.map +1 -1
  52. package/dist/proto/ffi_pb.cjs +76 -0
  53. package/dist/proto/ffi_pb.cjs.map +1 -0
  54. package/dist/proto/ffi_pb.d.ts +6 -6
  55. package/dist/proto/ffi_pb.d.ts.map +1 -1
  56. package/dist/proto/ffi_pb.js +39 -98
  57. package/dist/proto/ffi_pb.js.map +1 -1
  58. package/dist/proto/handle_pb.cjs +33 -0
  59. package/dist/proto/handle_pb.cjs.map +1 -0
  60. package/dist/proto/handle_pb.js +6 -22
  61. package/dist/proto/handle_pb.js.map +1 -1
  62. package/dist/proto/participant_pb.cjs +50 -0
  63. package/dist/proto/participant_pb.cjs.map +1 -0
  64. package/dist/proto/participant_pb.d.ts +1 -1
  65. package/dist/proto/participant_pb.d.ts.map +1 -1
  66. package/dist/proto/participant_pb.js +20 -58
  67. package/dist/proto/participant_pb.js.map +1 -1
  68. package/dist/proto/room_pb.cjs +370 -0
  69. package/dist/proto/room_pb.cjs.map +1 -0
  70. package/dist/proto/room_pb.d.ts +16 -16
  71. package/dist/proto/room_pb.d.ts.map +1 -1
  72. package/dist/proto/room_pb.js +245 -638
  73. package/dist/proto/room_pb.js.map +1 -1
  74. package/dist/proto/rpc_pb.cjs +63 -0
  75. package/dist/proto/rpc_pb.cjs.map +1 -0
  76. package/dist/proto/rpc_pb.js +26 -72
  77. package/dist/proto/rpc_pb.js.map +1 -1
  78. package/dist/proto/stats_pb.cjs +256 -0
  79. package/dist/proto/stats_pb.cjs.map +1 -0
  80. package/dist/proto/stats_pb.js +175 -456
  81. package/dist/proto/stats_pb.js.map +1 -1
  82. package/dist/proto/track_pb.cjs +116 -0
  83. package/dist/proto/track_pb.cjs.map +1 -0
  84. package/dist/proto/track_pb.d.ts +3 -3
  85. package/dist/proto/track_pb.d.ts.map +1 -1
  86. package/dist/proto/track_pb.js +68 -174
  87. package/dist/proto/track_pb.js.map +1 -1
  88. package/dist/proto/video_frame_pb.cjs +161 -0
  89. package/dist/proto/video_frame_pb.cjs.map +1 -0
  90. package/dist/proto/video_frame_pb.d.ts +5 -5
  91. package/dist/proto/video_frame_pb.d.ts.map +1 -1
  92. package/dist/proto/video_frame_pb.js +103 -271
  93. package/dist/proto/video_frame_pb.js.map +1 -1
  94. package/dist/room.cjs +440 -0
  95. package/dist/room.cjs.map +1 -0
  96. package/dist/room.js +384 -373
  97. package/dist/room.js.map +1 -1
  98. package/dist/rpc.cjs +89 -0
  99. package/dist/rpc.cjs.map +1 -0
  100. package/dist/rpc.js +59 -63
  101. package/dist/rpc.js.map +1 -1
  102. package/dist/track.cjs +100 -0
  103. package/dist/track.cjs.map +1 -0
  104. package/dist/track.js +66 -62
  105. package/dist/track.js.map +1 -1
  106. package/dist/track_publication.cjs +106 -0
  107. package/dist/track_publication.cjs.map +1 -0
  108. package/dist/track_publication.js +76 -74
  109. package/dist/track_publication.js.map +1 -1
  110. package/dist/transcription.cjs +17 -0
  111. package/dist/transcription.cjs.map +1 -0
  112. package/dist/transcription.js +0 -1
  113. package/dist/transcription.js.map +1 -1
  114. package/dist/types.cjs +17 -0
  115. package/dist/types.cjs.map +1 -0
  116. package/dist/types.js +0 -1
  117. package/dist/types.js.map +1 -1
  118. package/dist/version.cjs +29 -0
  119. package/dist/version.cjs.map +1 -0
  120. package/dist/version.d.ts +1 -1
  121. package/dist/version.js +4 -1
  122. package/dist/version.js.map +1 -1
  123. package/dist/video_frame.cjs +242 -0
  124. package/dist/video_frame.cjs.map +1 -0
  125. package/dist/video_frame.js +212 -201
  126. package/dist/video_frame.js.map +1 -1
  127. package/dist/video_source.cjs +63 -0
  128. package/dist/video_source.cjs.map +1 -0
  129. package/dist/video_source.d.ts.map +1 -1
  130. package/dist/video_source.js +42 -37
  131. package/dist/video_source.js.map +1 -1
  132. package/dist/video_stream.cjs +103 -0
  133. package/dist/video_stream.cjs.map +1 -0
  134. package/dist/video_stream.js +76 -77
  135. package/dist/video_stream.js.map +1 -1
  136. package/package.json +18 -9
  137. package/src/audio_frame.ts +2 -2
  138. package/src/audio_source.ts +2 -2
  139. package/src/e2ee.ts +2 -2
  140. package/src/napi/native.d.ts +5 -5
  141. package/src/proto/audio_frame_pb.ts +12 -12
  142. package/src/proto/e2ee_pb.ts +1 -1
  143. package/src/proto/ffi_pb.ts +13 -13
  144. package/src/proto/handle_pb.ts +1 -1
  145. package/src/proto/participant_pb.ts +3 -3
  146. package/src/proto/room_pb.ts +24 -24
  147. package/src/proto/rpc_pb.ts +1 -1
  148. package/src/proto/stats_pb.ts +1 -1
  149. package/src/proto/track_pb.ts +7 -7
  150. package/src/proto/video_frame_pb.ts +9 -9
  151. package/src/version.ts +1 -1
  152. package/src/video_frame.ts +1 -1
  153. package/src/video_source.ts +5 -1
@@ -1,50 +1,75 @@
1
- import { create, fromBinary, toBinary } from '@bufbuild/protobuf';
2
- import EventEmitter from 'events';
3
- import { FfiHandle, livekitCopyBuffer, livekitDispose, livekitFfiRequest, livekitInitialize, livekitRetrievePtr, } from './napi/native.js';
4
- import { FfiEventSchema, FfiRequestSchema, FfiResponseSchema, } from './proto/ffi_pb.js';
5
- import { SDK_VERSION } from './version.js';
6
- export { FfiHandle, livekitDispose as dispose };
7
- export var FfiClientEvent;
8
- (function (FfiClientEvent) {
9
- FfiClientEvent["FfiEvent"] = "ffi_event";
10
- })(FfiClientEvent || (FfiClientEvent = {}));
11
- export class FfiClient extends EventEmitter {
12
- /** @internal */
13
- static get instance() {
14
- if (!FfiClient._client)
15
- FfiClient._client = new FfiClient();
16
- return FfiClient._client;
17
- }
18
- constructor() {
19
- super();
20
- this.setMaxListeners(0);
21
- livekitInitialize((event_data) => {
22
- const event = fromBinary(FfiEventSchema, event_data);
23
- this.emit(FfiClientEvent.FfiEvent, event);
24
- }, true, SDK_VERSION);
25
- }
26
- request(req) {
27
- const request = create(FfiRequestSchema, req);
28
- const req_data = toBinary(FfiRequestSchema, request);
29
- const res_data = livekitFfiRequest(req_data);
30
- return fromBinary(FfiResponseSchema, res_data).message.value;
31
- }
32
- copyBuffer(ptr, len) {
33
- return livekitCopyBuffer(ptr, len);
34
- }
35
- retrievePtr(data) {
36
- return livekitRetrievePtr(data);
37
- }
38
- async waitFor(predicate) {
39
- return new Promise((resolve) => {
40
- const listener = (ev) => {
41
- if (predicate(ev)) {
42
- this.off(FfiClientEvent.FfiEvent, listener);
43
- resolve(ev.message.value);
44
- }
45
- };
46
- this.on(FfiClientEvent.FfiEvent, listener);
47
- });
48
- }
1
+ import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
2
+ import EventEmitter from "events";
3
+ import {
4
+ FfiHandle,
5
+ livekitCopyBuffer,
6
+ livekitDispose,
7
+ livekitFfiRequest,
8
+ livekitInitialize,
9
+ livekitRetrievePtr
10
+ } from "./napi/native.js";
11
+ import {
12
+ FfiEvent,
13
+ FfiEventSchema,
14
+ FfiRequest,
15
+ FfiRequestSchema,
16
+ FfiResponse,
17
+ FfiResponseSchema
18
+ } from "./proto/ffi_pb.js";
19
+ import { SDK_VERSION } from "./version.js";
20
+ var FfiClientEvent = /* @__PURE__ */ ((FfiClientEvent2) => {
21
+ FfiClientEvent2["FfiEvent"] = "ffi_event";
22
+ return FfiClientEvent2;
23
+ })(FfiClientEvent || {});
24
+ class FfiClient extends EventEmitter {
25
+ /** @internal */
26
+ static get instance() {
27
+ if (!FfiClient._client) FfiClient._client = new FfiClient();
28
+ return FfiClient._client;
29
+ }
30
+ constructor() {
31
+ super();
32
+ this.setMaxListeners(0);
33
+ livekitInitialize(
34
+ (event_data) => {
35
+ const event = fromBinary(FfiEventSchema, event_data);
36
+ this.emit("ffi_event" /* FfiEvent */, event);
37
+ },
38
+ true,
39
+ SDK_VERSION
40
+ );
41
+ }
42
+ request(req) {
43
+ const request = create(FfiRequestSchema, req);
44
+ const req_data = toBinary(FfiRequestSchema, request);
45
+ const res_data = livekitFfiRequest(req_data);
46
+ return fromBinary(FfiResponseSchema, res_data).message.value;
47
+ }
48
+ copyBuffer(ptr, len) {
49
+ return livekitCopyBuffer(ptr, len);
50
+ }
51
+ retrievePtr(data) {
52
+ return livekitRetrievePtr(data);
53
+ }
54
+ async waitFor(predicate) {
55
+ return new Promise((resolve) => {
56
+ const listener = (ev) => {
57
+ if (predicate(ev)) {
58
+ this.off("ffi_event" /* FfiEvent */, listener);
59
+ resolve(ev.message.value);
60
+ }
61
+ };
62
+ this.on("ffi_event" /* FfiEvent */, listener);
63
+ });
64
+ }
49
65
  }
66
+ export {
67
+ FfiClient,
68
+ FfiClientEvent,
69
+ FfiEvent,
70
+ FfiHandle,
71
+ FfiRequest,
72
+ FfiResponse,
73
+ livekitDispose as dispose
74
+ };
50
75
  //# sourceMappingURL=ffi_client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ffi_client.js","sourceRoot":"","sources":["../src/ffi_client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,cAAc,EAEd,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAqC,cAAc,IAAI,OAAO,EAAE,CAAC;AAMnF,MAAM,CAAN,IAAY,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AAQ,GAAG,CAAC,EAAY,EAAE,EAAE;gBAChC,IAAI,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;oBAClB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC5C,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAU,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create, fromBinary, toBinary } from '@bufbuild/protobuf';\nimport type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter';\nimport EventEmitter from 'events';\nimport {\n FfiHandle,\n livekitCopyBuffer,\n livekitDispose,\n livekitFfiRequest,\n livekitInitialize,\n livekitRetrievePtr,\n} from './napi/native.js';\nimport {\n FfiEvent,\n FfiEventSchema,\n FfiRequest,\n FfiRequestSchema,\n FfiResponse,\n FfiResponseSchema,\n} from './proto/ffi_pb.js';\nimport { SDK_VERSION } from './version.js';\n\nexport { FfiHandle, FfiEvent, FfiResponse, FfiRequest, livekitDispose as dispose };\n\nexport type FfiClientCallbacks = {\n ffi_event: (event: FfiEvent) => void;\n};\n\nexport enum FfiClientEvent {\n FfiEvent = 'ffi_event',\n}\n\nexport class FfiClient extends (EventEmitter as new () => TypedEmitter<FfiClientCallbacks>) {\n static _client?: FfiClient;\n\n /** @internal */\n static get instance(): FfiClient {\n if (!FfiClient._client) FfiClient._client = new FfiClient();\n\n return FfiClient._client;\n }\n\n constructor() {\n super();\n this.setMaxListeners(0);\n\n livekitInitialize(\n (event_data: Uint8Array) => {\n const event = fromBinary(FfiEventSchema, event_data);\n this.emit(FfiClientEvent.FfiEvent, event);\n },\n true,\n SDK_VERSION,\n );\n }\n\n request<T>(req: MessageInitShape<typeof FfiRequestSchema>): T {\n const request = create(FfiRequestSchema, req);\n const req_data = toBinary(FfiRequestSchema, request);\n const res_data = livekitFfiRequest(req_data);\n return fromBinary(FfiResponseSchema, res_data).message.value as T;\n }\n\n copyBuffer(ptr: bigint, len: number): Uint8Array {\n return livekitCopyBuffer(ptr, len);\n }\n\n retrievePtr(data: Uint8Array): bigint {\n return livekitRetrievePtr(data);\n }\n\n async waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T> {\n return new Promise<T>((resolve) => {\n const listener = (ev: FfiEvent) => {\n if (predicate(ev)) {\n this.off(FfiClientEvent.FfiEvent, listener);\n resolve(ev.message.value as T);\n }\n };\n this.on(FfiClientEvent.FfiEvent, listener);\n });\n }\n}\n"],"mappings":"AAIA,SAAS,QAAQ,YAAY,gBAAgB;AAE7C,OAAO,kBAAkB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAQrB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,cAAW;AADD,SAAAA;AAAA,GAAA;AAIL,MAAM,kBAAmB,aAA4D;AAAA;AAAA,EAI1F,WAAW,WAAsB;AAC/B,QAAI,CAAC,UAAU,QAAS,WAAU,UAAU,IAAI,UAAU;AAE1D,WAAO,UAAU;AAAA,EACnB;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,gBAAgB,CAAC;AAEtB;AAAA,MACE,CAAC,eAA2B;AAC1B,cAAM,QAAQ,WAAW,gBAAgB,UAAU;AACnD,aAAK,KAAK,4BAAyB,KAAK;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAW,KAAmD;AAC5D,UAAM,UAAU,OAAO,kBAAkB,GAAG;AAC5C,UAAM,WAAW,SAAS,kBAAkB,OAAO;AACnD,UAAM,WAAW,kBAAkB,QAAQ;AAC3C,WAAO,WAAW,mBAAmB,QAAQ,EAAE,QAAQ;AAAA,EACzD;AAAA,EAEA,WAAW,KAAa,KAAyB;AAC/C,WAAO,kBAAkB,KAAK,GAAG;AAAA,EACnC;AAAA,EAEA,YAAY,MAA0B;AACpC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAAA,EAEA,MAAM,QAAW,WAAkD;AACjE,WAAO,IAAI,QAAW,CAAC,YAAY;AACjC,YAAM,WAAW,CAAC,OAAiB;AACjC,YAAI,UAAU,EAAE,GAAG;AACjB,eAAK,IAAI,4BAAyB,QAAQ;AAC1C,kBAAQ,GAAG,QAAQ,KAAU;AAAA,QAC/B;AAAA,MACF;AACA,WAAK,GAAG,4BAAyB,QAAQ;AAAA,IAC3C,CAAC;AAAA,EACH;AACF;","names":["FfiClientEvent"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var src_exports = {};
20
+ __export(src_exports, {
21
+ AudioFrame: () => import_audio_frame.AudioFrame,
22
+ AudioResampler: () => import_audio_resampler.AudioResampler,
23
+ AudioResamplerQuality: () => import_audio_resampler.AudioResamplerQuality,
24
+ AudioSource: () => import_audio_source.AudioSource,
25
+ AudioStream: () => import_audio_stream.AudioStream,
26
+ AudioTrack: () => import_track.AudioTrack,
27
+ ConnectError: () => import_room.ConnectError,
28
+ ConnectionQuality: () => import_room_pb2.ConnectionQuality,
29
+ ConnectionState: () => import_room_pb2.ConnectionState,
30
+ ContinualGatheringPolicy: () => import_room_pb2.ContinualGatheringPolicy,
31
+ DataPacketKind: () => import_room_pb2.DataPacketKind,
32
+ E2EEManager: () => import_e2ee.E2EEManager,
33
+ E2EEOptions: () => import_e2ee.E2EEOptions,
34
+ EncryptionState: () => import_e2ee_pb.EncryptionState,
35
+ EncryptionType: () => import_e2ee_pb.EncryptionType,
36
+ FrameCryptor: () => import_e2ee.FrameCryptor,
37
+ IceServer: () => IceServer,
38
+ IceTransportType: () => import_room_pb2.IceTransportType,
39
+ KeyProvider: () => import_e2ee.KeyProvider,
40
+ KeyProviderOptions: () => import_e2ee.KeyProviderOptions,
41
+ LocalAudioTrack: () => import_track.LocalAudioTrack,
42
+ LocalParticipant: () => import_participant.LocalParticipant,
43
+ LocalTrack: () => import_track.LocalTrack,
44
+ LocalTrackPublication: () => import_track_publication.LocalTrackPublication,
45
+ LocalVideoTrack: () => import_track.LocalVideoTrack,
46
+ Participant: () => import_participant.Participant,
47
+ ParticipantKind: () => import_participant_pb.ParticipantKind,
48
+ RemoteAudioTrack: () => import_track.RemoteAudioTrack,
49
+ RemoteParticipant: () => import_participant.RemoteParticipant,
50
+ RemoteTrack: () => import_track.RemoteTrack,
51
+ RemoteTrackPublication: () => import_track_publication.RemoteTrackPublication,
52
+ RemoteVideoTrack: () => import_track.RemoteVideoTrack,
53
+ Room: () => import_room.Room,
54
+ RoomEvent: () => import_room.RoomEvent,
55
+ RoomOptions: () => import_room.RoomOptions,
56
+ RpcError: () => import_rpc.RpcError,
57
+ RtcConfiguration: () => import_room.RtcConfiguration,
58
+ StreamState: () => import_track_pb2.StreamState,
59
+ Track: () => import_track.Track,
60
+ TrackKind: () => import_track_pb2.TrackKind,
61
+ TrackPublication: () => import_track_publication.TrackPublication,
62
+ TrackPublishOptions: () => TrackPublishOptions,
63
+ TrackSource: () => import_track_pb2.TrackSource,
64
+ Transcription: () => import_transcription.Transcription,
65
+ TranscriptionSegment: () => import_transcription.TranscriptionSegment,
66
+ VideoBufferType: () => import_video_frame_pb2.VideoBufferType,
67
+ VideoCodec: () => import_video_frame_pb2.VideoCodec,
68
+ VideoFrame: () => import_video_frame.VideoFrame,
69
+ VideoFrameEvent: () => import_video_stream.VideoFrameEvent,
70
+ VideoRotation: () => import_video_frame_pb2.VideoRotation,
71
+ VideoSource: () => import_video_source.VideoSource,
72
+ VideoStream: () => import_video_stream.VideoStream,
73
+ VideoTrack: () => import_track.VideoTrack,
74
+ combineAudioFrames: () => import_audio_frame.combineAudioFrames,
75
+ dispose: () => import_ffi_client.dispose
76
+ });
77
+ module.exports = __toCommonJS(src_exports);
78
+ var import_protobuf = require("@bufbuild/protobuf");
79
+ var import_room_pb = require("./proto/room_pb.cjs");
80
+ var import_track_pb = require("./proto/track_pb.cjs");
81
+ var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
82
+ var import_room = require("./room.cjs");
83
+ var import_participant = require("./participant.cjs");
84
+ var import_track = require("./track.cjs");
85
+ var import_video_frame = require("./video_frame.cjs");
86
+ var import_audio_frame = require("./audio_frame.cjs");
87
+ var import_audio_stream = require("./audio_stream.cjs");
88
+ var import_audio_resampler = require("./audio_resampler.cjs");
89
+ var import_video_stream = require("./video_stream.cjs");
90
+ var import_audio_source = require("./audio_source.cjs");
91
+ var import_video_source = require("./video_source.cjs");
92
+ var import_track_publication = require("./track_publication.cjs");
93
+ var import_transcription = require("./transcription.cjs");
94
+ var import_e2ee = require("./e2ee.cjs");
95
+ var import_room_pb2 = require("./proto/room_pb.cjs");
96
+ var import_rpc = require("./rpc.cjs");
97
+ var import_e2ee_pb = require("./proto/e2ee_pb.cjs");
98
+ var import_track_pb2 = require("./proto/track_pb.cjs");
99
+ var import_video_frame_pb2 = require("./proto/video_frame_pb.cjs");
100
+ var import_participant_pb = require("./proto/participant_pb.cjs");
101
+ var import_ffi_client = require("./ffi_client.cjs");
102
+ class IceServer {
103
+ constructor(init) {
104
+ this.$typeName = "livekit.proto.IceServer";
105
+ const { urls, username, password } = init;
106
+ this.urls = urls;
107
+ this.username = username ?? "";
108
+ this.password = password ?? "";
109
+ (0, import_protobuf.create)(import_room_pb.IceServerSchema, init);
110
+ }
111
+ }
112
+ class TrackPublishOptions {
113
+ constructor(init = {}) {
114
+ this.$typeName = "livekit.proto.TrackPublishOptions";
115
+ const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
116
+ this.videoCodec = videoCodec ?? import_video_frame_pb.VideoCodec.VP8;
117
+ if (videoEncoding) {
118
+ this.videoEncoding = (0, import_protobuf.create)(import_room_pb.VideoEncodingSchema, videoEncoding);
119
+ }
120
+ if (audioEncoding) {
121
+ this.audioEncoding = (0, import_protobuf.create)(import_room_pb.AudioEncodingSchema, audioEncoding);
122
+ }
123
+ this.dtx = dtx ?? false;
124
+ this.simulcast = simulcast ?? false;
125
+ this.source = source ?? import_track_pb.TrackSource.SOURCE_UNKNOWN;
126
+ this.stream = stream ?? "";
127
+ this.red = red ?? false;
128
+ }
129
+ }
130
+ // Annotate the CommonJS export names for ESM import in node:
131
+ 0 && (module.exports = {
132
+ AudioFrame,
133
+ AudioResampler,
134
+ AudioResamplerQuality,
135
+ AudioSource,
136
+ AudioStream,
137
+ AudioTrack,
138
+ ConnectError,
139
+ ConnectionQuality,
140
+ ConnectionState,
141
+ ContinualGatheringPolicy,
142
+ DataPacketKind,
143
+ E2EEManager,
144
+ E2EEOptions,
145
+ EncryptionState,
146
+ EncryptionType,
147
+ FrameCryptor,
148
+ IceServer,
149
+ IceTransportType,
150
+ KeyProvider,
151
+ KeyProviderOptions,
152
+ LocalAudioTrack,
153
+ LocalParticipant,
154
+ LocalTrack,
155
+ LocalTrackPublication,
156
+ LocalVideoTrack,
157
+ Participant,
158
+ ParticipantKind,
159
+ RemoteAudioTrack,
160
+ RemoteParticipant,
161
+ RemoteTrack,
162
+ RemoteTrackPublication,
163
+ RemoteVideoTrack,
164
+ Room,
165
+ RoomEvent,
166
+ RoomOptions,
167
+ RpcError,
168
+ RtcConfiguration,
169
+ StreamState,
170
+ Track,
171
+ TrackKind,
172
+ TrackPublication,
173
+ TrackPublishOptions,
174
+ TrackSource,
175
+ Transcription,
176
+ TranscriptionSegment,
177
+ VideoBufferType,
178
+ VideoCodec,
179
+ VideoFrame,
180
+ VideoFrameEvent,
181
+ VideoRotation,
182
+ VideoSource,
183
+ VideoStream,
184
+ VideoTrack,
185
+ combineAudioFrames,
186
+ dispose
187
+ });
188
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBAAuB;AAEvB,qBAMO;AACP,sBAA4B;AAC5B,4BAA2B;AAE3B,kBAA6E;AAC7E,yBAAiE;AACjE,mBAUO;AACP,yBAA2B;AAC3B,yBAA+C;AAC/C,0BAA4B;AAC5B,6BAAsD;AACtD,0BAA6C;AAC7C,0BAA4B;AAC5B,0BAA4B;AAC5B,+BAIO;AACP,2BAAoD;AACpD,kBAAwF;AAExF,IAAAA,kBAMO;AACP,iBAAwE;AACxE,qBAAgD;AAChD,IAAAC,mBAAoD;AACpD,IAAAC,yBAA2D;AAC3D,4BAAgC;AAChC,wBAAwB;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,gCAAO,gCAAiB,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,iCAAW;AAC3C,QAAI,eAAe;AACjB,WAAK,oBAAgB,wBAAO,oCAAqB,aAAa;AAAA,IAChE;AACA,QAAI,eAAe;AACjB,WAAK,oBAAgB,wBAAO,oCAAqB,aAAa;AAAA,IAChE;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"]}
package/dist/index.js CHANGED
@@ -1,52 +1,134 @@
1
- import { create } from '@bufbuild/protobuf';
2
- import { AudioEncodingSchema, IceServerSchema, VideoEncodingSchema, } from './proto/room_pb.js';
3
- import { TrackSource } from './proto/track_pb.js';
4
- import { VideoCodec } from './proto/video_frame_pb.js';
5
- export { Room, RoomEvent, ConnectError } from './room.js';
6
- export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
7
- export { Track, LocalAudioTrack, LocalVideoTrack, RemoteAudioTrack, RemoteVideoTrack, } from './track.js';
8
- export { VideoFrame } from './video_frame.js';
9
- export { AudioFrame, combineAudioFrames } from './audio_frame.js';
10
- export { AudioStream } from './audio_stream.js';
11
- export { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';
12
- export { VideoStream } from './video_stream.js';
13
- export { AudioSource } from './audio_source.js';
14
- export { VideoSource } from './video_source.js';
15
- export { TrackPublication, RemoteTrackPublication, LocalTrackPublication, } from './track_publication.js';
16
- export { E2EEManager, KeyProvider, FrameCryptor } from './e2ee.js';
17
- export { ConnectionQuality, IceTransportType, DataPacketKind, ContinualGatheringPolicy, ConnectionState, } from './proto/room_pb.js';
18
- export { RpcError } from './rpc.js';
19
- export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';
20
- export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';
21
- export { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';
22
- export { ParticipantKind } from './proto/participant_pb.js';
23
- export { dispose } from './ffi_client.js';
24
- export class IceServer {
25
- constructor(init) {
26
- this.$typeName = 'livekit.proto.IceServer';
27
- const { urls, username, password } = init;
28
- this.urls = urls;
29
- this.username = username ?? '';
30
- this.password = password ?? '';
31
- create(IceServerSchema, init);
32
- }
1
+ import { create } from "@bufbuild/protobuf";
2
+ import {
3
+ AudioEncodingSchema,
4
+ IceServerSchema,
5
+ VideoEncodingSchema
6
+ } from "./proto/room_pb.js";
7
+ import { TrackSource } from "./proto/track_pb.js";
8
+ import { VideoCodec } from "./proto/video_frame_pb.js";
9
+ import { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from "./room.js";
10
+ import { Participant, RemoteParticipant, LocalParticipant } from "./participant.js";
11
+ import {
12
+ Track,
13
+ LocalTrack,
14
+ RemoteTrack,
15
+ VideoTrack,
16
+ LocalAudioTrack,
17
+ LocalVideoTrack,
18
+ RemoteAudioTrack,
19
+ RemoteVideoTrack,
20
+ AudioTrack
21
+ } from "./track.js";
22
+ import { VideoFrame } from "./video_frame.js";
23
+ import { AudioFrame, combineAudioFrames } from "./audio_frame.js";
24
+ import { AudioStream } from "./audio_stream.js";
25
+ import { AudioResampler, AudioResamplerQuality } from "./audio_resampler.js";
26
+ import { VideoStream, VideoFrameEvent } from "./video_stream.js";
27
+ import { AudioSource } from "./audio_source.js";
28
+ import { VideoSource } from "./video_source.js";
29
+ import {
30
+ TrackPublication,
31
+ RemoteTrackPublication,
32
+ LocalTrackPublication
33
+ } from "./track_publication.js";
34
+ import { Transcription, TranscriptionSegment } from "./transcription.js";
35
+ import { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from "./e2ee.js";
36
+ import {
37
+ ConnectionQuality,
38
+ IceTransportType,
39
+ DataPacketKind,
40
+ ContinualGatheringPolicy,
41
+ ConnectionState
42
+ } from "./proto/room_pb.js";
43
+ import { RpcError } from "./rpc.js";
44
+ import { EncryptionType, EncryptionState } from "./proto/e2ee_pb.js";
45
+ import { StreamState, TrackKind, TrackSource as TrackSource2 } from "./proto/track_pb.js";
46
+ import { VideoBufferType, VideoRotation, VideoCodec as VideoCodec2 } from "./proto/video_frame_pb.js";
47
+ import { ParticipantKind } from "./proto/participant_pb.js";
48
+ import { dispose } from "./ffi_client.js";
49
+ class IceServer {
50
+ constructor(init) {
51
+ this.$typeName = "livekit.proto.IceServer";
52
+ const { urls, username, password } = init;
53
+ this.urls = urls;
54
+ this.username = username ?? "";
55
+ this.password = password ?? "";
56
+ create(IceServerSchema, init);
57
+ }
33
58
  }
34
- export class TrackPublishOptions {
35
- constructor(init = {}) {
36
- this.$typeName = 'livekit.proto.TrackPublishOptions';
37
- const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
38
- this.videoCodec = videoCodec ?? VideoCodec.VP8;
39
- if (videoEncoding) {
40
- this.videoEncoding = create(VideoEncodingSchema, videoEncoding);
41
- }
42
- if (audioEncoding) {
43
- this.audioEncoding = create(AudioEncodingSchema, audioEncoding);
44
- }
45
- this.dtx = dtx ?? false;
46
- this.simulcast = simulcast ?? false;
47
- this.source = source ?? TrackSource.SOURCE_UNKNOWN;
48
- this.stream = stream ?? '';
49
- this.red = red ?? false;
59
+ class TrackPublishOptions {
60
+ constructor(init = {}) {
61
+ this.$typeName = "livekit.proto.TrackPublishOptions";
62
+ const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
63
+ this.videoCodec = videoCodec ?? VideoCodec.VP8;
64
+ if (videoEncoding) {
65
+ this.videoEncoding = create(VideoEncodingSchema, videoEncoding);
66
+ }
67
+ if (audioEncoding) {
68
+ this.audioEncoding = create(AudioEncodingSchema, audioEncoding);
50
69
  }
70
+ this.dtx = dtx ?? false;
71
+ this.simulcast = simulcast ?? false;
72
+ this.source = source ?? TrackSource.SOURCE_UNKNOWN;
73
+ this.stream = stream ?? "";
74
+ this.red = red ?? false;
75
+ }
51
76
  }
77
+ export {
78
+ AudioFrame,
79
+ AudioResampler,
80
+ AudioResamplerQuality,
81
+ AudioSource,
82
+ AudioStream,
83
+ AudioTrack,
84
+ ConnectError,
85
+ ConnectionQuality,
86
+ ConnectionState,
87
+ ContinualGatheringPolicy,
88
+ DataPacketKind,
89
+ E2EEManager,
90
+ E2EEOptions,
91
+ EncryptionState,
92
+ EncryptionType,
93
+ FrameCryptor,
94
+ IceServer,
95
+ IceTransportType,
96
+ KeyProvider,
97
+ KeyProviderOptions,
98
+ LocalAudioTrack,
99
+ LocalParticipant,
100
+ LocalTrack,
101
+ LocalTrackPublication,
102
+ LocalVideoTrack,
103
+ Participant,
104
+ ParticipantKind,
105
+ RemoteAudioTrack,
106
+ RemoteParticipant,
107
+ RemoteTrack,
108
+ RemoteTrackPublication,
109
+ RemoteVideoTrack,
110
+ Room,
111
+ RoomEvent,
112
+ RoomOptions,
113
+ RpcError,
114
+ RtcConfiguration,
115
+ StreamState,
116
+ Track,
117
+ TrackKind,
118
+ TrackPublication,
119
+ TrackPublishOptions,
120
+ TrackSource2 as TrackSource,
121
+ Transcription,
122
+ TranscriptionSegment,
123
+ VideoBufferType,
124
+ VideoCodec2 as VideoCodec,
125
+ VideoFrame,
126
+ VideoFrameEvent,
127
+ VideoRotation,
128
+ VideoSource,
129
+ VideoStream,
130
+ VideoTrack,
131
+ combineAudioFrames,
132
+ dispose
133
+ };
52
134
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,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M,GAAG,MAAM,IAAI,WAAW,CAAC,cAAc,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,KAAK,CAAC;IAC1B,CAAC;CACF"}
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;A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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"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var native_d_exports = {};
16
+ module.exports = __toCommonJS(native_d_exports);
17
+ //# sourceMappingURL=native.d.cjs.map
@@ -0,0 +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":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=native.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -3,15 +3,15 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export declare function livekitInitialize(
6
+ export function livekitInitialize(
7
7
  callback: (data: Uint8Array) => void,
8
8
  captureLogs: boolean,
9
9
  sdkVersion: string,
10
10
  ): 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>;
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>;
15
15
  export declare class FfiHandle {
16
16
  constructor(handle: bigint);
17
17
  dispose(): void;