@livekit/rtc-node 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/audio_frame.d.cts +32 -0
  2. package/dist/audio_frame.d.ts +12 -5
  3. package/dist/audio_resampler.d.cts +60 -0
  4. package/dist/audio_resampler.d.ts +12 -3
  5. package/dist/audio_source.d.cts +37 -0
  6. package/dist/audio_source.d.ts +13 -5
  7. package/dist/audio_stream.d.cts +38 -0
  8. package/dist/audio_stream.d.ts +17 -5
  9. package/dist/e2ee.d.cts +48 -0
  10. package/dist/e2ee.d.ts +12 -8
  11. package/dist/ffi_client.d.cts +35 -0
  12. package/dist/ffi_client.d.ts +22 -10
  13. package/dist/index.d.cts +57 -0
  14. package/dist/index.d.ts +28 -20
  15. package/dist/napi/native.d.d.cts +21 -0
  16. package/dist/napi/native.d.d.ts +21 -0
  17. package/dist/participant.d.cts +126 -0
  18. package/dist/participant.d.ts +28 -14
  19. package/dist/proto/audio_frame_pb.d.cts +813 -0
  20. package/dist/proto/audio_frame_pb.d.ts +90 -86
  21. package/dist/proto/e2ee_pb.d.cts +585 -0
  22. package/dist/proto/e2ee_pb.d.ts +60 -58
  23. package/dist/proto/ffi_pb.d.cts +851 -0
  24. package/dist/proto/ffi_pb.d.ts +35 -30
  25. package/dist/proto/handle_pb.d.cts +33 -0
  26. package/dist/proto/handle_pb.d.ts +8 -6
  27. package/dist/proto/participant_pb.d.cts +93 -0
  28. package/dist/proto/participant_pb.d.ts +13 -11
  29. package/dist/proto/room_pb.d.cts +2072 -0
  30. package/dist/proto/room_pb.d.ts +198 -196
  31. package/dist/proto/rpc_pb.d.cts +237 -0
  32. package/dist/proto/rpc_pb.d.ts +28 -26
  33. package/dist/proto/stats_pb.d.cts +1653 -0
  34. package/dist/proto/stats_pb.d.ts +96 -94
  35. package/dist/proto/track_pb.d.cts +402 -0
  36. package/dist/proto/track_pb.d.ts +47 -45
  37. package/dist/proto/video_frame_pb.d.cts +617 -0
  38. package/dist/proto/video_frame_pb.d.ts +64 -60
  39. package/dist/room.d.cts +134 -0
  40. package/dist/room.d.ts +36 -22
  41. package/dist/rpc.d.cts +82 -0
  42. package/dist/rpc.d.ts +11 -7
  43. package/dist/track.d.cts +46 -0
  44. package/dist/track.d.ts +25 -14
  45. package/dist/track_publication.d.cts +48 -0
  46. package/dist/track_publication.d.ts +20 -8
  47. package/dist/transcription.d.cts +15 -0
  48. package/dist/transcription.d.ts +4 -3
  49. package/dist/types.d.cts +9 -0
  50. package/dist/types.d.ts +3 -2
  51. package/dist/version.cjs +1 -1
  52. package/dist/version.cjs.map +1 -1
  53. package/dist/version.d.cts +3 -0
  54. package/dist/version.d.ts +3 -2
  55. package/dist/version.js +1 -1
  56. package/dist/version.js.map +1 -1
  57. package/dist/video_frame.d.cts +25 -0
  58. package/dist/video_frame.d.ts +11 -4
  59. package/dist/video_source.d.cts +22 -0
  60. package/dist/video_source.d.ts +13 -6
  61. package/dist/video_stream.d.cts +41 -0
  62. package/dist/video_stream.d.ts +18 -6
  63. package/package.json +14 -9
  64. package/src/version.ts +1 -1
@@ -0,0 +1,32 @@
1
+ import { OwnedAudioFrameBuffer, AudioFrameBufferInfo } from './proto/audio_frame_pb.cjs';
2
+ import '@bufbuild/protobuf/codegenv1';
3
+ import './proto/handle_pb.cjs';
4
+ import '@bufbuild/protobuf';
5
+ import './proto/track_pb.cjs';
6
+ import './proto/e2ee_pb.cjs';
7
+ import './proto/stats_pb.cjs';
8
+
9
+ declare class AudioFrame {
10
+ data: Int16Array;
11
+ sampleRate: number;
12
+ channels: number;
13
+ samplesPerChannel: number;
14
+ constructor(data: Int16Array, sampleRate: number, channels: number, samplesPerChannel: number);
15
+ static create(sampleRate: number, channels: number, samplesPerChannel: number): AudioFrame;
16
+ /** @internal */
17
+ static fromOwnedInfo(owned: OwnedAudioFrameBuffer): AudioFrame;
18
+ /** @internal */
19
+ protoInfo(): AudioFrameBufferInfo;
20
+ }
21
+ /**
22
+ * Combines one or more `rtc.AudioFrame` objects into a single `rtc.AudioFrame`.
23
+ *
24
+ * This function concatenates the audio data from multiple frames, ensuring that all frames have
25
+ * the same sample rate and number of channels. It efficiently merges the data by preallocating the
26
+ * necessary memory and copying the frame data without unnecessary reallocations.
27
+ *
28
+ * @param buffer - a single AudioFrame or list thereof
29
+ */
30
+ declare const combineAudioFrames: (buffer: AudioFrame | AudioFrame[]) => AudioFrame;
31
+
32
+ export { AudioFrame, combineAudioFrames };
@@ -1,6 +1,12 @@
1
- import type { OwnedAudioFrameBuffer } from './proto/audio_frame_pb.js';
2
- import { type AudioFrameBufferInfo } from './proto/audio_frame_pb.js';
3
- export declare class AudioFrame {
1
+ import { OwnedAudioFrameBuffer, AudioFrameBufferInfo } from './proto/audio_frame_pb.js';
2
+ import '@bufbuild/protobuf/codegenv1';
3
+ import './proto/handle_pb.js';
4
+ import '@bufbuild/protobuf';
5
+ import './proto/track_pb.js';
6
+ import './proto/e2ee_pb.js';
7
+ import './proto/stats_pb.js';
8
+
9
+ declare class AudioFrame {
4
10
  data: Int16Array;
5
11
  sampleRate: number;
6
12
  channels: number;
@@ -21,5 +27,6 @@ export declare class AudioFrame {
21
27
  *
22
28
  * @param buffer - a single AudioFrame or list thereof
23
29
  */
24
- export declare const combineAudioFrames: (buffer: AudioFrame | AudioFrame[]) => AudioFrame;
25
- //# sourceMappingURL=audio_frame.d.ts.map
30
+ declare const combineAudioFrames: (buffer: AudioFrame | AudioFrame[]) => AudioFrame;
31
+
32
+ export { AudioFrame, combineAudioFrames };
@@ -0,0 +1,60 @@
1
+ import { AudioFrame } from './audio_frame.cjs';
2
+ import './proto/audio_frame_pb.cjs';
3
+ import '@bufbuild/protobuf/codegenv1';
4
+ import './proto/handle_pb.cjs';
5
+ import '@bufbuild/protobuf';
6
+ import './proto/track_pb.cjs';
7
+ import './proto/e2ee_pb.cjs';
8
+ import './proto/stats_pb.cjs';
9
+
10
+ /**
11
+ * Resampler quality. Higher quality settings result in better audio quality but require more
12
+ * processing power.
13
+ */
14
+ declare enum AudioResamplerQuality {
15
+ QUICK = 0,
16
+ LOW = 1,
17
+ MEDIUM = 2,
18
+ HIGH = 3,
19
+ VERY_HIGH = 4
20
+ }
21
+ /**
22
+ * AudioResampler provides functionality to resample audio data from an input sample rate to
23
+ * an output sample rate using the Sox resampling library. It supports multiple channels and
24
+ * configurable resampling quality.
25
+ */
26
+ declare class AudioResampler {
27
+ #private;
28
+ /**
29
+ * Initializes a new AudioResampler.
30
+ *
31
+ * @param inputRate - The sample rate of the input audio data (in Hz).
32
+ * @param outputRate - The desired sample rate of the output audio data (in Hz).
33
+ * @param channels - The number of audio channels (e.g., 1 for mono, 2 for stereo). Defaults to 1.
34
+ * @param quality - The quality setting for the resampler. Defaults to
35
+ * `AudioResamplerQuality.MEDIUM`.
36
+ */
37
+ constructor(inputRate: number, outputRate: number, channels?: number, quality?: AudioResamplerQuality);
38
+ /**
39
+ * Push audio data into the resampler and retrieve any available resampled data.
40
+ *
41
+ * This method accepts audio data, resamples it according to the configured input and output rates,
42
+ * and returns any resampled data that is available after processing the input.
43
+ *
44
+ * @param data - The audio frame to resample
45
+ *
46
+ * @returns A list of {@link AudioFrame} objects containing the resampled audio data. The list may
47
+ * be empty if no output data is available yet.
48
+ */
49
+ push(data: AudioFrame): AudioFrame[];
50
+ /**
51
+ * Flush any remaining audio data through the resampler and retrieve the resampled data.
52
+ *
53
+ * @remarks
54
+ * This method should be called when no more input data will be provided to ensure that all
55
+ * internal buffers are processed and all resampled data is output.
56
+ */
57
+ flush(): AudioFrame[];
58
+ }
59
+
60
+ export { AudioResampler, AudioResamplerQuality };
@@ -1,9 +1,17 @@
1
1
  import { AudioFrame } from './audio_frame.js';
2
+ import './proto/audio_frame_pb.js';
3
+ import '@bufbuild/protobuf/codegenv1';
4
+ import './proto/handle_pb.js';
5
+ import '@bufbuild/protobuf';
6
+ import './proto/track_pb.js';
7
+ import './proto/e2ee_pb.js';
8
+ import './proto/stats_pb.js';
9
+
2
10
  /**
3
11
  * Resampler quality. Higher quality settings result in better audio quality but require more
4
12
  * processing power.
5
13
  */
6
- export declare enum AudioResamplerQuality {
14
+ declare enum AudioResamplerQuality {
7
15
  QUICK = 0,
8
16
  LOW = 1,
9
17
  MEDIUM = 2,
@@ -15,7 +23,7 @@ export declare enum AudioResamplerQuality {
15
23
  * an output sample rate using the Sox resampling library. It supports multiple channels and
16
24
  * configurable resampling quality.
17
25
  */
18
- export declare class AudioResampler {
26
+ declare class AudioResampler {
19
27
  #private;
20
28
  /**
21
29
  * Initializes a new AudioResampler.
@@ -48,4 +56,5 @@ export declare class AudioResampler {
48
56
  */
49
57
  flush(): AudioFrame[];
50
58
  }
51
- //# sourceMappingURL=audio_resampler.d.ts.map
59
+
60
+ export { AudioResampler, AudioResamplerQuality };
@@ -0,0 +1,37 @@
1
+ import { AudioFrame } from './audio_frame.cjs';
2
+ import { FfiHandle } from './napi/native.d.cjs';
3
+ import { AudioSourceInfo } from './proto/audio_frame_pb.cjs';
4
+ import '@bufbuild/protobuf/codegenv1';
5
+ import './proto/handle_pb.cjs';
6
+ import '@bufbuild/protobuf';
7
+ import './proto/track_pb.cjs';
8
+ import './proto/e2ee_pb.cjs';
9
+ import './proto/stats_pb.cjs';
10
+
11
+ declare class AudioSource {
12
+ /** @internal */
13
+ info: AudioSourceInfo;
14
+ /** @internal */
15
+ ffiHandle: FfiHandle;
16
+ /** @internal */
17
+ lastCapture: number;
18
+ /** @internal */
19
+ currentQueueSize: number;
20
+ /** @internal */
21
+ release: () => void;
22
+ promise: Promise<void>;
23
+ /** @internal */
24
+ timeout?: ReturnType<typeof setTimeout>;
25
+ sampleRate: number;
26
+ numChannels: number;
27
+ queueSize: number;
28
+ constructor(sampleRate: number, numChannels: number, queueSize?: number);
29
+ get queuedDuration(): number;
30
+ clearQueue(): void;
31
+ /** @internal */
32
+ newPromise(): Promise<void>;
33
+ waitForPlayout(): Promise<void>;
34
+ captureFrame(frame: AudioFrame): Promise<void>;
35
+ }
36
+
37
+ export { AudioSource };
@@ -1,7 +1,14 @@
1
- import type { AudioFrame } from './audio_frame.js';
2
- import { FfiHandle } from './napi/native.js';
3
- import type { AudioSourceInfo } from './proto/audio_frame_pb.js';
4
- export declare class AudioSource {
1
+ import { AudioFrame } from './audio_frame.js';
2
+ import { FfiHandle } from './napi/native.d.js';
3
+ import { AudioSourceInfo } from './proto/audio_frame_pb.js';
4
+ import '@bufbuild/protobuf/codegenv1';
5
+ import './proto/handle_pb.js';
6
+ import '@bufbuild/protobuf';
7
+ import './proto/track_pb.js';
8
+ import './proto/e2ee_pb.js';
9
+ import './proto/stats_pb.js';
10
+
11
+ declare class AudioSource {
5
12
  /** @internal */
6
13
  info: AudioSourceInfo;
7
14
  /** @internal */
@@ -26,4 +33,5 @@ export declare class AudioSource {
26
33
  waitForPlayout(): Promise<void>;
27
34
  captureFrame(frame: AudioFrame): Promise<void>;
28
35
  }
29
- //# sourceMappingURL=audio_source.d.ts.map
36
+
37
+ export { AudioSource };
@@ -0,0 +1,38 @@
1
+ import { Mutex } from '@livekit/mutex';
2
+ import { AudioFrame } from './audio_frame.cjs';
3
+ import { FfiHandle } from './napi/native.d.cjs';
4
+ import { AudioStreamInfo } from './proto/audio_frame_pb.cjs';
5
+ import { Track } from './track.cjs';
6
+ import '@bufbuild/protobuf/codegenv1';
7
+ import './proto/handle_pb.cjs';
8
+ import '@bufbuild/protobuf';
9
+ import './proto/track_pb.cjs';
10
+ import './proto/e2ee_pb.cjs';
11
+ import './proto/stats_pb.cjs';
12
+ import './audio_source.cjs';
13
+ import './video_source.cjs';
14
+ import './proto/video_frame_pb.cjs';
15
+ import './video_frame.cjs';
16
+
17
+ declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
18
+ /** @internal */
19
+ info: AudioStreamInfo;
20
+ /** @internal */
21
+ ffiHandle: FfiHandle;
22
+ /** @internal */
23
+ eventQueue: (AudioFrame | null)[];
24
+ /** @internal */
25
+ queueResolve: ((value: IteratorResult<AudioFrame>) => void) | null;
26
+ /** @internal */
27
+ mutex: Mutex;
28
+ track: Track;
29
+ sampleRate: number;
30
+ numChannels: number;
31
+ constructor(track: Track, sampleRate?: number, numChannels?: number);
32
+ private onEvent;
33
+ next(): Promise<IteratorResult<AudioFrame>>;
34
+ close(): void;
35
+ [Symbol.asyncIterator](): AudioStream;
36
+ }
37
+
38
+ export { AudioStream };
@@ -1,9 +1,20 @@
1
1
  import { Mutex } from '@livekit/mutex';
2
2
  import { AudioFrame } from './audio_frame.js';
3
- import { FfiHandle } from './ffi_client.js';
4
- import type { AudioStreamInfo } from './proto/audio_frame_pb.js';
5
- import type { Track } from './track.js';
6
- export declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
3
+ import { FfiHandle } from './napi/native.d.js';
4
+ import { AudioStreamInfo } from './proto/audio_frame_pb.js';
5
+ import { Track } from './track.js';
6
+ import '@bufbuild/protobuf/codegenv1';
7
+ import './proto/handle_pb.js';
8
+ import '@bufbuild/protobuf';
9
+ import './proto/track_pb.js';
10
+ import './proto/e2ee_pb.js';
11
+ import './proto/stats_pb.js';
12
+ import './audio_source.js';
13
+ import './video_source.js';
14
+ import './proto/video_frame_pb.js';
15
+ import './video_frame.js';
16
+
17
+ declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
7
18
  /** @internal */
8
19
  info: AudioStreamInfo;
9
20
  /** @internal */
@@ -23,4 +34,5 @@ export declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
23
34
  close(): void;
24
35
  [Symbol.asyncIterator](): AudioStream;
25
36
  }
26
- //# sourceMappingURL=audio_stream.d.ts.map
37
+
38
+ export { AudioStream };
@@ -0,0 +1,48 @@
1
+ import { EncryptionType } from './proto/e2ee_pb.cjs';
2
+ import '@bufbuild/protobuf/codegenv1';
3
+ import '@bufbuild/protobuf';
4
+
5
+ interface KeyProviderOptions {
6
+ sharedKey?: Uint8Array;
7
+ ratchetSalt: Uint8Array;
8
+ ratchetWindowSize: number;
9
+ failureTolerance: number;
10
+ }
11
+ declare const defaultKeyProviderOptions: KeyProviderOptions;
12
+ interface E2EEOptions {
13
+ keyProviderOptions: KeyProviderOptions;
14
+ encryptionType: EncryptionType;
15
+ }
16
+ declare const defaultE2EEOptions: E2EEOptions;
17
+ declare class KeyProvider {
18
+ private roomHandle;
19
+ options: KeyProviderOptions;
20
+ /** internal */
21
+ constructor(roomHandle: bigint, opts: KeyProviderOptions);
22
+ setSharedKey(sharedKey: Uint8Array, keyIndex: number): void;
23
+ exportSharedKey(keyIndex: number): Uint8Array;
24
+ ratchetSharedKey(keyIndex: number): Uint8Array;
25
+ setKey(participantIdentity: string, keyIndex: number): void;
26
+ exportKey(participantIdentity: string, keyIndex: number): Uint8Array;
27
+ ratchetKey(participantIdentity: string, keyIndex: number): Uint8Array;
28
+ }
29
+ declare class FrameCryptor {
30
+ private roomHandle;
31
+ participantIdentity: string;
32
+ keyIndex: number;
33
+ enabled: boolean;
34
+ constructor(roomHandle: bigint, participantIdentity: string, keyIndex: number, enabled: boolean);
35
+ setEnabled(enabled: boolean): void;
36
+ setKeyIndex(keyIndex: number): void;
37
+ }
38
+ declare class E2EEManager {
39
+ private roomHandle;
40
+ private options;
41
+ private keyProvider?;
42
+ enabled: boolean;
43
+ constructor(roomHandle: bigint, opts?: E2EEOptions);
44
+ setEnabled(enabled: boolean): void;
45
+ frameCryptors(): FrameCryptor[];
46
+ }
47
+
48
+ export { E2EEManager, type E2EEOptions, FrameCryptor, KeyProvider, type KeyProviderOptions, defaultE2EEOptions, defaultKeyProviderOptions };
package/dist/e2ee.d.ts CHANGED
@@ -1,17 +1,20 @@
1
1
  import { EncryptionType } from './proto/e2ee_pb.js';
2
- export interface KeyProviderOptions {
2
+ import '@bufbuild/protobuf/codegenv1';
3
+ import '@bufbuild/protobuf';
4
+
5
+ interface KeyProviderOptions {
3
6
  sharedKey?: Uint8Array;
4
7
  ratchetSalt: Uint8Array;
5
8
  ratchetWindowSize: number;
6
9
  failureTolerance: number;
7
10
  }
8
- export declare const defaultKeyProviderOptions: KeyProviderOptions;
9
- export interface E2EEOptions {
11
+ declare const defaultKeyProviderOptions: KeyProviderOptions;
12
+ interface E2EEOptions {
10
13
  keyProviderOptions: KeyProviderOptions;
11
14
  encryptionType: EncryptionType;
12
15
  }
13
- export declare const defaultE2EEOptions: E2EEOptions;
14
- export declare class KeyProvider {
16
+ declare const defaultE2EEOptions: E2EEOptions;
17
+ declare class KeyProvider {
15
18
  private roomHandle;
16
19
  options: KeyProviderOptions;
17
20
  /** internal */
@@ -23,7 +26,7 @@ export declare class KeyProvider {
23
26
  exportKey(participantIdentity: string, keyIndex: number): Uint8Array;
24
27
  ratchetKey(participantIdentity: string, keyIndex: number): Uint8Array;
25
28
  }
26
- export declare class FrameCryptor {
29
+ declare class FrameCryptor {
27
30
  private roomHandle;
28
31
  participantIdentity: string;
29
32
  keyIndex: number;
@@ -32,7 +35,7 @@ export declare class FrameCryptor {
32
35
  setEnabled(enabled: boolean): void;
33
36
  setKeyIndex(keyIndex: number): void;
34
37
  }
35
- export declare class E2EEManager {
38
+ declare class E2EEManager {
36
39
  private roomHandle;
37
40
  private options;
38
41
  private keyProvider?;
@@ -41,4 +44,5 @@ export declare class E2EEManager {
41
44
  setEnabled(enabled: boolean): void;
42
45
  frameCryptors(): FrameCryptor[];
43
46
  }
44
- //# sourceMappingURL=e2ee.d.ts.map
47
+
48
+ export { E2EEManager, type E2EEOptions, FrameCryptor, KeyProvider, type KeyProviderOptions, defaultE2EEOptions, defaultKeyProviderOptions };
@@ -0,0 +1,35 @@
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { TypedEventEmitter } from '@livekit/typed-emitter';
3
+ export { FfiHandle, livekitDispose as dispose } from './napi/native.d.cjs';
4
+ import { FfiEvent, FfiRequestSchema } from './proto/ffi_pb.cjs';
5
+ export { FfiRequest, FfiResponse } from './proto/ffi_pb.cjs';
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';
11
+ import './proto/room_pb.cjs';
12
+ import './proto/participant_pb.cjs';
13
+ import './proto/video_frame_pb.cjs';
14
+ import './proto/audio_frame_pb.cjs';
15
+ import './proto/rpc_pb.cjs';
16
+
17
+ type FfiClientCallbacks = {
18
+ ffi_event: (event: FfiEvent) => void;
19
+ };
20
+ declare enum FfiClientEvent {
21
+ FfiEvent = "ffi_event"
22
+ }
23
+ declare const FfiClient_base: new () => TypedEventEmitter<FfiClientCallbacks>;
24
+ declare class FfiClient extends FfiClient_base {
25
+ static _client?: FfiClient;
26
+ /** @internal */
27
+ static get instance(): FfiClient;
28
+ constructor();
29
+ request<T>(req: MessageInitShape<typeof FfiRequestSchema>): T;
30
+ copyBuffer(ptr: bigint, len: number): Uint8Array;
31
+ retrievePtr(data: Uint8Array): bigint;
32
+ waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T>;
33
+ }
34
+
35
+ export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent };
@@ -1,16 +1,27 @@
1
- import type { MessageInitShape } from '@bufbuild/protobuf';
2
- import type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter';
3
- import { FfiHandle, livekitDispose } from './napi/native.js';
4
- import { type FfiEvent, type FfiRequest, FfiRequestSchema, type FfiResponse } from './proto/ffi_pb.js';
5
- export { FfiHandle, type FfiEvent, type FfiResponse, type FfiRequest, livekitDispose as dispose };
6
- export type FfiClientCallbacks = {
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { TypedEventEmitter } from '@livekit/typed-emitter';
3
+ export { FfiHandle, livekitDispose as dispose } from './napi/native.d.js';
4
+ import { FfiEvent, FfiRequestSchema } from './proto/ffi_pb.js';
5
+ export { FfiRequest, FfiResponse } from './proto/ffi_pb.js';
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';
11
+ import './proto/room_pb.js';
12
+ import './proto/participant_pb.js';
13
+ import './proto/video_frame_pb.js';
14
+ import './proto/audio_frame_pb.js';
15
+ import './proto/rpc_pb.js';
16
+
17
+ type FfiClientCallbacks = {
7
18
  ffi_event: (event: FfiEvent) => void;
8
19
  };
9
- export declare enum FfiClientEvent {
20
+ declare enum FfiClientEvent {
10
21
  FfiEvent = "ffi_event"
11
22
  }
12
- declare const FfiClient_base: new () => TypedEmitter<FfiClientCallbacks>;
13
- export declare class FfiClient extends FfiClient_base {
23
+ declare const FfiClient_base: new () => TypedEventEmitter<FfiClientCallbacks>;
24
+ declare class FfiClient extends FfiClient_base {
14
25
  static _client?: FfiClient;
15
26
  /** @internal */
16
27
  static get instance(): FfiClient;
@@ -20,4 +31,5 @@ export declare class FfiClient extends FfiClient_base {
20
31
  retrievePtr(data: Uint8Array): bigint;
21
32
  waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T>;
22
33
  }
23
- //# sourceMappingURL=ffi_client.d.ts.map
34
+
35
+ export { FfiClient, type FfiClientCallbacks, FfiClientEvent, FfiEvent };
@@ -0,0 +1,57 @@
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { IceServer as IceServer$1, TrackPublishOptions as TrackPublishOptions$1, VideoEncoding, AudioEncoding, TrackPublishOptionsSchema, IceServerSchema } from './proto/room_pb.cjs';
3
+ export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceTransportType } from './proto/room_pb.cjs';
4
+ import { TrackSource } from './proto/track_pb.cjs';
5
+ export { StreamState, TrackKind } from './proto/track_pb.cjs';
6
+ import { VideoCodec } from './proto/video_frame_pb.cjs';
7
+ export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.cjs';
8
+ export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.cjs';
9
+ export { LocalParticipant, Participant, RemoteParticipant } from './participant.cjs';
10
+ export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.cjs';
11
+ export { VideoFrame } from './video_frame.cjs';
12
+ export { AudioFrame, combineAudioFrames } from './audio_frame.cjs';
13
+ export { AudioStream } from './audio_stream.cjs';
14
+ export { AudioResampler, AudioResamplerQuality } from './audio_resampler.cjs';
15
+ export { VideoFrameEvent, VideoStream } from './video_stream.cjs';
16
+ export { AudioSource } from './audio_source.cjs';
17
+ export { VideoSource } from './video_source.cjs';
18
+ export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.cjs';
19
+ export { Transcription, TranscriptionSegment } from './transcription.cjs';
20
+ export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.cjs';
21
+ export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.cjs';
22
+ export { EncryptionState, EncryptionType } from './proto/e2ee_pb.cjs';
23
+ export { ParticipantKind } from './proto/participant_pb.cjs';
24
+ export { livekitDispose as dispose } from './napi/native.d.cjs';
25
+ export { ChatMessage } from './types.cjs';
26
+ import '@bufbuild/protobuf/codegenv1';
27
+ import './proto/handle_pb.cjs';
28
+ import './proto/stats_pb.cjs';
29
+ import '@livekit/typed-emitter';
30
+ import './proto/audio_frame_pb.cjs';
31
+ import '@livekit/mutex';
32
+ import './proto/rpc_pb.cjs';
33
+
34
+ type IceServerInit = MessageInitShape<typeof IceServerSchema> & {
35
+ urls: string[];
36
+ };
37
+ declare class IceServer implements IceServer$1 {
38
+ $typeName: "livekit.proto.IceServer";
39
+ urls: string[];
40
+ username: string;
41
+ password: string;
42
+ constructor(init: IceServerInit);
43
+ }
44
+ declare class TrackPublishOptions implements TrackPublishOptions$1 {
45
+ $typeName: "livekit.proto.TrackPublishOptions";
46
+ videoCodec: VideoCodec;
47
+ videoEncoding?: VideoEncoding | undefined;
48
+ audioEncoding?: AudioEncoding | undefined;
49
+ dtx: boolean;
50
+ simulcast: boolean;
51
+ source: TrackSource;
52
+ stream: string;
53
+ red: boolean;
54
+ constructor(init?: MessageInitShape<typeof TrackPublishOptionsSchema>);
55
+ }
56
+
57
+ export { IceServer, TrackPublishOptions, TrackSource, VideoCodec };
package/dist/index.d.ts CHANGED
@@ -1,40 +1,47 @@
1
- import type { MessageInitShape } from '@bufbuild/protobuf';
2
- import type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';
3
- import { IceServerSchema, type IceServer as IceServerType, type TrackPublishOptions as TrackPublishOptionsType } from './proto/room_pb.js';
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { IceServer as IceServer$1, TrackPublishOptions as TrackPublishOptions$1, VideoEncoding, AudioEncoding, TrackPublishOptionsSchema, IceServerSchema } from './proto/room_pb.js';
3
+ export { ConnectionQuality, ConnectionState, ContinualGatheringPolicy, DataPacketKind, IceTransportType } from './proto/room_pb.js';
4
4
  import { TrackSource } from './proto/track_pb.js';
5
+ export { StreamState, TrackKind } from './proto/track_pb.js';
5
6
  import { VideoCodec } from './proto/video_frame_pb.js';
6
- export { Room, RoomEvent, ConnectError, type RoomOptions, type RtcConfiguration } from './room.js';
7
- export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
8
- export { Track, type LocalTrack, type RemoteTrack, type VideoTrack, LocalAudioTrack, LocalVideoTrack, RemoteAudioTrack, RemoteVideoTrack, type AudioTrack, } from './track.js';
7
+ export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js';
8
+ export { ConnectError, Room, RoomEvent, RoomOptions, RtcConfiguration } from './room.js';
9
+ export { LocalParticipant, Participant, RemoteParticipant } from './participant.js';
10
+ export { AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Track, VideoTrack } from './track.js';
9
11
  export { VideoFrame } from './video_frame.js';
10
12
  export { AudioFrame, combineAudioFrames } from './audio_frame.js';
11
13
  export { AudioStream } from './audio_stream.js';
12
14
  export { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';
13
- export { VideoStream, type VideoFrameEvent } from './video_stream.js';
15
+ export { VideoFrameEvent, VideoStream } from './video_stream.js';
14
16
  export { AudioSource } from './audio_source.js';
15
17
  export { VideoSource } from './video_source.js';
16
- export { TrackPublication, RemoteTrackPublication, LocalTrackPublication, } from './track_publication.js';
17
- export { type Transcription, type TranscriptionSegment } from './transcription.js';
18
- export { E2EEManager, type E2EEOptions, type KeyProviderOptions, KeyProvider, FrameCryptor, } from './e2ee.js';
19
- export { ConnectionQuality, IceTransportType, DataPacketKind, ContinualGatheringPolicy, ConnectionState, } from './proto/room_pb.js';
20
- export { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';
21
- export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';
22
- export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';
23
- export { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';
18
+ export { LocalTrackPublication, RemoteTrackPublication, TrackPublication } from './track_publication.js';
19
+ export { Transcription, TranscriptionSegment } from './transcription.js';
20
+ export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.js';
21
+ export { PerformRpcParams, RpcError, RpcInvocationData } from './rpc.js';
22
+ export { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';
24
23
  export { ParticipantKind } from './proto/participant_pb.js';
25
- export { dispose } from './ffi_client.js';
26
- export type { ChatMessage } from './types.js';
24
+ export { livekitDispose as dispose } from './napi/native.d.js';
25
+ export { ChatMessage } from './types.js';
26
+ import '@bufbuild/protobuf/codegenv1';
27
+ import './proto/handle_pb.js';
28
+ import './proto/stats_pb.js';
29
+ import '@livekit/typed-emitter';
30
+ import './proto/audio_frame_pb.js';
31
+ import '@livekit/mutex';
32
+ import './proto/rpc_pb.js';
33
+
27
34
  type IceServerInit = MessageInitShape<typeof IceServerSchema> & {
28
35
  urls: string[];
29
36
  };
30
- export declare class IceServer implements IceServerType {
37
+ declare class IceServer implements IceServer$1 {
31
38
  $typeName: "livekit.proto.IceServer";
32
39
  urls: string[];
33
40
  username: string;
34
41
  password: string;
35
42
  constructor(init: IceServerInit);
36
43
  }
37
- export declare class TrackPublishOptions implements TrackPublishOptionsType {
44
+ declare class TrackPublishOptions implements TrackPublishOptions$1 {
38
45
  $typeName: "livekit.proto.TrackPublishOptions";
39
46
  videoCodec: VideoCodec;
40
47
  videoEncoding?: VideoEncoding | undefined;
@@ -46,4 +53,5 @@ export declare class TrackPublishOptions implements TrackPublishOptionsType {
46
53
  red: boolean;
47
54
  constructor(init?: MessageInitShape<typeof TrackPublishOptionsSchema>);
48
55
  }
49
- //# sourceMappingURL=index.d.ts.map
56
+
57
+ export { IceServer, TrackPublishOptions, TrackSource, VideoCodec };
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ declare function livekitInitialize(
7
+ callback: (data: Uint8Array) => void,
8
+ captureLogs: boolean,
9
+ sdkVersion: string,
10
+ ): void;
11
+ declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ declare function livekitDispose(): Promise<void>;
15
+ declare class FfiHandle {
16
+ constructor(handle: bigint);
17
+ dispose(): void;
18
+ get handle(): bigint;
19
+ }
20
+
21
+ export { FfiHandle, livekitCopyBuffer, livekitDispose, livekitFfiRequest, livekitInitialize, livekitRetrievePtr };
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ declare function livekitInitialize(
7
+ callback: (data: Uint8Array) => void,
8
+ captureLogs: boolean,
9
+ sdkVersion: string,
10
+ ): void;
11
+ declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ declare function livekitDispose(): Promise<void>;
15
+ declare class FfiHandle {
16
+ constructor(handle: bigint);
17
+ dispose(): void;
18
+ get handle(): bigint;
19
+ }
20
+
21
+ export { FfiHandle, livekitCopyBuffer, livekitDispose, livekitFfiRequest, livekitInitialize, livekitRetrievePtr };