@livekit/react-native 2.2.0 → 2.3.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.
Files changed (104) hide show
  1. package/README.md +14 -5
  2. package/android/build.gradle +1 -1
  3. package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
  4. package/android/gradlew +29 -14
  5. package/android/gradlew.bat +19 -16
  6. package/android/src/main/java/com/livekit/reactnative/video/SimulcastVideoEncoderFactoryWrapper.kt +2 -2
  7. package/lib/commonjs/audio/AudioManager.js +4 -27
  8. package/lib/commonjs/audio/AudioManager.js.map +1 -1
  9. package/lib/commonjs/audio/AudioSession.js +55 -21
  10. package/lib/commonjs/audio/AudioSession.js.map +1 -1
  11. package/lib/commonjs/components/LiveKitRoom.js +3 -6
  12. package/lib/commonjs/components/LiveKitRoom.js.map +1 -1
  13. package/lib/commonjs/components/VideoTrack.js +30 -66
  14. package/lib/commonjs/components/VideoTrack.js.map +1 -1
  15. package/lib/commonjs/components/VideoView.js +32 -63
  16. package/lib/commonjs/components/VideoView.js.map +1 -1
  17. package/lib/commonjs/components/ViewPortDetector.js +15 -62
  18. package/lib/commonjs/components/ViewPortDetector.js.map +1 -1
  19. package/lib/commonjs/hooks.js +0 -63
  20. package/lib/commonjs/hooks.js.map +1 -1
  21. package/lib/commonjs/index.js +9 -84
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/commonjs/logger.js +4 -14
  24. package/lib/commonjs/logger.js.map +1 -1
  25. package/lib/commonjs/polyfills/EncoderDecoderTogether.min.js +16 -42
  26. package/lib/commonjs/polyfills/EncoderDecoderTogether.min.js.map +1 -1
  27. package/lib/commonjs/useParticipant.js +5 -13
  28. package/lib/commonjs/useParticipant.js.map +1 -1
  29. package/lib/commonjs/useRoom.js +17 -33
  30. package/lib/commonjs/useRoom.js.map +1 -1
  31. package/lib/module/audio/AudioManager.js +3 -17
  32. package/lib/module/audio/AudioManager.js.map +1 -1
  33. package/lib/module/audio/AudioSession.js +54 -14
  34. package/lib/module/audio/AudioSession.js.map +1 -1
  35. package/lib/module/components/LiveKitRoom.js +1 -0
  36. package/lib/module/components/LiveKitRoom.js.map +1 -1
  37. package/lib/module/components/VideoTrack.js +18 -44
  38. package/lib/module/components/VideoTrack.js.map +1 -1
  39. package/lib/module/components/VideoView.js +18 -42
  40. package/lib/module/components/VideoView.js.map +1 -1
  41. package/lib/module/components/ViewPortDetector.js +13 -54
  42. package/lib/module/components/ViewPortDetector.js.map +1 -1
  43. package/lib/module/hooks.js +1 -2
  44. package/lib/module/hooks.js.map +1 -1
  45. package/lib/module/index.js +5 -23
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/logger.js +2 -6
  48. package/lib/module/logger.js.map +1 -1
  49. package/lib/module/polyfills/EncoderDecoderTogether.min.js +16 -42
  50. package/lib/module/polyfills/EncoderDecoderTogether.min.js.map +1 -1
  51. package/lib/module/useParticipant.js +5 -11
  52. package/lib/module/useParticipant.js.map +1 -1
  53. package/lib/module/useRoom.js +17 -30
  54. package/lib/module/useRoom.js.map +1 -1
  55. package/lib/typescript/babel.config.d.ts +1 -0
  56. package/lib/typescript/docs/assets/icons.d.ts +0 -0
  57. package/lib/typescript/docs/assets/main.d.ts +0 -0
  58. package/lib/typescript/docs/assets/navigation.d.ts +0 -0
  59. package/lib/typescript/docs/assets/search.d.ts +0 -0
  60. package/lib/typescript/lib/commonjs/audio/AudioManager.d.ts +10 -0
  61. package/lib/typescript/lib/commonjs/audio/AudioSession.d.ts +33 -0
  62. package/lib/typescript/lib/commonjs/components/LiveKitRoom.d.ts +20 -0
  63. package/lib/typescript/lib/commonjs/components/VideoTrack.d.ts +8 -0
  64. package/lib/typescript/lib/commonjs/components/VideoView.d.ts +14 -0
  65. package/lib/typescript/lib/commonjs/components/ViewPortDetector.d.ts +30 -0
  66. package/lib/typescript/lib/commonjs/hooks.d.ts +29 -0
  67. package/lib/typescript/lib/commonjs/index.d.ts +10 -0
  68. package/lib/typescript/lib/commonjs/logger.d.ts +8 -0
  69. package/lib/typescript/lib/commonjs/useParticipant.d.ts +14 -0
  70. package/lib/typescript/lib/commonjs/useRoom.d.ts +16 -0
  71. package/lib/typescript/lib/module/audio/AudioManager.d.ts +9 -0
  72. package/lib/typescript/lib/module/audio/AudioSession.d.ts +31 -0
  73. package/lib/typescript/lib/module/components/LiveKitRoom.d.ts +22 -0
  74. package/lib/typescript/lib/module/components/VideoTrack.d.ts +9 -0
  75. package/lib/typescript/lib/module/components/VideoView.d.ts +9 -0
  76. package/lib/typescript/lib/module/components/ViewPortDetector.d.ts +29 -0
  77. package/lib/typescript/lib/module/hooks.d.ts +1 -0
  78. package/lib/typescript/lib/module/index.d.ts +18 -0
  79. package/lib/typescript/lib/module/logger.d.ts +8 -0
  80. package/lib/typescript/lib/module/polyfills/EncoderDecoderTogether.min.d.ts +0 -0
  81. package/lib/typescript/lib/module/useParticipant.d.ts +13 -0
  82. package/lib/typescript/lib/module/useRoom.d.ts +15 -0
  83. package/lib/typescript/scripts/bootstrap.d.ts +1 -0
  84. package/lib/typescript/{audio → src/audio}/AudioSession.d.ts +7 -7
  85. package/lib/typescript/{components → src/components}/LiveKitRoom.d.ts +1 -1
  86. package/lib/typescript/{components → src/components}/VideoTrack.d.ts +2 -2
  87. package/lib/typescript/{components → src/components}/VideoView.d.ts +3 -3
  88. package/lib/typescript/{components → src/components}/ViewPortDetector.d.ts +3 -3
  89. package/lib/typescript/src/hooks.d.ts +3 -0
  90. package/lib/typescript/{index.d.ts → src/index.d.ts} +3 -2
  91. package/lib/typescript/{logger.d.ts → src/logger.d.ts} +2 -2
  92. package/lib/typescript/src/polyfills/EncoderDecoderTogether.min.d.ts +0 -0
  93. package/lib/typescript/{useRoom.d.ts → src/useRoom.d.ts} +1 -1
  94. package/package.json +23 -19
  95. package/src/components/LiveKitRoom.tsx +1 -1
  96. package/src/components/VideoTrack.tsx +7 -2
  97. package/src/components/VideoView.tsx +8 -3
  98. package/src/components/ViewPortDetector.tsx +4 -4
  99. package/src/hooks.ts +11 -9
  100. package/src/index.tsx +10 -8
  101. package/src/useRoom.ts +1 -1
  102. package/lib/typescript/hooks.d.ts +0 -2
  103. /package/lib/typescript/{audio → src/audio}/AudioManager.d.ts +0 -0
  104. /package/lib/typescript/{useParticipant.d.ts → src/useParticipant.d.ts} +0 -0
@@ -0,0 +1,29 @@
1
+ export const __esModule: boolean;
2
+ export const ParticipantContext: any;
3
+ export const RoomContext: any;
4
+ export const TrackRefContext: any;
5
+ export const isTrackReference: any;
6
+ export const useChat: any;
7
+ export const useConnectionState: any;
8
+ export const useDataChannel: any;
9
+ export const useEnsureTrackRef: any;
10
+ export const useIsEncrypted: any;
11
+ export const useIsMuted: any;
12
+ export const useIsSpeaking: any;
13
+ export const useLiveKitRoom: any;
14
+ export const useLocalParticipant: any;
15
+ export const useLocalParticipantPermissions: any;
16
+ export const useParticipantContext: any;
17
+ export const useParticipantInfo: any;
18
+ export const useParticipantTracks: any;
19
+ export const useParticipants: any;
20
+ export const useRemoteParticipant: any;
21
+ export const useRemoteParticipants: any;
22
+ export const useRoomContext: any;
23
+ export const useRoomInfo: any;
24
+ export const useSortedParticipants: any;
25
+ export const useSpeakingParticipants: any;
26
+ export const useTrackMutedIndicator: any;
27
+ export const useTrackRefContext: any;
28
+ export const useTracks: any;
29
+ export const useVisualStableUpdate: any;
@@ -0,0 +1,10 @@
1
+ export const __esModule: boolean;
2
+ export const AndroidAudioTypePresets: any;
3
+ export const AudioSession: any;
4
+ export const getDefaultAppleAudioConfigurationForMode: any;
5
+ /**
6
+ * Registers the required globals needed for LiveKit to work.
7
+ *
8
+ * Must be called before using LiveKit.
9
+ */
10
+ export function registerGlobals(): void;
@@ -0,0 +1,8 @@
1
+ export const __esModule: boolean;
2
+ export const log: any;
3
+ /**
4
+ * Set the log level for both the `@livekit/react-native` package and the `@livekit-client` package.
5
+ * To set the `@livekit-client` log independently, use the `liveKitClientLogLevel` prop on the `options` object.
6
+ * @public
7
+ */
8
+ export function setLogLevel(level: any, options?: {}): void;
@@ -0,0 +1,14 @@
1
+ export const __esModule: boolean;
2
+ /** @deprecated use `useRemoteParticipant` or `useLocalParticipant` instead */
3
+ /** @deprecated use `useRemoteParticipant` or `useLocalParticipant` instead */
4
+ export function useParticipant(participant: any): {
5
+ isLocal: boolean;
6
+ isSpeaking: any;
7
+ connectionQuality: any;
8
+ publications: any;
9
+ subscribedTracks: any;
10
+ cameraPublication: any;
11
+ microphonePublication: any;
12
+ screenSharePublication: any;
13
+ metadata: any;
14
+ };
@@ -0,0 +1,16 @@
1
+ export const __esModule: boolean;
2
+ /**
3
+ * Default sort for participants, it'll order participants by:
4
+ * 1. dominant speaker (speaker with the loudest audio level)
5
+ * 2. local participant
6
+ * 3. other speakers that are recently active
7
+ * 4. participants with video on
8
+ * 5. by joinedAt
9
+ */
10
+ export function sortParticipants(participants: any, localParticipant: any): void;
11
+ /** @deprecated wrap your components in a <LiveKitRoom> component instead and use more granular hooks to track state you're interested in */
12
+ export function useRoom(room: any, options: any): {
13
+ error: any;
14
+ participants: any;
15
+ audioTracks: any;
16
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Handles setting the appropriate AVAudioSession options automatically
3
+ * depending on the audio track states of the Room.
4
+ *
5
+ * @param room
6
+ * @param preferSpeakerOutput
7
+ * @param onConfigureNativeAudio A custom method for determining options used.
8
+ */
9
+ export function useIOSAudioManagement(room: any, preferSpeakerOutput: boolean | undefined, onConfigureNativeAudio: any): void;
@@ -0,0 +1,31 @@
1
+ export function getDefaultAppleAudioConfigurationForMode(mode: any, preferSpeakerOutput?: boolean): {
2
+ audioCategory: string;
3
+ audioCategoryOptions: string[];
4
+ audioMode: string;
5
+ };
6
+ export namespace AndroidAudioTypePresets {
7
+ namespace communication {
8
+ const manageAudioFocus: boolean;
9
+ const audioMode: string;
10
+ const audioFocusMode: string;
11
+ const audioStreamType: string;
12
+ const audioAttributesUsageType: string;
13
+ const audioAttributesContentType: string;
14
+ }
15
+ namespace media {
16
+ const manageAudioFocus_1: boolean;
17
+ export { manageAudioFocus_1 as manageAudioFocus };
18
+ const audioMode_1: string;
19
+ export { audioMode_1 as audioMode };
20
+ const audioFocusMode_1: string;
21
+ export { audioFocusMode_1 as audioFocusMode };
22
+ const audioStreamType_1: string;
23
+ export { audioStreamType_1 as audioStreamType };
24
+ const audioAttributesUsageType_1: string;
25
+ export { audioAttributesUsageType_1 as audioAttributesUsageType };
26
+ const audioAttributesContentType_1: string;
27
+ export { audioAttributesContentType_1 as audioAttributesContentType };
28
+ }
29
+ }
30
+ export default class AudioSession {
31
+ }
@@ -0,0 +1,22 @@
1
+ /** @public */
2
+ /**
3
+ * The `LiveKitRoom` component provides the room context to all its child components.
4
+ * It is generally the starting point of your LiveKit app and the root of the LiveKit component tree.
5
+ * It provides the room state as a React context to all child components, so you don't have to pass it yourself.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <LiveKitRoom
10
+ * token='<livekit-token>'
11
+ * serverUrl='<url-to-livekit-server>'
12
+ * connect={true}
13
+ * >
14
+ * ...
15
+ * </LiveKitRoom>
16
+ * ```
17
+ * @public
18
+ */
19
+ export function LiveKitRoom(props: any): React.FunctionComponentElement<{
20
+ children?: React.ReactNode;
21
+ }>;
22
+ import * as React from 'react';
@@ -0,0 +1,9 @@
1
+ export function VideoTrack({ style, trackRef, objectFit, zOrder, mirror }: {
2
+ style?: {} | undefined;
3
+ trackRef: any;
4
+ objectFit?: string | undefined;
5
+ zOrder: any;
6
+ mirror: any;
7
+ }): React.CElement<import("react-native").ViewProps, View>;
8
+ import { View } from 'react-native';
9
+ import * as React from 'react';
@@ -0,0 +1,9 @@
1
+ export function VideoView({ style, videoTrack, objectFit, zOrder, mirror }: {
2
+ style?: {} | undefined;
3
+ videoTrack: any;
4
+ objectFit?: string | undefined;
5
+ zOrder: any;
6
+ mirror: any;
7
+ }): React.CElement<import("react-native").ViewProps, View>;
8
+ import { View } from 'react-native';
9
+ import * as React from 'react';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Detects when this is in the viewport and visible.
3
+ *
4
+ * Will not fire visibility changes for zero width/height components.
5
+ */
6
+ export default class ViewPortDetector extends React.Component<any, any, any> {
7
+ constructor(props: any);
8
+ lastAppStateActive: any;
9
+ interval: TimeoutHandler | null;
10
+ lastValue: any;
11
+ state: {
12
+ rectTop: number;
13
+ rectBottom: number;
14
+ };
15
+ componentDidMount(): void;
16
+ appStateSubscription: import("react-native").NativeEventSubscription | null | undefined;
17
+ componentWillUnmount(): void;
18
+ UNSAFE_componentWillReceiveProps(nextProps: any): void;
19
+ render(): React.CElement<import("react-native").ViewProps, View>;
20
+ view: any;
21
+ }
22
+ import React from 'react';
23
+ declare class TimeoutHandler {
24
+ set handler(arg: any);
25
+ get handler(): any;
26
+ clear(): void;
27
+ }
28
+ import { View } from 'react-native';
29
+ export {};
@@ -0,0 +1 @@
1
+ export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, useLocalParticipantPermissions, useParticipantInfo, useParticipants, useRemoteParticipants, useRemoteParticipant, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useRoomInfo, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate } from "@livekit/components-react";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Registers the required globals needed for LiveKit to work.
3
+ *
4
+ * Must be called before using LiveKit.
5
+ */
6
+ export function registerGlobals(): void;
7
+ export * from "./hooks";
8
+ export * from "./components/LiveKitRoom";
9
+ export * from "./components/VideoTrack";
10
+ export * from "./components/VideoView";
11
+ export * from "./useParticipant";
12
+ export * from "./useRoom";
13
+ export * from "./logger";
14
+ export * from "./audio/AudioManager";
15
+ import AudioSession from './audio/AudioSession';
16
+ import { AndroidAudioTypePresets } from './audio/AudioSession';
17
+ import { getDefaultAppleAudioConfigurationForMode } from './audio/AudioSession';
18
+ export { AudioSession, AndroidAudioTypePresets, getDefaultAppleAudioConfigurationForMode };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Set the log level for both the `@livekit/react-native` package and the `@livekit-client` package.
3
+ * To set the `@livekit-client` log independently, use the `liveKitClientLogLevel` prop on the `options` object.
4
+ * @public
5
+ */
6
+ export function setLogLevel(level: any, options?: {}): void;
7
+ export const log: loglevel.Logger;
8
+ import loglevel from 'loglevel';
@@ -0,0 +1,13 @@
1
+ /** @deprecated use `useRemoteParticipant` or `useLocalParticipant` instead */
2
+ /** @deprecated use `useRemoteParticipant` or `useLocalParticipant` instead */
3
+ export function useParticipant(participant: any): {
4
+ isLocal: boolean;
5
+ isSpeaking: boolean;
6
+ connectionQuality: any;
7
+ publications: never[];
8
+ subscribedTracks: never[];
9
+ cameraPublication: any;
10
+ microphonePublication: any;
11
+ screenSharePublication: any;
12
+ metadata: undefined;
13
+ };
@@ -0,0 +1,15 @@
1
+ /** @deprecated wrap your components in a <LiveKitRoom> component instead and use more granular hooks to track state you're interested in */
2
+ export function useRoom(room: any, options: any): {
3
+ error: undefined;
4
+ participants: never[];
5
+ audioTracks: never[];
6
+ };
7
+ /**
8
+ * Default sort for participants, it'll order participants by:
9
+ * 1. dominant speaker (speaker with the loudest audio level)
10
+ * 2. local participant
11
+ * 3. other speakers that are recently active
12
+ * 4. participants with video on
13
+ * 5. by joinedAt
14
+ */
15
+ export function sortParticipants(participants: any, localParticipant: any): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -25,7 +25,7 @@
25
25
  *
26
26
  * By default, this is set to `"speaker"`
27
27
  */
28
- export declare type AudioConfiguration = {
28
+ export type AudioConfiguration = {
29
29
  android?: {
30
30
  preferredOutputList?: ('speaker' | 'earpiece' | 'headset' | 'bluetooth')[];
31
31
  audioTypeOptions: AndroidAudioTypeOptions;
@@ -34,7 +34,7 @@ export declare type AudioConfiguration = {
34
34
  defaultOutput?: 'speaker' | 'earpiece';
35
35
  };
36
36
  };
37
- export declare type AndroidAudioTypeOptions = {
37
+ export type AndroidAudioTypeOptions = {
38
38
  /**
39
39
  * Whether LiveKit should handle managing the audio focus or not.
40
40
  *
@@ -100,15 +100,15 @@ export declare const AndroidAudioTypePresets: {
100
100
  */
101
101
  media: AndroidAudioTypeOptions;
102
102
  };
103
- export declare type AppleAudioMode = 'default' | 'gameChat' | 'measurement' | 'moviePlayback' | 'spokenAudio' | 'videoChat' | 'videoRecording' | 'voiceChat' | 'voicePrompt';
104
- export declare type AppleAudioCategory = 'soloAmbient' | 'playback' | 'record' | 'playAndRecord' | 'multiRoute';
105
- export declare type AppleAudioCategoryOption = 'mixWithOthers' | 'duckOthers' | 'interruptSpokenAudioAndMixWithOthers' | 'allowBluetooth' | 'allowBluetoothA2DP' | 'allowAirPlay' | 'defaultToSpeaker';
106
- export declare type AppleAudioConfiguration = {
103
+ export type AppleAudioMode = 'default' | 'gameChat' | 'measurement' | 'moviePlayback' | 'spokenAudio' | 'videoChat' | 'videoRecording' | 'voiceChat' | 'voicePrompt';
104
+ export type AppleAudioCategory = 'soloAmbient' | 'playback' | 'record' | 'playAndRecord' | 'multiRoute';
105
+ export type AppleAudioCategoryOption = 'mixWithOthers' | 'duckOthers' | 'interruptSpokenAudioAndMixWithOthers' | 'allowBluetooth' | 'allowBluetoothA2DP' | 'allowAirPlay' | 'defaultToSpeaker';
106
+ export type AppleAudioConfiguration = {
107
107
  audioCategory?: AppleAudioCategory;
108
108
  audioCategoryOptions?: AppleAudioCategoryOption[];
109
109
  audioMode?: AppleAudioMode;
110
110
  };
111
- export declare type AudioTrackState = 'none' | 'remoteOnly' | 'localOnly' | 'localAndRemote';
111
+ export type AudioTrackState = 'none' | 'remoteOnly' | 'localOnly' | 'localAndRemote';
112
112
  export declare function getDefaultAppleAudioConfigurationForMode(mode: AudioTrackState, preferSpeakerOutput?: boolean): AppleAudioConfiguration;
113
113
  export default class AudioSession {
114
114
  /**
@@ -1,4 +1,4 @@
1
- import { FeatureFlags } from '@livekit/components-react';
1
+ import { type FeatureFlags } from '@livekit/components-react';
2
2
  import type { AudioCaptureOptions, RoomConnectOptions, RoomOptions, ScreenShareCaptureOptions, VideoCaptureOptions } from 'livekit-client';
3
3
  import type { MediaDeviceFailure, Room } from 'livekit-client';
4
4
  import * as React from 'react';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { ViewStyle } from 'react-native';
2
+ import { type ViewStyle } from 'react-native';
3
3
  import type { TrackReference } from '@livekit/components-react';
4
- export declare type VideoTrackProps = {
4
+ export type VideoTrackProps = {
5
5
  trackRef: TrackReference | undefined;
6
6
  style?: ViewStyle;
7
7
  objectFit?: 'cover' | 'contain' | undefined;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- import { VideoTrack } from 'livekit-client';
2
+ import { type ViewStyle } from 'react-native';
3
+ import { type VideoTrack } from 'livekit-client';
4
4
  /**
5
5
  * @deprecated use `VideoTrack` and `VideoTrackProps` instead.
6
6
  */
7
- export declare type Props = {
7
+ export type Props = {
8
8
  videoTrack?: VideoTrack | undefined;
9
9
  style?: ViewStyle;
10
10
  objectFit?: 'cover' | 'contain' | undefined;
@@ -1,6 +1,6 @@
1
- import React, { Component, PropsWithChildren } from 'react';
2
- import { AppStateStatus, ViewStyle } from 'react-native';
3
- export declare type Props = {
1
+ import React, { Component, type PropsWithChildren } from 'react';
2
+ import { type AppStateStatus, type ViewStyle } from 'react-native';
3
+ export type Props = {
4
4
  disabled?: boolean;
5
5
  style?: ViewStyle;
6
6
  onChange?: (isVisible: boolean) => void;
@@ -0,0 +1,3 @@
1
+ export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, useLocalParticipantPermissions, useParticipantInfo, useParticipants, useRemoteParticipants, useRemoteParticipant, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useRoomInfo, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate, } from '@livekit/components-react';
2
+ export type { UseLocalParticipantOptions, UseParticipantInfoOptions, UseParticipantsOptions, UseRemoteParticipantOptions, UseRemoteParticipantsOptions, UseTracksOptions, TrackReference, TrackReferenceOrPlaceholder, UseVisualStableUpdateOptions, } from '@livekit/components-react';
3
+ export type { ReceivedDataMessage } from '@livekit/components-core';
@@ -1,5 +1,5 @@
1
1
  import './polyfills/EncoderDecoderTogether.min.js';
2
- import AudioSession, { AndroidAudioTypePresets, AndroidAudioTypeOptions, AppleAudioCategory, AppleAudioCategoryOption, AppleAudioConfiguration, AppleAudioMode, AudioTrackState, getDefaultAppleAudioConfigurationForMode } from './audio/AudioSession';
2
+ import AudioSession, { AndroidAudioTypePresets, type AndroidAudioTypeOptions, type AppleAudioCategory, type AppleAudioCategoryOption, type AppleAudioConfiguration, type AppleAudioMode, type AudioTrackState, getDefaultAppleAudioConfigurationForMode } from './audio/AudioSession';
3
3
  import type { AudioConfiguration } from './audio/AudioSession';
4
4
  import type { LogLevel, SetLogLevelOptions } from './logger';
5
5
  /**
@@ -16,4 +16,5 @@ export * from './useParticipant';
16
16
  export * from './useRoom';
17
17
  export * from './logger';
18
18
  export * from './audio/AudioManager';
19
- export { AudioSession, AudioConfiguration, AndroidAudioTypeOptions, AndroidAudioTypePresets, AppleAudioCategory, AppleAudioCategoryOption, AppleAudioConfiguration, AppleAudioMode, AudioTrackState, getDefaultAppleAudioConfigurationForMode, LogLevel, SetLogLevelOptions, };
19
+ export { AudioSession, AndroidAudioTypePresets, getDefaultAppleAudioConfigurationForMode, };
20
+ export type { AudioConfiguration, AndroidAudioTypeOptions, AppleAudioCategory, AppleAudioCategoryOption, AppleAudioConfiguration, AppleAudioMode, AudioTrackState, LogLevel, SetLogLevelOptions, };
@@ -1,8 +1,8 @@
1
1
  import { setLogLevel as setClientSdkLogLevel } from 'livekit-client';
2
2
  import loglevel from 'loglevel';
3
3
  export declare const log: loglevel.Logger;
4
- export declare type LogLevel = Parameters<typeof setClientSdkLogLevel>[0];
5
- export declare type SetLogLevelOptions = {
4
+ export type LogLevel = Parameters<typeof setClientSdkLogLevel>[0];
5
+ export type SetLogLevelOptions = {
6
6
  liveKitClientLogLevel?: LogLevel;
7
7
  };
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { AudioTrack, LocalParticipant, Participant, Room } from 'livekit-client';
1
+ import { type AudioTrack, LocalParticipant, Participant, Room } from 'livekit-client';
2
2
  export interface RoomState {
3
3
  room?: Room;
4
4
  participants: Participant[];
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@livekit/react-native",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "LiveKit for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
7
+ "types": "lib/typescript/src/index.d.ts",
8
8
  "react-native": "src/index",
9
9
  "source": "src/index",
10
10
  "files": [
@@ -56,45 +56,49 @@
56
56
  "@babel/runtime": "^7.20.0",
57
57
  "@commitlint/config-conventional": "^16.2.1",
58
58
  "@livekit/react-native-webrtc": "^114.0.0",
59
- "@react-native-community/eslint-config": "^3.2.0",
59
+ "@react-native/babel-preset": "0.74.84",
60
+ "@react-native/eslint-config": "0.74.84",
61
+ "@react-native/metro-config": "0.74.84",
62
+ "@react-native/typescript-config": "0.74.84",
60
63
  "@release-it/conventional-changelog": "^4.2.0",
61
- "@tsconfig/react-native": "^2.0.2",
62
64
  "@types/fastestsmallesttextencoderdecoder": "^1.0.0",
63
- "@types/jest": "^29.2.1",
64
- "@types/react": "^18.0.24",
65
- "@types/react-native": "^0.71.3",
65
+ "@types/react": "^18.2.6",
66
+ "babel-jest": "^29.6.3",
66
67
  "commitlint": "^16.2.1",
67
68
  "eslint": "^8.23.0",
68
69
  "eslint-config-prettier": "^8.5.0",
69
70
  "eslint-plugin-ft-flow": "^2.0.3",
70
71
  "eslint-plugin-prettier": "^4.2.1",
71
72
  "husky": "^7.0.4",
72
- "jest": "^29.2.1",
73
- "pod-install": "^0.1.0",
74
- "prettier": "^2.5.1",
75
- "react": "18.0.0",
76
- "react-native": "0.71.13",
73
+ "jest": "^29.6.3",
74
+ "pod-install": "^0.2.2",
75
+ "prettier": "2.8.8",
76
+ "react": "18.2.0",
77
+ "react-native": "0.74.2",
77
78
  "react-native-builder-bob": "^0.18.2",
78
79
  "release-it": "^14.2.2",
79
- "typedoc": "^0.23.14",
80
- "typescript": "4.8.4"
80
+ "typedoc": "^0.25.13",
81
+ "typescript": "5.0.4"
81
82
  },
82
83
  "peerDependencies": {
83
- "@livekit/react-native-webrtc": "^114.1.3",
84
+ "@livekit/react-native-webrtc": "^125.0.0",
84
85
  "react": "*",
85
86
  "react-native": "*"
86
87
  },
87
88
  "scripts": {
88
89
  "test": "jest",
89
90
  "build-docs": "typedoc --tsconfig tsconfig.build.json",
90
- "typescript": "tsc --noEmit -p tsconfig.build.json",
91
+ "typescript": "tsc --noemit -p tsconfig.build.json",
91
92
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
92
93
  "prepare": "bob build",
93
94
  "release": "release-it",
94
95
  "example": "yarn --cwd example",
95
- "pods": "cd example && pod-install --quiet",
96
+ "pods": "cd example && pod-install --verbose",
96
97
  "bootstrap": "yarn example && yarn && yarn pods"
97
98
  },
99
+ "engines": {
100
+ "node": ">=18"
101
+ },
98
102
  "jest": {
99
103
  "preset": "react-native",
100
104
  "modulePathIgnorePatterns": [
@@ -132,7 +136,7 @@
132
136
  "hooks": {
133
137
  "before:init": [
134
138
  "yarn lint",
135
- "yarn test",
139
+ "yarn test --passWithNoTests",
136
140
  "yarn typescript"
137
141
  ],
138
142
  "after:bump": [
@@ -161,7 +165,7 @@
161
165
  "eslintConfig": {
162
166
  "root": true,
163
167
  "extends": [
164
- "@react-native-community",
168
+ "@react-native",
165
169
  "prettier"
166
170
  ],
167
171
  "rules": {
@@ -1,5 +1,5 @@
1
1
  import {
2
- FeatureFlags,
2
+ type FeatureFlags,
3
3
  LKFeatureContext,
4
4
  RoomContext,
5
5
  useLiveKitRoom,
@@ -1,8 +1,13 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';
4
3
  import {
5
- ElementInfo,
4
+ type LayoutChangeEvent,
5
+ StyleSheet,
6
+ View,
7
+ type ViewStyle,
8
+ } from 'react-native';
9
+ import {
10
+ type ElementInfo,
6
11
  LocalVideoTrack,
7
12
  Track,
8
13
  TrackEvent,
@@ -1,12 +1,17 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';
4
3
  import {
5
- ElementInfo,
4
+ type LayoutChangeEvent,
5
+ StyleSheet,
6
+ View,
7
+ type ViewStyle,
8
+ } from 'react-native';
9
+ import {
10
+ type ElementInfo,
6
11
  LocalVideoTrack,
7
12
  Track,
8
13
  TrackEvent,
9
- VideoTrack,
14
+ type VideoTrack,
10
15
  } from 'livekit-client';
11
16
  import { RTCView } from '@livekit/react-native-webrtc';
12
17
  import { useCallback, useEffect, useMemo, useState } from 'react';
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- import React, { Component, PropsWithChildren } from 'react';
3
+ import React, { Component, type PropsWithChildren } from 'react';
4
4
  import {
5
5
  AppState,
6
- AppStateStatus,
7
- NativeEventSubscription,
6
+ type AppStateStatus,
7
+ type NativeEventSubscription,
8
8
  View,
9
- ViewStyle,
9
+ type ViewStyle,
10
10
  } from 'react-native';
11
11
 
12
12
  const DEFAULT_DELAY = 1000;
package/src/hooks.ts CHANGED
@@ -3,16 +3,11 @@ export {
3
3
  useDataChannel,
4
4
  useIsSpeaking,
5
5
  useLocalParticipant,
6
- UseLocalParticipantOptions,
7
6
  useLocalParticipantPermissions,
8
7
  useParticipantInfo,
9
- UseParticipantInfoOptions,
10
8
  useParticipants,
11
- UseParticipantsOptions,
12
9
  useRemoteParticipants,
13
- UseRemoteParticipantOptions,
14
10
  useRemoteParticipant,
15
- UseRemoteParticipantsOptions,
16
11
  useSpeakingParticipants,
17
12
  useSortedParticipants,
18
13
  useChat,
@@ -28,14 +23,21 @@ export {
28
23
  TrackRefContext,
29
24
  useTrackRefContext,
30
25
  useTracks,
31
- UseTracksOptions,
32
- TrackReference,
33
- TrackReferenceOrPlaceholder,
34
26
  isTrackReference,
35
27
  useEnsureTrackRef,
36
28
  useTrackMutedIndicator,
37
29
  useVisualStableUpdate,
30
+ } from '@livekit/components-react';
31
+ export type {
32
+ UseLocalParticipantOptions,
33
+ UseParticipantInfoOptions,
34
+ UseParticipantsOptions,
35
+ UseRemoteParticipantOptions,
36
+ UseRemoteParticipantsOptions,
37
+ UseTracksOptions,
38
+ TrackReference,
39
+ TrackReferenceOrPlaceholder,
38
40
  UseVisualStableUpdateOptions,
39
41
  } from '@livekit/components-react';
40
42
 
41
- export { ReceivedDataMessage } from '@livekit/components-core';
43
+ export type { ReceivedDataMessage } from '@livekit/components-core';
package/src/index.tsx CHANGED
@@ -3,12 +3,12 @@ import { setupURLPolyfill } from 'react-native-url-polyfill';
3
3
  import './polyfills/EncoderDecoderTogether.min.js';
4
4
  import AudioSession, {
5
5
  AndroidAudioTypePresets,
6
- AndroidAudioTypeOptions,
7
- AppleAudioCategory,
8
- AppleAudioCategoryOption,
9
- AppleAudioConfiguration,
10
- AppleAudioMode,
11
- AudioTrackState,
6
+ type AndroidAudioTypeOptions,
7
+ type AppleAudioCategory,
8
+ type AppleAudioCategoryOption,
9
+ type AppleAudioConfiguration,
10
+ type AppleAudioMode,
11
+ type AudioTrackState,
12
12
  getDefaultAppleAudioConfigurationForMode,
13
13
  } from './audio/AudioSession';
14
14
  import type { AudioConfiguration } from './audio/AudioSession';
@@ -85,15 +85,17 @@ export * from './audio/AudioManager';
85
85
 
86
86
  export {
87
87
  AudioSession,
88
+ AndroidAudioTypePresets,
89
+ getDefaultAppleAudioConfigurationForMode,
90
+ };
91
+ export type {
88
92
  AudioConfiguration,
89
93
  AndroidAudioTypeOptions,
90
- AndroidAudioTypePresets,
91
94
  AppleAudioCategory,
92
95
  AppleAudioCategoryOption,
93
96
  AppleAudioConfiguration,
94
97
  AppleAudioMode,
95
98
  AudioTrackState,
96
- getDefaultAppleAudioConfigurationForMode,
97
99
  LogLevel,
98
100
  SetLogLevelOptions,
99
101
  };