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,