From fdbd6a6ba8aef2da854ff7b0fbf25085ce6983e3 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Thu, 16 Nov 2023 08:40:14 +0100 Subject: [PATCH] fix: update onError definition to match implementation (#3349) Co-authored-by: olivier --- src/VideoNativeComponent.ts | 20 +++++++++++++++----- src/types/events.ts | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/VideoNativeComponent.ts b/src/VideoNativeComponent.ts index 8e6b279296..c13991c9d3 100644 --- a/src/VideoNativeComponent.ts +++ b/src/VideoNativeComponent.ts @@ -241,11 +241,21 @@ export type OnReceiveAdEventData = Readonly<{ }>; export type OnVideoErrorData = Readonly<{ - errorString: string; - errorException: string; - errorStackTrace: string; - errorCode: string; - error: string; + error: OnVideoErrorDataDetails; + target?: number; // ios +}>; + +export type OnVideoErrorDataDetails = Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: number; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios }>; export type OnAudioFocusChangedData = Readonly<{ diff --git a/src/types/events.ts b/src/types/events.ts index 6da4856f8a..d0437c1e1a 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -118,13 +118,22 @@ export type OnReceiveAdEventData = Readonly<{ }>; export type OnVideoErrorData = Readonly<{ - errorString: string; - errorException: string; - errorStackTrace: string; - errorCode: string; - error: string; + error: OnVideoErrorDataDetails; + target?: number; // ios +}>; + +export type OnVideoErrorDataDetails = Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: number; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios }>; - export type OnAudioFocusChangedData = Readonly<{ hasAudioFocus: boolean; }>;