From 55e645824d7de10cdb2d68e12f34b2702a6c83a0 Mon Sep 17 00:00:00 2001 From: Piotr Wyrobek Date: Mon, 16 Oct 2023 13:27:22 +0200 Subject: [PATCH] loading events added --- lib/bundle.d.ts | 9 ++++++++- src/index.d.ts | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/bundle.d.ts b/lib/bundle.d.ts index b7125cc..efc353d 100644 --- a/lib/bundle.d.ts +++ b/lib/bundle.d.ts @@ -81,6 +81,12 @@ type ErrorCode = | 'server_unavailable' | FatalErrorCode +type FlowEvent = 'loadingComplete'; +type FlowEventType = { + name: FlowEvent; + payload?: string | number | boolean; +} + interface MainPageSideConfig { apiUrl: string, containerId: string, @@ -93,6 +99,7 @@ interface MainPageSideConfig { onVerificationComplete?: OnVerificationComplete, acceptableDocuments?: AcceptableDocuments, onFatalError?: (code: FatalErrorCode) => void + onFlowEvent?: (event: FlowEventType) => void, profile?: Array locale?: string, customerId?: string, @@ -125,4 +132,4 @@ declare global { } } -export { GetIdWebSdkComponent, PageSideConfig, PoaParsedAddress, getLinkScriptResponse, init }; +export { FlowEvent, FlowEventType, GetIdWebSdkComponent, PageSideConfig, PoaParsedAddress, getLinkScriptResponse, init }; diff --git a/src/index.d.ts b/src/index.d.ts index 275f26f..4fafe90 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -81,6 +81,12 @@ type ErrorCode = | 'server_unavailable' | FatalErrorCode +export type FlowEvent = 'loadingComplete'; +export type FlowEventType = { + name: FlowEvent; + payload?: string | number | boolean; +} + interface MainPageSideConfig { apiUrl: string, containerId: string, @@ -93,6 +99,7 @@ interface MainPageSideConfig { onVerificationComplete?: OnVerificationComplete, acceptableDocuments?: AcceptableDocuments, onFatalError?: (code: FatalErrorCode) => void + onFlowEvent?: (event: FlowEventType) => void, profile?: Array locale?: string, customerId?: string,