forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#37134 from software-mansion-labs/ts-migr…
…ation-videoplayercontext [TS migration] Migrate VideoPlayerContexts component files to TypeScript
- Loading branch information
Showing
9 changed files
with
104 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type {Video} from 'expo-av'; | ||
import type {MutableRefObject} from 'react'; | ||
import type {View} from 'react-native'; | ||
import type {SharedValue} from 'react-native-reanimated'; | ||
import type {PopoverMenuItem} from '@components/PopoverMenu'; | ||
import type CONST from '@src/CONST'; | ||
|
||
type PlaybackContext = { | ||
updateCurrentlyPlayingURL: (url: string) => void; | ||
currentlyPlayingURL: string | null; | ||
originalParent: View | null; | ||
sharedElement: View | null; | ||
currentVideoPlayerRef: MutableRefObject<Video | null>; | ||
shareVideoPlayerElements: (ref: Video, parent: View, child: View, isUploading: boolean) => void; | ||
playVideo: () => void; | ||
pauseVideo: () => void; | ||
checkVideoPlaying: (statusCallback: StatusCallback) => void; | ||
}; | ||
|
||
type VolumeContext = { | ||
updateVolume: (newVolume: number) => void; | ||
volume: SharedValue<number>; | ||
}; | ||
|
||
type VideoPopoverMenuContext = { | ||
menuItems: PopoverMenuItem[]; | ||
updatePlaybackSpeed: (speed: PlaybackSpeed) => void; | ||
}; | ||
|
||
type StatusCallback = (isPlaying: boolean) => void; | ||
|
||
type PlaybackSpeed = (typeof CONST.VIDEO_PLAYER.PLAYBACK_SPEEDS)[number]; | ||
|
||
export type {PlaybackContext, VolumeContext, VideoPopoverMenuContext, StatusCallback, PlaybackSpeed}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.