Skip to content

Commit

Permalink
chor: fix linttr warning
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier committed Oct 18, 2023
1 parent 1acdc6e commit 8526d15
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 54 deletions.
8 changes: 5 additions & 3 deletions src/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import React, {
type ComponentRef,
} from 'react';
import {View, StyleSheet, Image, Platform} from 'react-native';
import NativeVideoComponent, { type VideoComponentType } from './VideoNativeComponent';
import NativeVideoComponent, {
type VideoComponentType,
} from './VideoNativeComponent';

import type {StyleProp, ImageStyle, NativeSyntheticEvent} from 'react-native';
import type {ReactVideoProps} from './types/video';
import {getReactTag, resolveAssetSourceForVideo} from './utils';
import { VideoManager } from './VideoNativeComponent';
import {VideoManager} from './VideoNativeComponent';
import type {
OnAudioFocusChangedData,
OnAudioTracksData,
Expand All @@ -31,7 +33,7 @@ import type {
OnTextTracksData,
OnTimedMetadataData,
OnVideoErrorData,
OnVideoTracksData
OnVideoTracksData,
} from './types/events';

export interface VideoRef {
Expand Down
10 changes: 6 additions & 4 deletions src/VideoNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import type {
SelectedVideoTrack,
SubtitleStyle,
BufferConfig,
SelectedAudioTrack
} from './types/video'
SelectedAudioTrack,
} from './types/video';
import {NativeModules, requireNativeComponent} from 'react-native';
import type {
OnAudioFocusChangedData,
Expand All @@ -34,7 +34,7 @@ import type {
OnTimedMetadataData,
OnVideoAspectRatioData,
OnVideoErrorData,
OnVideoTracksData
OnVideoTracksData,
} from './types/events';
import type ResizeMode from './types/ResizeMode';
import type FilterType from 'react-native-video/src/types/FilterType';
Expand Down Expand Up @@ -109,7 +109,9 @@ export interface VideoNativeProps extends ViewProps {
useSecureView?: boolean; // Android
onVideoLoad?: (event: NativeSyntheticEvent<OnLoadData>) => void;
onVideoLoadStart?: (event: NativeSyntheticEvent<OnLoadStartData>) => void;
onVideoAspectRatio?: (event: NativeSyntheticEvent<OnVideoAspectRatioData>) => void;
onVideoAspectRatio?: (
event: NativeSyntheticEvent<OnVideoAspectRatioData>,
) => void;
onVideoBuffer?: (event: NativeSyntheticEvent<OnVideoBufferData>) => void;
onVideoError?: (event: NativeSyntheticEvent<OnVideoErrorData>) => void;
onVideoProgress?: (event: NativeSyntheticEvent<OnProgressData>) => void;
Expand Down
6 changes: 3 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export {VideoDecoderProperties} from './VideoNativeComponent';
export * from './types/FilterType';
export * from './types/TextTrackType';
export * from './VideoNativeComponent';
export * from './types/events'
export * from './types/language'
export * from './types/video'
export * from './types/events';
export * from './types/language';
export * from './types/video';
export type {VideoRef} from './Video';
export default Video;
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export {VideoDecoderProperties} from './VideoNativeComponent';
export * from './types/FilterType';
export * from './types/TextTrackType';
export * from './VideoNativeComponent';
export * from './types/events'
export * from './types/language'
export * from './types/video'
export * from './types/events';
export * from './types/language';
export * from './types/video';
export type {VideoRef} from './Video';

export default Video;
4 changes: 2 additions & 2 deletions src/types/FilterType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ enum FilterType {
TONAL = 'CIPhotoEffectTonal',
TRANSFER = 'CIPhotoEffectTransfer',
SEPIA = 'CISepiaTone',
};
}

export default FilterType
export default FilterType;
4 changes: 2 additions & 2 deletions src/types/Orientation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enum Orientation {
PORTRAIT = 'portrait',
LANDSCAPE = 'landscape',
};
}

export default Orientation
export default Orientation;
1 change: 0 additions & 1 deletion src/types/ResizeMode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

enum ResizeMode {
NONE = 'none',
CONTAIN = 'contain',
Expand Down
4 changes: 2 additions & 2 deletions src/types/TextTrackType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ enum TextTrackType {
SRT = 'application/x-subrip',
TTML = 'application/ttml+xml',
VTT = 'text/vtt',
};
}

export default TextTrackType
export default TextTrackType;
42 changes: 21 additions & 21 deletions src/types/events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type Orientation from "./Orientation";
import type Orientation from './Orientation';

export type OnLoadData = Readonly<{
currentTime: number;
Expand All @@ -8,11 +8,13 @@ export type OnLoadData = Readonly<{
height: number;
orientation: Orientation;
}>;
}> & OnAudioTracksData & OnTextTracksData;
}> &
OnAudioTracksData &
OnTextTracksData;

export type OnVideoAspectRatioData = Readonly<{
width: number,
height: number,
width: number;
height: number;
}>;

export type OnLoadStartData = Readonly<{
Expand Down Expand Up @@ -45,23 +47,21 @@ export type OnTimedMetadataData = Readonly<{
>;
}>;


export type AudioTrack = Readonly<{
index: number;
title?: string;
language?: string;
bitrate?: number;
type?: string;
selected?: boolean;
}
>;
index: number;
title?: string;
language?: string;
bitrate?: number;
type?: string;
selected?: boolean;
}>;

export type OnAudioTracksData = Readonly<{
audioTracks: ReadonlyArray<AudioTrack>
audioTracks: ReadonlyArray<AudioTrack>;
}>;

export enum OnTextTracksTypeData {
SRT ='srt',
SRT = 'srt',
TTML = 'ttml',
VTT = 'vtt',
}
Expand All @@ -72,7 +72,7 @@ export type TextTrack = Readonly<{
language?: string;
type?: OnTextTracksTypeData;
selected?: boolean;
}>
}>;

export type OnTextTracksData = Readonly<{
textTracks: ReadonlyArray<TextTrack>;
Expand Down Expand Up @@ -114,10 +114,10 @@ export type OnReceiveAdEventData = Readonly<{
}>;

export type OnVideoErrorData = Readonly<{
errorString: string
errorException: string
errorStackTrace: string
errorCode: string
errorString: string;
errorException: string;
errorStackTrace: string;
errorCode: string;
error: string;
}>;

Expand Down Expand Up @@ -160,5 +160,5 @@ export interface ReactVideoEvents {
onAudioTracks?: (e: OnAudioTracksData) => void; // Android
onTextTracks?: (e: OnTextTracksData) => void; //Android
onVideoTracks?: (e: OnVideoTracksData) => void; //Android
onVideoAspectRatio?: (e: OnVideoAspectRatioData) => void
onVideoAspectRatio?: (e: OnVideoAspectRatioData) => void;
}
36 changes: 23 additions & 13 deletions src/types/video.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {ISO639_1} from './language';
import type {ReactVideoEvents} from './events';
import type {StyleProp, ViewStyle} from 'react-native';
import type VideoResizeMode from './ResizeMode'
import type FilterType from './FilterType'
import type VideoResizeMode from './ResizeMode';
import type FilterType from './FilterType';

export type Headers = Record<string, string>;

Expand Down Expand Up @@ -107,14 +107,24 @@ export type TextTracks = {
uri: string;
}[];

export type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index';
export type TextTrackType =
| 'system'
| 'disabled'
| 'title'
| 'language'
| 'index';

export type SelectedTextTrack = Readonly<{
type: TextTrackType;
value?: string | number;
}>;

export type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index';
export type AudioTrackType =
| 'system'
| 'disabled'
| 'title'
| 'language'
| 'index';

export type SelectedAudioTrack = Readonly<{
type: AudioTrackType;
Expand All @@ -141,18 +151,18 @@ export enum IgnoreSilentSwitchType {
}

export enum MixWithOthersType {
INHERIT = 'inherit',
MIX = 'mix',
DUCK = 'duck',
INHERIT = 'inherit',
MIX = 'mix',
DUCK = 'duck',
}

export enum PosterResizeModeType {
CONTAIN = 'contain',
CENTER = 'center',
COVER = 'cover',
NONE = 'none',
REPEAT = 'repeat',
STRETCH = 'stretch',
CONTAIN = 'contain',
CENTER = 'center',
COVER = 'cover',
NONE = 'none',
REPEAT = 'repeat',
STRETCH = 'stretch',
}

export interface ReactVideoProps extends ReactVideoEvents {
Expand Down

0 comments on commit 8526d15

Please sign in to comment.