Skip to content

Commit

Permalink
fix(type): fix type for codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
YangJonghun committed Jul 1, 2024
1 parent 0a6c216 commit be60e18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/specs/NativeVideoDecoderProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
import type {Int32} from 'react-native/Libraries/Types/CodegenTypes';

export interface NativeVideoDecoderPropertiesSpec extends TurboModule {
interface Spec extends TurboModule {
getWidevineLevel: () => Promise<Int32>;
isCodecSupported: (
mimeType: string,
Expand All @@ -12,6 +12,6 @@ export interface NativeVideoDecoderPropertiesSpec extends TurboModule {
isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>;
}

export default TurboModuleRegistry.getEnforcing<NativeVideoDecoderPropertiesSpec>(
export default TurboModuleRegistry.getEnforcing<Spec>(
'RNVDecoderPropertiesModule',
);
6 changes: 2 additions & 4 deletions src/specs/NativeVideoManagerModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ export type VideoSaveData = {
uri: string;
};

export interface NativeVideoManagerModuleSpec extends TurboModule {
interface Spec extends TurboModule {
save: (reactTag: Int32, option: UnsafeObject) => Promise<VideoSaveData>;
getCurrentPosition: (reactTag: Int32) => Promise<Int32>;
}

export default TurboModuleRegistry.getEnforcing<NativeVideoManagerModuleSpec>(
'VideoManager',
);
export default TurboModuleRegistry.getEnforcing<Spec>('VideoManager');
16 changes: 9 additions & 7 deletions src/specs/VideoNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,30 +370,32 @@ export interface VideoNativeProps extends ViewProps {
}

type NativeVideoComponentType = HostComponent<VideoNativeProps>;
type NativeVideoComponentRefType = React.ElementRef<NativeVideoComponentType>;

export interface NativeVideoCommands {
seek: (
viewRef: NativeVideoComponentRefType,
viewRef: React.ElementRef<NativeVideoComponentType>,
time: Float,
tolerance?: Float,
) => void;
setPlayerPauseState: (
viewRef: NativeVideoComponentRefType,
viewRef: React.ElementRef<NativeVideoComponentType>,
paused: boolean,
) => void;
setVolume: (viewRef: NativeVideoComponentRefType, volume: Float) => void;
setVolume: (
viewRef: React.ElementRef<NativeVideoComponentType>,
volume: Float,
) => void;
setFullScreen: (
viewRef: NativeVideoComponentRefType,
viewRef: React.ElementRef<NativeVideoComponentType>,
fullScreen: boolean,
) => void;
setLicenseResult: (
viewRef: NativeVideoComponentRefType,
viewRef: React.ElementRef<NativeVideoComponentType>,
result: string,
licenseUrl: string,
) => void;
setLicenseResultError: (
viewRef: NativeVideoComponentRefType,
viewRef: React.ElementRef<NativeVideoComponentType>,
error: string,
licenseUrl: string,
) => void;
Expand Down

0 comments on commit be60e18

Please sign in to comment.