Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the mobile SDK’s public API typings to better match React Native runtime behavior by re-typing the useCamera hook’s cameraStream as React Native WebRTC’s MediaStream rather than the web DOM MediaStream.
Changes:
- Re-export
useCamerafrom@fishjam-cloud/react-clientwith an overridden return type socameraStreamis typed asRNMediaStream | null. - Adjust imports/exports in the mobile client entrypoint to support the new typing.
Comments suppressed due to low confidence (1)
packages/mobile-client/src/index.ts:69
useCamerais re-typed to return an RNMediaStream, butuseMicrophonestill exposesmicrophoneStreamfrom@fishjam-cloud/react-client, which is also constructed vianew MediaStream(...)and will remain typed as the webMediaStreamfor React Native consumers. Consider applying the same return-type override pattern touseMicrophone(formicrophoneStream) to avoid inconsistent/incorrect stream types in the mobile SDK API surface.
export const useMicrophone = useMicrophoneReactClient as () => Omit<
ReturnType<typeof useMicrophoneReactClient>,
'toggleMicrophoneMute'
>;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
MediaStreamtypes withRNMediaStreamfrom@fishjam-cloud/react-native-webrtcacross the mobile client packageuseCamera,useMicrophone,useScreenShare,useCustomSource,useLivestreamStreamer,useLivestreamViewer) into a newoverrides/hooks.tsmodule with corrected RN-specific stream typesoverrides/types.tswith mobile-specific type aliases (Track,CustomSource,InitializeDevicesResult, etc.) that replace webMediaStreamwithRNMediaStreamRTCView/RTCPIPViewprops to useRNMediaStreaminstead of the globalMediaStreamMotivation and Context
The mobile client was using the web
MediaStreamtype in several places, causing type mismatches on React Native where the actual runtime object isRNMediaStream. This centralises all stream-type overrides and fixes the incorrect types.Documentation impact
Types of changes
not work as expected)