From c9f6a9254592e66c3b9382aa2bebf35dc1ed7c10 Mon Sep 17 00:00:00 2001 From: yungblud Date: Sat, 20 Jan 2024 13:48:17 +0900 Subject: [PATCH] feat: support array param types on event callback function codegen types --- src/specs/VideoNativeComponent.ts | 87 +++++++++++-------------------- 1 file changed, 30 insertions(+), 57 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 1606cb440d..05cb0605a2 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -158,74 +158,47 @@ export type OnPlaybackStateChangedData = Readonly<{ }>; export type OnTimedMetadataData = Readonly<{ - metadata: Readonly<{}>; + metadata: { + value?: string; + identifier: string; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnTimedMetadataData = Readonly<{ -// metadata: ReadonlyArray< -// Readonly<{ -// value?: string; -// identifier: string; -// }> -// >; -// }>; export type OnAudioTracksData = Readonly<{ - audioTracks: Readonly<{}>; + audioTracks: { + index: Int32; + title?: string; + language?: string; + bitrate?: Float; + type?: string; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnAudioTracksData = Readonly<{ -// audioTracks: ReadonlyArray< -// Readonly<{ -// index: Int32; -// title?: string; -// language?: string; -// bitrate?: Float; -// type?: string; -// selected?: boolean; -// }> -// >; -// }>; - export type OnTextTracksData = Readonly<{ - textTracks: Readonly<{}>; + textTracks: { + index: Int32; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnTextTracksData = Readonly<{ -// textTracks: ReadonlyArray< -// Readonly<{ -// index: Int32; -// title?: string; -// language?: string; -// /** -// * iOS only supports VTT, Android supports all 3 -// */ -// type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; -// selected?: boolean; -// }> -// >; -// }>; - export type OnVideoTracksData = Readonly<{ - videoTracks: Readonly<{}>; + videoTracks: { + trackId: Int32; + codecs?: string; + width?: Float; + height?: Float; + bitrate?: Float; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnVideoTracksData = Readonly<{ -// videoTracks: ReadonlyArray< -// Readonly<{ -// trackId: Int32; -// codecs?: string; -// width?: Float; -// height?: Float; -// bitrate?: Float; -// selected?: boolean; -// }> -// >; -// }>; - export type OnPlaybackData = Readonly<{ playbackRate: Float; }>;