@livekit/rtc-node 0.12.2 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio_frame.cjs +2 -2
- package/dist/audio_frame.cjs.map +1 -1
- package/dist/audio_frame.d.cts +2 -3
- package/dist/audio_frame.d.ts +2 -3
- package/dist/audio_frame.d.ts.map +1 -1
- package/dist/audio_frame.js +3 -3
- package/dist/audio_frame.js.map +1 -1
- package/dist/audio_resampler.cjs +10 -7
- package/dist/audio_resampler.cjs.map +1 -1
- package/dist/audio_resampler.d.cts +2 -3
- package/dist/audio_resampler.d.ts +2 -3
- package/dist/audio_resampler.d.ts.map +1 -1
- package/dist/audio_resampler.js +13 -10
- package/dist/audio_resampler.js.map +1 -1
- package/dist/audio_source.cjs +6 -4
- package/dist/audio_source.cjs.map +1 -1
- package/dist/audio_source.d.cts +3 -3
- package/dist/audio_source.d.ts +3 -3
- package/dist/audio_source.d.ts.map +1 -1
- package/dist/audio_source.js +9 -7
- package/dist/audio_source.js.map +1 -1
- package/dist/audio_stream.cjs +1 -2
- package/dist/audio_stream.cjs.map +1 -1
- package/dist/audio_stream.d.cts +2 -3
- package/dist/audio_stream.d.ts +2 -3
- package/dist/audio_stream.d.ts.map +1 -1
- package/dist/audio_stream.js +2 -3
- package/dist/audio_stream.js.map +1 -1
- package/dist/e2ee.cjs +19 -20
- package/dist/e2ee.cjs.map +1 -1
- package/dist/e2ee.d.cts +5 -6
- package/dist/e2ee.d.ts +5 -6
- package/dist/e2ee.d.ts.map +1 -1
- package/dist/e2ee.js +29 -30
- package/dist/e2ee.js.map +1 -1
- package/dist/ffi_client.cjs +6 -5
- package/dist/ffi_client.cjs.map +1 -1
- package/dist/ffi_client.d.cts +10 -10
- package/dist/ffi_client.d.ts +10 -10
- package/dist/ffi_client.d.ts.map +1 -1
- package/dist/ffi_client.js +6 -10
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.cjs +16 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -35
- package/dist/index.d.ts +6 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -46
- package/dist/index.js.map +1 -1
- package/dist/napi/native.d.cjs.map +1 -1
- package/dist/napi/native.d.ts +5 -5
- package/dist/native.d.ts +5 -5
- package/dist/participant.cjs +60 -36
- package/dist/participant.cjs.map +1 -1
- package/dist/participant.d.cts +11 -11
- package/dist/participant.d.ts +11 -11
- package/dist/participant.d.ts.map +1 -1
- package/dist/participant.js +78 -52
- package/dist/participant.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs +977 -125
- package/dist/proto/audio_frame_pb.cjs.map +1 -1
- package/dist/proto/audio_frame_pb.d.cts +502 -417
- package/dist/proto/audio_frame_pb.d.ts +502 -417
- package/dist/proto/audio_frame_pb.d.ts.map +1 -1
- package/dist/proto/audio_frame_pb.js +943 -85
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.cjs +700 -85
- package/dist/proto/e2ee_pb.cjs.map +1 -1
- package/dist/proto/e2ee_pb.d.cts +331 -263
- package/dist/proto/e2ee_pb.d.ts +331 -263
- package/dist/proto/e2ee_pb.d.ts.map +1 -1
- package/dist/proto/e2ee_pb.js +675 -57
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs +369 -36
- package/dist/proto/ffi_pb.cjs.map +1 -1
- package/dist/proto/ffi_pb.d.cts +156 -109
- package/dist/proto/ffi_pb.d.ts +156 -109
- package/dist/proto/ffi_pb.d.ts.map +1 -1
- package/dist/proto/ffi_pb.js +364 -29
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.cjs +27 -7
- package/dist/proto/handle_pb.cjs.map +1 -1
- package/dist/proto/handle_pb.d.cts +13 -15
- package/dist/proto/handle_pb.d.ts +13 -15
- package/dist/proto/handle_pb.d.ts.map +1 -1
- package/dist/proto/handle_pb.js +26 -5
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.cjs +112 -15
- package/dist/proto/participant_pb.cjs.map +1 -1
- package/dist/proto/participant_pb.d.cts +140 -52
- package/dist/proto/participant_pb.d.ts +140 -52
- package/dist/proto/participant_pb.d.ts.map +1 -1
- package/dist/proto/participant_pb.js +109 -11
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.cjs +2693 -302
- package/dist/proto/room_pb.cjs.map +1 -1
- package/dist/proto/room_pb.d.cts +1265 -862
- package/dist/proto/room_pb.d.ts +1265 -862
- package/dist/proto/room_pb.d.ts.map +1 -1
- package/dist/proto/room_pb.js +2603 -210
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/rpc_pb.cjs +302 -37
- package/dist/proto/rpc_pb.cjs.map +1 -1
- package/dist/proto/rpc_pb.d.cts +138 -108
- package/dist/proto/rpc_pb.d.ts +138 -108
- package/dist/proto/rpc_pb.d.ts.map +1 -1
- package/dist/proto/rpc_pb.js +291 -25
- package/dist/proto/rpc_pb.js.map +1 -1
- package/dist/proto/stats_pb.cjs +1253 -139
- package/dist/proto/stats_pb.cjs.map +1 -1
- package/dist/proto/stats_pb.d.cts +803 -692
- package/dist/proto/stats_pb.d.ts +803 -692
- package/dist/proto/stats_pb.d.ts.map +1 -1
- package/dist/proto/stats_pb.js +1216 -93
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.cjs +462 -64
- package/dist/proto/track_pb.cjs.map +1 -1
- package/dist/proto/track_pb.d.cts +250 -218
- package/dist/proto/track_pb.d.ts +250 -218
- package/dist/proto/track_pb.d.ts.map +1 -1
- package/dist/proto/track_pb.js +447 -45
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/track_publication_pb.cjs +130 -0
- package/dist/proto/track_publication_pb.cjs.map +1 -0
- package/dist/proto/track_publication_pb.d.cts +80 -0
- package/dist/proto/track_publication_pb.d.ts +80 -0
- package/dist/proto/track_publication_pb.d.ts.map +1 -0
- package/dist/proto/track_publication_pb.js +103 -0
- package/dist/proto/track_publication_pb.js.map +1 -0
- package/dist/proto/video_frame_pb.cjs +648 -88
- package/dist/proto/video_frame_pb.cjs.map +1 -1
- package/dist/proto/video_frame_pb.d.cts +371 -328
- package/dist/proto/video_frame_pb.d.ts +371 -328
- package/dist/proto/video_frame_pb.d.ts.map +1 -1
- package/dist/proto/video_frame_pb.js +626 -60
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.cjs +85 -125
- package/dist/room.cjs.map +1 -1
- package/dist/room.d.cts +6 -17
- package/dist/room.d.ts +6 -17
- package/dist/room.d.ts.map +1 -1
- package/dist/room.js +85 -123
- package/dist/room.js.map +1 -1
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +0 -1
- package/dist/rpc.d.ts +0 -1
- package/dist/rpc.js.map +1 -1
- package/dist/track.cjs +12 -8
- package/dist/track.cjs.map +1 -1
- package/dist/track.d.cts +8 -9
- package/dist/track.d.ts +8 -9
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +13 -9
- package/dist/track.js.map +1 -1
- package/dist/track_publication.cjs +21 -12
- package/dist/track_publication.cjs.map +1 -1
- package/dist/track_publication.d.cts +12 -13
- package/dist/track_publication.d.ts +12 -13
- package/dist/track_publication.d.ts.map +1 -1
- package/dist/track_publication.js +22 -13
- package/dist/track_publication.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.cjs +26 -45
- package/dist/video_frame.cjs.map +1 -1
- package/dist/video_frame.d.cts +2 -3
- package/dist/video_frame.d.ts +2 -3
- package/dist/video_frame.d.ts.map +1 -1
- package/dist/video_frame.js +29 -48
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.cjs +7 -4
- package/dist/video_source.cjs.map +1 -1
- package/dist/video_source.d.cts +4 -4
- package/dist/video_source.d.ts +4 -4
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +9 -6
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.cjs +16 -5
- package/dist/video_stream.cjs.map +1 -1
- package/dist/video_stream.d.cts +3 -4
- package/dist/video_stream.d.ts +3 -4
- package/dist/video_stream.d.ts.map +1 -1
- package/dist/video_stream.js +17 -6
- package/dist/video_stream.js.map +1 -1
- package/package.json +9 -9
- package/src/audio_frame.ts +10 -10
- package/src/audio_resampler.ts +15 -13
- package/src/audio_source.ts +11 -8
- package/src/audio_stream.ts +3 -4
- package/src/e2ee.ts +41 -42
- package/src/ffi_client.ts +8 -16
- package/src/index.ts +5 -68
- package/src/napi/native.d.ts +5 -5
- package/src/participant.ts +102 -73
- package/src/proto/audio_frame_pb.ts +1220 -496
- package/src/proto/e2ee_pb.ts +858 -337
- package/src/proto/ffi_pb.ts +442 -135
- package/src/proto/handle_pb.ts +33 -19
- package/src/proto/participant_pb.ts +225 -60
- package/src/proto/room_pb.ts +3149 -1013
- package/src/proto/rpc_pb.ts +358 -129
- package/src/proto/stats_pb.ts +1891 -877
- package/src/proto/track_pb.ts +587 -253
- package/src/proto/track_publication_pb.ts +180 -0
- package/src/proto/video_frame_pb.ts +861 -394
- package/src/room.ts +137 -189
- package/src/rpc.ts +1 -1
- package/src/track.ts +16 -17
- package/src/track_publication.ts +25 -26
- package/src/version.ts +1 -1
- package/src/video_frame.ts +48 -72
- package/src/video_source.ts +11 -8
- package/src/video_stream.ts +18 -8
package/dist/ffi_client.cjs
CHANGED
|
@@ -31,10 +31,10 @@ __export(ffi_client_exports, {
|
|
|
31
31
|
FfiClient: () => FfiClient,
|
|
32
32
|
FfiClientEvent: () => FfiClientEvent,
|
|
33
33
|
FfiHandle: () => import_native.FfiHandle,
|
|
34
|
+
FfiRequest: () => import_ffi_pb.FfiRequest,
|
|
34
35
|
dispose: () => import_native.livekitDispose
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(ffi_client_exports);
|
|
37
|
-
var import_protobuf = require("@bufbuild/protobuf");
|
|
38
38
|
var import_events = __toESM(require("events"), 1);
|
|
39
39
|
var import_native = require("./napi/native.cjs");
|
|
40
40
|
var import_ffi_pb = require("./proto/ffi_pb.cjs");
|
|
@@ -54,7 +54,7 @@ class FfiClient extends import_events.default {
|
|
|
54
54
|
this.setMaxListeners(0);
|
|
55
55
|
(0, import_native.livekitInitialize)(
|
|
56
56
|
(event_data) => {
|
|
57
|
-
const event =
|
|
57
|
+
const event = import_ffi_pb.FfiEvent.fromBinary(event_data);
|
|
58
58
|
this.emit("ffi_event" /* FfiEvent */, event);
|
|
59
59
|
},
|
|
60
60
|
true,
|
|
@@ -62,10 +62,10 @@ class FfiClient extends import_events.default {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
request(req) {
|
|
65
|
-
const request =
|
|
66
|
-
const req_data =
|
|
65
|
+
const request = new import_ffi_pb.FfiRequest(req);
|
|
66
|
+
const req_data = request.toBinary();
|
|
67
67
|
const res_data = (0, import_native.livekitFfiRequest)(req_data);
|
|
68
|
-
return
|
|
68
|
+
return import_ffi_pb.FfiResponse.fromBinary(res_data).message.value;
|
|
69
69
|
}
|
|
70
70
|
copyBuffer(ptr, len) {
|
|
71
71
|
return (0, import_native.livekitCopyBuffer)(ptr, len);
|
|
@@ -90,6 +90,7 @@ class FfiClient extends import_events.default {
|
|
|
90
90
|
FfiClient,
|
|
91
91
|
FfiClientEvent,
|
|
92
92
|
FfiHandle,
|
|
93
|
+
FfiRequest,
|
|
93
94
|
dispose
|
|
94
95
|
});
|
|
95
96
|
//# sourceMappingURL=ffi_client.cjs.map
|
package/dist/ffi_client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { PartialMessage } 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 { FfiEvent, FfiRequest, FfiResponse } from './proto/ffi_pb.js';\nimport { SDK_VERSION } from './version.js';\n\nexport { FfiHandle, type FfiEvent, type 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 = FfiEvent.fromBinary(event_data);\n this.emit(FfiClientEvent.FfiEvent, event);\n },\n true,\n SDK_VERSION,\n );\n }\n\n request<T>(req: PartialMessage<FfiRequest>): T {\n const request = new FfiRequest(req);\n const req_data = request.toBinary();\n const res_data = livekitFfiRequest(req_data);\n return FfiResponse.fromBinary(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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAyB;AACzB,oBAOO;AACP,oBAAkD;AAClD,qBAA4B;AAQrB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,cAAW;AADD,SAAAA;AAAA,GAAA;AAIL,MAAM,kBAAmB,cAAAC,QAA4D;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,uBAAS,WAAW,UAAU;AAC5C,aAAK,KAAK,4BAAyB,KAAK;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAW,KAAoC;AAC7C,UAAM,UAAU,IAAI,yBAAW,GAAG;AAClC,UAAM,WAAW,QAAQ,SAAS;AAClC,UAAM,eAAW,iCAAkB,QAAQ;AAC3C,WAAO,0BAAY,WAAW,QAAQ,EAAE,QAAQ;AAAA,EAClD;AAAA,EAEA,WAAW,KAAa,KAAyB;AAC/C,eAAO,iCAAkB,KAAK,GAAG;AAAA,EACnC;AAAA,EAEA,YAAY,MAA0B;AACpC,eAAO,kCAAmB,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","EventEmitter"]}
|
package/dist/ffi_client.d.cts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PartialMessage } from '@bufbuild/protobuf';
|
|
2
2
|
import { TypedEventEmitter } from '@livekit/typed-emitter';
|
|
3
3
|
export { FfiHandle, livekitDispose as dispose } from './napi/native.d.cjs';
|
|
4
|
-
import { FfiEvent,
|
|
5
|
-
export {
|
|
6
|
-
import '@bufbuild/protobuf/codegenv1';
|
|
7
|
-
import './proto/e2ee_pb.cjs';
|
|
8
|
-
import './proto/track_pb.cjs';
|
|
9
|
-
import './proto/handle_pb.cjs';
|
|
10
|
-
import './proto/stats_pb.cjs';
|
|
4
|
+
import { FfiEvent, FfiRequest } from './proto/ffi_pb.cjs';
|
|
5
|
+
export { FfiResponse } from './proto/ffi_pb.cjs';
|
|
11
6
|
import './proto/room_pb.cjs';
|
|
12
7
|
import './proto/participant_pb.cjs';
|
|
8
|
+
import './proto/handle_pb.cjs';
|
|
9
|
+
import './proto/track_pb.cjs';
|
|
10
|
+
import './proto/stats_pb.cjs';
|
|
11
|
+
import './proto/e2ee_pb.cjs';
|
|
13
12
|
import './proto/video_frame_pb.cjs';
|
|
14
13
|
import './proto/audio_frame_pb.cjs';
|
|
15
14
|
import './proto/rpc_pb.cjs';
|
|
15
|
+
import './proto/track_publication_pb.cjs';
|
|
16
16
|
|
|
17
17
|
type FfiClientCallbacks = {
|
|
18
18
|
ffi_event: (event: FfiEvent) => void;
|
|
@@ -26,10 +26,10 @@ declare class FfiClient extends FfiClient_base {
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
static get instance(): FfiClient;
|
|
28
28
|
constructor();
|
|
29
|
-
request<T>(req:
|
|
29
|
+
request<T>(req: PartialMessage<FfiRequest>): T;
|
|
30
30
|
copyBuffer(ptr: bigint, len: number): Uint8Array;
|
|
31
31
|
retrievePtr(data: Uint8Array): bigint;
|
|
32
32
|
waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T>;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent };
|
|
35
|
+
export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent, FfiRequest };
|
package/dist/ffi_client.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PartialMessage } from '@bufbuild/protobuf';
|
|
2
2
|
import { TypedEventEmitter } from '@livekit/typed-emitter';
|
|
3
3
|
export { FfiHandle, livekitDispose as dispose } from './napi/native.d.js';
|
|
4
|
-
import { FfiEvent,
|
|
5
|
-
export {
|
|
6
|
-
import '@bufbuild/protobuf/codegenv1';
|
|
7
|
-
import './proto/e2ee_pb.js';
|
|
8
|
-
import './proto/track_pb.js';
|
|
9
|
-
import './proto/handle_pb.js';
|
|
10
|
-
import './proto/stats_pb.js';
|
|
4
|
+
import { FfiEvent, FfiRequest } from './proto/ffi_pb.js';
|
|
5
|
+
export { FfiResponse } from './proto/ffi_pb.js';
|
|
11
6
|
import './proto/room_pb.js';
|
|
12
7
|
import './proto/participant_pb.js';
|
|
8
|
+
import './proto/handle_pb.js';
|
|
9
|
+
import './proto/track_pb.js';
|
|
10
|
+
import './proto/stats_pb.js';
|
|
11
|
+
import './proto/e2ee_pb.js';
|
|
13
12
|
import './proto/video_frame_pb.js';
|
|
14
13
|
import './proto/audio_frame_pb.js';
|
|
15
14
|
import './proto/rpc_pb.js';
|
|
15
|
+
import './proto/track_publication_pb.js';
|
|
16
16
|
|
|
17
17
|
type FfiClientCallbacks = {
|
|
18
18
|
ffi_event: (event: FfiEvent) => void;
|
|
@@ -26,10 +26,10 @@ declare class FfiClient extends FfiClient_base {
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
static get instance(): FfiClient;
|
|
28
28
|
constructor();
|
|
29
|
-
request<T>(req:
|
|
29
|
+
request<T>(req: PartialMessage<FfiRequest>): T;
|
|
30
30
|
copyBuffer(ptr: bigint, len: number): Uint8Array;
|
|
31
31
|
retrievePtr(data: Uint8Array): bigint;
|
|
32
32
|
waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T>;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent };
|
|
35
|
+
export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent, FfiRequest };
|
package/dist/ffi_client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffi_client.d.ts","sourceRoot":"","sources":["../src/ffi_client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ffi_client.d.ts","sourceRoot":"","sources":["../src/ffi_client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACL,SAAS,EAET,cAAc,EAIf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,UAAU,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC;AAE7F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,oBAAY,cAAc;IACxB,QAAQ,cAAc;CACvB;8BAE+C,UAAU,YAAY,CAAC,kBAAkB,CAAC;AAA1F,qBAAa,SAAU,SAAQ,cAA4D;IACzF,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAE3B,gBAAgB;IAChB,MAAM,KAAK,QAAQ,IAAI,SAAS,CAI/B;;IAgBD,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC;IAO9C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU;IAIhD,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAI/B,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;CAWnE"}
|
package/dist/ffi_client.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
2
1
|
import EventEmitter from "events";
|
|
3
2
|
import {
|
|
4
3
|
FfiHandle,
|
|
@@ -8,11 +7,7 @@ import {
|
|
|
8
7
|
livekitInitialize,
|
|
9
8
|
livekitRetrievePtr
|
|
10
9
|
} from "./napi/native.js";
|
|
11
|
-
import {
|
|
12
|
-
FfiEventSchema,
|
|
13
|
-
FfiRequestSchema,
|
|
14
|
-
FfiResponseSchema
|
|
15
|
-
} from "./proto/ffi_pb.js";
|
|
10
|
+
import { FfiEvent, FfiRequest, FfiResponse } from "./proto/ffi_pb.js";
|
|
16
11
|
import { SDK_VERSION } from "./version.js";
|
|
17
12
|
var FfiClientEvent = /* @__PURE__ */ ((FfiClientEvent2) => {
|
|
18
13
|
FfiClientEvent2["FfiEvent"] = "ffi_event";
|
|
@@ -29,7 +24,7 @@ class FfiClient extends EventEmitter {
|
|
|
29
24
|
this.setMaxListeners(0);
|
|
30
25
|
livekitInitialize(
|
|
31
26
|
(event_data) => {
|
|
32
|
-
const event = fromBinary(
|
|
27
|
+
const event = FfiEvent.fromBinary(event_data);
|
|
33
28
|
this.emit("ffi_event" /* FfiEvent */, event);
|
|
34
29
|
},
|
|
35
30
|
true,
|
|
@@ -37,10 +32,10 @@ class FfiClient extends EventEmitter {
|
|
|
37
32
|
);
|
|
38
33
|
}
|
|
39
34
|
request(req) {
|
|
40
|
-
const request =
|
|
41
|
-
const req_data = toBinary(
|
|
35
|
+
const request = new FfiRequest(req);
|
|
36
|
+
const req_data = request.toBinary();
|
|
42
37
|
const res_data = livekitFfiRequest(req_data);
|
|
43
|
-
return fromBinary(
|
|
38
|
+
return FfiResponse.fromBinary(res_data).message.value;
|
|
44
39
|
}
|
|
45
40
|
copyBuffer(ptr, len) {
|
|
46
41
|
return livekitCopyBuffer(ptr, len);
|
|
@@ -64,6 +59,7 @@ export {
|
|
|
64
59
|
FfiClient,
|
|
65
60
|
FfiClientEvent,
|
|
66
61
|
FfiHandle,
|
|
62
|
+
FfiRequest,
|
|
67
63
|
livekitDispose as dispose
|
|
68
64
|
};
|
|
69
65
|
//# sourceMappingURL=ffi_client.js.map
|
package/dist/ffi_client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { PartialMessage } 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 { FfiEvent, FfiRequest, FfiResponse } from './proto/ffi_pb.js';\nimport { SDK_VERSION } from './version.js';\n\nexport { FfiHandle, type FfiEvent, type 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 = FfiEvent.fromBinary(event_data);\n this.emit(FfiClientEvent.FfiEvent, event);\n },\n true,\n SDK_VERSION,\n );\n }\n\n request<T>(req: PartialMessage<FfiRequest>): T {\n const request = new FfiRequest(req);\n const req_data = request.toBinary();\n const res_data = livekitFfiRequest(req_data);\n return FfiResponse.fromBinary(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":"AAKA,OAAO,kBAAkB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,YAAY,mBAAmB;AAClD,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,SAAS,WAAW,UAAU;AAC5C,aAAK,KAAK,4BAAyB,KAAK;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAW,KAAoC;AAC7C,UAAM,UAAU,IAAI,WAAW,GAAG;AAClC,UAAM,WAAW,QAAQ,SAAS;AAClC,UAAM,WAAW,kBAAkB,QAAQ;AAC3C,WAAO,YAAY,WAAW,QAAQ,EAAE,QAAQ;AAAA,EAClD;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
CHANGED
|
@@ -24,16 +24,16 @@ __export(src_exports, {
|
|
|
24
24
|
AudioSource: () => import_audio_source.AudioSource,
|
|
25
25
|
AudioStream: () => import_audio_stream.AudioStream,
|
|
26
26
|
ConnectError: () => import_room.ConnectError,
|
|
27
|
-
ConnectionQuality: () =>
|
|
28
|
-
ConnectionState: () =>
|
|
29
|
-
ContinualGatheringPolicy: () =>
|
|
30
|
-
DataPacketKind: () =>
|
|
27
|
+
ConnectionQuality: () => import_room_pb.ConnectionQuality,
|
|
28
|
+
ConnectionState: () => import_room_pb.ConnectionState,
|
|
29
|
+
ContinualGatheringPolicy: () => import_room_pb.ContinualGatheringPolicy,
|
|
30
|
+
DataPacketKind: () => import_room_pb.DataPacketKind,
|
|
31
31
|
E2EEManager: () => import_e2ee.E2EEManager,
|
|
32
32
|
EncryptionState: () => import_e2ee_pb.EncryptionState,
|
|
33
33
|
EncryptionType: () => import_e2ee_pb.EncryptionType,
|
|
34
34
|
FrameCryptor: () => import_e2ee.FrameCryptor,
|
|
35
|
-
IceServer: () => IceServer,
|
|
36
|
-
IceTransportType: () =>
|
|
35
|
+
IceServer: () => import_room_pb.IceServer,
|
|
36
|
+
IceTransportType: () => import_room_pb.IceTransportType,
|
|
37
37
|
KeyProvider: () => import_e2ee.KeyProvider,
|
|
38
38
|
LocalAudioTrack: () => import_track.LocalAudioTrack,
|
|
39
39
|
LocalParticipant: () => import_participant.LocalParticipant,
|
|
@@ -48,26 +48,22 @@ __export(src_exports, {
|
|
|
48
48
|
Room: () => import_room.Room,
|
|
49
49
|
RoomEvent: () => import_room.RoomEvent,
|
|
50
50
|
RpcError: () => import_rpc.RpcError,
|
|
51
|
-
StreamState: () =>
|
|
51
|
+
StreamState: () => import_track_pb.StreamState,
|
|
52
52
|
Track: () => import_track.Track,
|
|
53
|
-
TrackKind: () =>
|
|
53
|
+
TrackKind: () => import_track_pb.TrackKind,
|
|
54
54
|
TrackPublication: () => import_track_publication.TrackPublication,
|
|
55
|
-
TrackPublishOptions: () => TrackPublishOptions,
|
|
56
|
-
TrackSource: () =>
|
|
57
|
-
VideoBufferType: () =>
|
|
58
|
-
VideoCodec: () =>
|
|
55
|
+
TrackPublishOptions: () => import_room_pb.TrackPublishOptions,
|
|
56
|
+
TrackSource: () => import_track_pb.TrackSource,
|
|
57
|
+
VideoBufferType: () => import_video_frame_pb.VideoBufferType,
|
|
58
|
+
VideoCodec: () => import_video_frame_pb.VideoCodec,
|
|
59
59
|
VideoFrame: () => import_video_frame.VideoFrame,
|
|
60
|
-
VideoRotation: () =>
|
|
60
|
+
VideoRotation: () => import_video_frame_pb.VideoRotation,
|
|
61
61
|
VideoSource: () => import_video_source.VideoSource,
|
|
62
62
|
VideoStream: () => import_video_stream.VideoStream,
|
|
63
63
|
combineAudioFrames: () => import_audio_frame.combineAudioFrames,
|
|
64
64
|
dispose: () => import_ffi_client.dispose
|
|
65
65
|
});
|
|
66
66
|
module.exports = __toCommonJS(src_exports);
|
|
67
|
-
var import_protobuf = require("@bufbuild/protobuf");
|
|
68
|
-
var import_room_pb = require("./proto/room_pb.cjs");
|
|
69
|
-
var import_track_pb = require("./proto/track_pb.cjs");
|
|
70
|
-
var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
|
|
71
67
|
var import_room = require("./room.cjs");
|
|
72
68
|
var import_participant = require("./participant.cjs");
|
|
73
69
|
var import_track = require("./track.cjs");
|
|
@@ -79,43 +75,14 @@ var import_video_stream = require("./video_stream.cjs");
|
|
|
79
75
|
var import_audio_source = require("./audio_source.cjs");
|
|
80
76
|
var import_video_source = require("./video_source.cjs");
|
|
81
77
|
var import_track_publication = require("./track_publication.cjs");
|
|
82
|
-
var import_transcription = require("./transcription.cjs");
|
|
83
78
|
var import_e2ee = require("./e2ee.cjs");
|
|
84
|
-
var
|
|
79
|
+
var import_room_pb = require("./proto/room_pb.cjs");
|
|
85
80
|
var import_rpc = require("./rpc.cjs");
|
|
86
81
|
var import_e2ee_pb = require("./proto/e2ee_pb.cjs");
|
|
87
|
-
var
|
|
88
|
-
var
|
|
82
|
+
var import_track_pb = require("./proto/track_pb.cjs");
|
|
83
|
+
var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
|
|
89
84
|
var import_participant_pb = require("./proto/participant_pb.cjs");
|
|
90
85
|
var import_ffi_client = require("./ffi_client.cjs");
|
|
91
|
-
class IceServer {
|
|
92
|
-
constructor(init) {
|
|
93
|
-
this.$typeName = "livekit.proto.IceServer";
|
|
94
|
-
const { urls, username, password } = init;
|
|
95
|
-
this.urls = urls;
|
|
96
|
-
this.username = username ?? "";
|
|
97
|
-
this.password = password ?? "";
|
|
98
|
-
(0, import_protobuf.create)(import_room_pb.IceServerSchema, init);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
class TrackPublishOptions {
|
|
102
|
-
constructor(init = {}) {
|
|
103
|
-
this.$typeName = "livekit.proto.TrackPublishOptions";
|
|
104
|
-
const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
|
|
105
|
-
this.videoCodec = videoCodec ?? import_video_frame_pb.VideoCodec.VP8;
|
|
106
|
-
if (videoEncoding) {
|
|
107
|
-
this.videoEncoding = (0, import_protobuf.create)(import_room_pb.VideoEncodingSchema, videoEncoding);
|
|
108
|
-
}
|
|
109
|
-
if (audioEncoding) {
|
|
110
|
-
this.audioEncoding = (0, import_protobuf.create)(import_room_pb.AudioEncodingSchema, audioEncoding);
|
|
111
|
-
}
|
|
112
|
-
this.dtx = dtx ?? false;
|
|
113
|
-
this.simulcast = simulcast ?? false;
|
|
114
|
-
this.source = source ?? import_track_pb.TrackSource.SOURCE_UNKNOWN;
|
|
115
|
-
this.stream = stream ?? "";
|
|
116
|
-
this.red = red ?? false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
86
|
// Annotate the CommonJS export names for ESM import in node:
|
|
120
87
|
0 && (module.exports = {
|
|
121
88
|
AudioFrame,
|
package/dist/index.cjs.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\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\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, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, KeyProvider, FrameCryptor } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport {\n ConnectionQuality,\n IceServer,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n TrackPublishOptions,\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"],"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;AAIA,kBAAuF;AACvF,yBAAiE;AACjE,mBAUO;AACP,yBAA2B;AAC3B,yBAA+C;AAC/C,0BAA4B;AAC5B,6BAAsD;AACtD,0BAAkD;AAClD,0BAA4B;AAC5B,0BAA4B;AAC5B,+BAIO;AAEP,kBAAuD;AAEvD,qBAQO;AACP,iBAAwE;AACxE,qBAAgD;AAChD,sBAAoD;AACpD,4BAA2D;AAC3D,4BAAgC;AAChC,wBAAwB;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.cjs';
|
|
9
2
|
export { LocalParticipant, Participant, RemoteParticipant } from './participant.cjs';
|
|
10
3
|
export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.cjs';
|
|
@@ -18,40 +11,18 @@ export { VideoSource } from './video_source.cjs';
|
|
|
18
11
|
export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.cjs';
|
|
19
12
|
export { Transcription, TranscriptionSegment } from './transcription.cjs';
|
|
20
13
|
export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.cjs';
|
|
14
|
+
export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceServer, IceTransportType, TrackPublishOptions } from './proto/room_pb.cjs';
|
|
21
15
|
export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.cjs';
|
|
22
16
|
export { EncryptionState, EncryptionType } from './proto/e2ee_pb.cjs';
|
|
17
|
+
export { StreamState, TrackKind, TrackSource } from './proto/track_pb.cjs';
|
|
18
|
+
export { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.cjs';
|
|
23
19
|
export { ParticipantKind } from './proto/participant_pb.cjs';
|
|
24
20
|
export { livekitDispose as dispose } from './napi/native.d.cjs';
|
|
25
21
|
export { ChatMessage } from './types.cjs';
|
|
26
|
-
import '@bufbuild/protobuf/codegenv1';
|
|
27
|
-
import './proto/handle_pb.cjs';
|
|
28
|
-
import './proto/stats_pb.cjs';
|
|
29
22
|
import '@livekit/typed-emitter';
|
|
30
23
|
import './proto/audio_frame_pb.cjs';
|
|
24
|
+
import '@bufbuild/protobuf';
|
|
25
|
+
import './proto/handle_pb.cjs';
|
|
31
26
|
import '@livekit/mutex';
|
|
27
|
+
import './proto/stats_pb.cjs';
|
|
32
28
|
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,10 +1,3 @@
|
|
|
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
|
-
import { TrackSource } from './proto/track_pb.js';
|
|
5
|
-
export { StreamState, TrackKind } from './proto/track_pb.js';
|
|
6
|
-
import { VideoCodec } from './proto/video_frame_pb.js';
|
|
7
|
-
export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js';
|
|
8
1
|
export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.js';
|
|
9
2
|
export { LocalParticipant, Participant, RemoteParticipant } from './participant.js';
|
|
10
3
|
export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.js';
|
|
@@ -18,40 +11,18 @@ export { VideoSource } from './video_source.js';
|
|
|
18
11
|
export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.js';
|
|
19
12
|
export { Transcription, TranscriptionSegment } from './transcription.js';
|
|
20
13
|
export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.js';
|
|
14
|
+
export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceServer, IceTransportType, TrackPublishOptions } from './proto/room_pb.js';
|
|
21
15
|
export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.js';
|
|
22
16
|
export { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';
|
|
17
|
+
export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';
|
|
18
|
+
export { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.js';
|
|
23
19
|
export { ParticipantKind } from './proto/participant_pb.js';
|
|
24
20
|
export { livekitDispose as dispose } from './napi/native.d.js';
|
|
25
21
|
export { ChatMessage } from './types.js';
|
|
26
|
-
import '@bufbuild/protobuf/codegenv1';
|
|
27
|
-
import './proto/handle_pb.js';
|
|
28
|
-
import './proto/stats_pb.js';
|
|
29
22
|
import '@livekit/typed-emitter';
|
|
30
23
|
import './proto/audio_frame_pb.js';
|
|
24
|
+
import '@bufbuild/protobuf';
|
|
25
|
+
import './proto/handle_pb.js';
|
|
31
26
|
import '@livekit/mutex';
|
|
27
|
+
import './proto/stats_pb.js';
|
|
32
28
|
import './proto/rpc_pb.js';
|
|
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,KAAK,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
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
1
|
import { Room, RoomEvent, ConnectError } from "./room.js";
|
|
10
2
|
import { Participant, RemoteParticipant, LocalParticipant } from "./participant.js";
|
|
11
3
|
import {
|
|
@@ -27,53 +19,22 @@ import {
|
|
|
27
19
|
RemoteTrackPublication,
|
|
28
20
|
LocalTrackPublication
|
|
29
21
|
} from "./track_publication.js";
|
|
30
|
-
import {} from "./
|
|
31
|
-
import {
|
|
32
|
-
E2EEManager,
|
|
33
|
-
KeyProvider,
|
|
34
|
-
FrameCryptor
|
|
35
|
-
} from "./e2ee.js";
|
|
22
|
+
import { E2EEManager, KeyProvider, FrameCryptor } from "./e2ee.js";
|
|
36
23
|
import {
|
|
37
24
|
ConnectionQuality,
|
|
25
|
+
IceServer,
|
|
38
26
|
IceTransportType,
|
|
39
27
|
DataPacketKind,
|
|
40
28
|
ContinualGatheringPolicy,
|
|
29
|
+
TrackPublishOptions,
|
|
41
30
|
ConnectionState
|
|
42
31
|
} from "./proto/room_pb.js";
|
|
43
32
|
import { RpcError } from "./rpc.js";
|
|
44
33
|
import { EncryptionType, EncryptionState } from "./proto/e2ee_pb.js";
|
|
45
|
-
import { StreamState, TrackKind, TrackSource
|
|
46
|
-
import { VideoBufferType, VideoRotation, VideoCodec
|
|
34
|
+
import { StreamState, TrackKind, TrackSource } from "./proto/track_pb.js";
|
|
35
|
+
import { VideoBufferType, VideoRotation, VideoCodec } from "./proto/video_frame_pb.js";
|
|
47
36
|
import { ParticipantKind } from "./proto/participant_pb.js";
|
|
48
37
|
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
|
-
}
|
|
58
|
-
}
|
|
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);
|
|
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
|
-
}
|
|
76
|
-
}
|
|
77
38
|
export {
|
|
78
39
|
AudioFrame,
|
|
79
40
|
AudioResampler,
|
|
@@ -110,9 +71,9 @@ export {
|
|
|
110
71
|
TrackKind,
|
|
111
72
|
TrackPublication,
|
|
112
73
|
TrackPublishOptions,
|
|
113
|
-
|
|
74
|
+
TrackSource,
|
|
114
75
|
VideoBufferType,
|
|
115
|
-
|
|
76
|
+
VideoCodec,
|
|
116
77
|
VideoFrame,
|
|
117
78
|
VideoRotation,
|
|
118
79
|
VideoSource,
|
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\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\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, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, KeyProvider, FrameCryptor } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport {\n ConnectionQuality,\n IceServer,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n TrackPublishOptions,\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"],"mappings":"AAIA,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;AAEP,SAAS,aAAa,aAAa,oBAAoB;AAEvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAA+D;AACxE,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,aAAa,WAAW,mBAAmB;AACpD,SAAS,iBAAiB,eAAe,kBAAkB;AAC3D,SAAS,uBAAuB;AAChC,SAAS,eAAe;","names":[]}
|
|
@@ -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
|
|
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":[]}
|
package/dist/napi/native.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function livekitInitialize(
|
|
7
7
|
callback: (data: Uint8Array) => void,
|
|
8
8
|
captureLogs: boolean,
|
|
9
9
|
sdkVersion: string,
|
|
10
10
|
): void;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
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;
|
package/dist/native.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function livekitInitialize(
|
|
7
7
|
callback: (data: Uint8Array) => void,
|
|
8
8
|
captureLogs: boolean,
|
|
9
9
|
sdkVersion: string,
|
|
10
10
|
): void;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
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;
|