react-native-visit-rn-sdk 6.0.2 → 6.0.3

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 (45) hide show
  1. package/README.md +45 -14
  2. package/lib/commonjs/components/VideoCallComponent.js +11 -16
  3. package/lib/commonjs/components/VideoCallComponent.js.map +1 -1
  4. package/lib/commonjs/index.android.js +43 -13
  5. package/lib/commonjs/index.android.js.map +1 -1
  6. package/lib/commonjs/index.ios.js +73 -37
  7. package/lib/commonjs/index.ios.js.map +1 -1
  8. package/lib/commonjs/index.js +6 -0
  9. package/lib/commonjs/index.js.map +1 -0
  10. package/lib/commonjs/shims.d.js +2 -0
  11. package/lib/commonjs/shims.d.js.map +1 -0
  12. package/lib/commonjs/types.js +2 -0
  13. package/lib/commonjs/types.js.map +1 -0
  14. package/lib/module/components/VideoCallComponent.js +11 -16
  15. package/lib/module/components/VideoCallComponent.js.map +1 -1
  16. package/lib/module/index.android.js +44 -14
  17. package/lib/module/index.android.js.map +1 -1
  18. package/lib/module/index.ios.js +74 -38
  19. package/lib/module/index.ios.js.map +1 -1
  20. package/lib/module/index.js +2 -0
  21. package/lib/module/index.js.map +1 -0
  22. package/lib/module/shims.d.js +2 -0
  23. package/lib/module/shims.d.js.map +1 -0
  24. package/lib/module/types.js +2 -0
  25. package/lib/module/types.js.map +1 -0
  26. package/lib/typescript/components/VideoCallComponent.d.ts +77 -2
  27. package/lib/typescript/components/VideoCallComponent.d.ts.map +1 -1
  28. package/lib/typescript/index.android.d.ts +3 -11
  29. package/lib/typescript/index.android.d.ts.map +1 -1
  30. package/lib/typescript/index.d.ts +17 -0
  31. package/lib/typescript/index.d.ts.map +1 -0
  32. package/lib/typescript/index.ios.d.ts +3 -11
  33. package/lib/typescript/index.ios.d.ts.map +1 -1
  34. package/lib/typescript/types.d.ts +24 -0
  35. package/lib/typescript/types.d.ts.map +1 -0
  36. package/package.json +11 -7
  37. package/src/components/VideoCallComponent.tsx +1484 -0
  38. package/src/index.android.tsx +459 -0
  39. package/src/index.ios.tsx +238 -0
  40. package/src/index.tsx +25 -0
  41. package/src/shims.d.ts +49 -0
  42. package/src/types.ts +25 -0
  43. package/src/components/VideoCallComponent.js +0 -1305
  44. package/src/index.android.js +0 -362
  45. package/src/index.ios.js +0 -157
package/src/index.tsx ADDED
@@ -0,0 +1,25 @@
1
+ import type { Ref } from 'react';
2
+ import type { VisitRnSdkViewHandle, VisitRnSdkViewProps } from './types';
3
+
4
+ export type {
5
+ VisitEventProperties,
6
+ VisitRnSdkViewHandle,
7
+ VisitRnSdkViewProps,
8
+ } from './types';
9
+
10
+ /**
11
+ * Platform-neutral entry used by TypeScript and react-native-builder-bob.
12
+ * Metro resolves `src/index` to `index.android.tsx` / `index.ios.tsx` at runtime,
13
+ * so this file only exists to publish shared typings.
14
+ *
15
+ * Return type is intentionally loose so host apps on different React /
16
+ * `@types/react` versions can use this as a JSX component without
17
+ * conflicting ReactElement definitions.
18
+ */
19
+ declare const VisitRnSdkView: (
20
+ props: VisitRnSdkViewProps & {
21
+ ref?: Ref<VisitRnSdkViewHandle>;
22
+ }
23
+ ) => any;
24
+
25
+ export default VisitRnSdkView;
package/src/shims.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ declare module '@twilio/video-react-native-sdk' {
2
+ import type { ComponentType, Ref } from 'react';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+
5
+ export type TwilioVideoProps = {
6
+ ref?: Ref<unknown>;
7
+ onRoomDidConnect?: (event: any) => void;
8
+ onRoomDidDisconnect?: (event: any) => void;
9
+ onRoomDidFailToConnect?: (event: any) => void;
10
+ onParticipantAddedVideoTrack?: (event: any) => void;
11
+ onParticipantRemovedVideoTrack?: (event: any) => void;
12
+ onParticipantDisabledVideoTrack?: (event: any) => void;
13
+ onParticipantEnabledVideoTrack?: (event: any) => void;
14
+ onParticipantAddedAudioTrack?: (event: any) => void;
15
+ onParticipantEnabledAudioTrack?: (event: any) => void;
16
+ onParticipantDisabledAudioTrack?: (event: any) => void;
17
+ onNetworkQualityLevelsChanged?: (event: any) => void;
18
+ onRoomReconnectingWithError?: (event?: any) => void;
19
+ onRoomParticipantIsReconnecting?: () => void;
20
+ onRoomParticipantReconnected?: () => void;
21
+ };
22
+
23
+ export const TwilioVideo: ComponentType<TwilioVideoProps>;
24
+
25
+ export const TwilioVideoLocalView: ComponentType<{
26
+ enabled?: boolean;
27
+ style?: StyleProp<ViewStyle>;
28
+ }>;
29
+
30
+ export const TwilioVideoParticipantView: ComponentType<{
31
+ style?: StyleProp<ViewStyle>;
32
+ trackIdentifier?: {
33
+ participantSid: string;
34
+ videoTrackSid: string;
35
+ } | null;
36
+ }>;
37
+ }
38
+
39
+ declare module '*.png' {
40
+ import type { ImageSourcePropType } from 'react-native';
41
+ const value: ImageSourcePropType;
42
+ export default value;
43
+ }
44
+
45
+ declare module '*.gif' {
46
+ import type { ImageSourcePropType } from 'react-native';
47
+ const value: ImageSourcePropType;
48
+ export default value;
49
+ }
package/src/types.ts ADDED
@@ -0,0 +1,25 @@
1
+ export type VisitEventProperties = Record<string, unknown>;
2
+
3
+ export type VisitRnSdkViewHandle = {
4
+ /**
5
+ * Sends a generic event into the Visit PWA. The PWA must implement
6
+ * `window.sendEventToVisit(eventName, properties)`.
7
+ */
8
+ sendEvent: (eventName: string, properties?: VisitEventProperties) => void;
9
+ };
10
+
11
+ export type VisitRnSdkViewProps = {
12
+ /**
13
+ * Pre-generated Visit SSO URL used as the WebView source.
14
+ */
15
+ ssoLink?: string;
16
+ /**
17
+ * When true, the SDK logs diagnostic messages. Defaults to false.
18
+ */
19
+ isLoggingEnabled?: boolean;
20
+ /**
21
+ * Called for host-facing PWA messages (`sendEventToHost`).
22
+ * Built-in methods stay internal.
23
+ */
24
+ onEvent?: (eventName: string, properties?: VisitEventProperties) => void;
25
+ };