Move video ref type to its own file

This commit is contained in:
Zoe Roux 2024-06-30 09:38:10 +00:00
parent fa126de97f
commit a72ab331dc
No known key found for this signature in database
5 changed files with 21 additions and 7 deletions

View File

@ -37,8 +37,7 @@ import {
resolveAssetSourceForVideo,
} from './utils';
import NativeVideoManager from './specs/NativeVideoManager';
import type {VideoSaveData} from './specs/NativeVideoManager';
import {ViewType} from './types';
import {ViewType, type VideoSaveData} from './types';
import type {
OnLoadData,
OnTextTracksData,

View File

@ -1,5 +1,4 @@
import Video from './Video';
export {VideoDecoderProperties} from './VideoDecoderProperties';
export type * from './types';
export type {VideoRef} from './Video';
export default Video;

View File

@ -4,10 +4,7 @@ import type {
Float,
UnsafeObject,
} from 'react-native/Libraries/Types/CodegenTypes';
export type VideoSaveData = {
uri: string;
};
import type {VideoSaveData} from '../types/video-ref';
// @TODO rename to "Spec" when applying new arch
export interface VideoManagerType {

View File

@ -7,4 +7,5 @@ export {default as ResizeMode} from './ResizeMode';
export {default as TextTrackType} from './TextTrackType';
export {default as ViewType} from './ViewType';
export * from './video';
export * from './video-ref';
export * from '../specs/VideoNativeComponent';

18
src/types/video-ref.ts Normal file
View File

@ -0,0 +1,18 @@
export type VideoSaveData = {
uri: string;
};
export interface VideoRef {
seek: (time: number, tolerance?: number) => void;
resume: () => void;
pause: () => void;
presentFullscreenPlayer: () => void;
dismissFullscreenPlayer: () => void;
restoreUserInterfaceForPictureInPictureStopCompleted: (
restore: boolean,
) => void;
save: (options: object) => Promise<VideoSaveData>;
setVolume: (volume: number) => void;
getCurrentPosition: () => Promise<number>;
setFullScreen: (fullScreen: boolean) => void;
}