From 7f6240ff18e0a0dff3b5ee0a670faa2fe2c5d4dc Mon Sep 17 00:00:00 2001 From: Benjamin Cirmena Date: Mon, 24 Jul 2023 15:45:47 +0200 Subject: [PATCH] Typescript: Missing type for onError (#29) * add missing type for onError prop * add missing type for onError prop --- src/Datatrans.ts | 2 +- src/Lightbox.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Datatrans.ts b/src/Datatrans.ts index 2109faf..f484118 100644 --- a/src/Datatrans.ts +++ b/src/Datatrans.ts @@ -22,7 +22,7 @@ export interface GlobalDatatransApi { */ export interface DatatransLightboxConfig { closed?: () => void; - error?: () => void; + error?: (error: { message: string; detail: string }) => void; form?: unknown; loaded?: () => void; opened?: () => void; diff --git a/src/Lightbox.tsx b/src/Lightbox.tsx index 744d728..ec2c9a0 100644 --- a/src/Lightbox.tsx +++ b/src/Lightbox.tsx @@ -12,7 +12,7 @@ export interface LightboxProps { onLoaded?: () => void onOpened?: () => void onCancelled?: () => void - onError?: () => void + onError?: (error: { message: string; detail: string }) => void } declare let window: Window & {