import type { CorbadoError, EmailVerifyFromUrl, ProcessResponse } from '@corbado/web-core'; import { type CorbadoApp } from '@corbado/web-core'; import type { GeneralBlockCompleted } from '@corbado/web-core/dist/api/v2'; import type { i18n } from 'i18next'; import type { Result } from 'ts-results'; import type { Block } from './blocks'; import type { BlockTypes, ScreenNames } from './constants'; import type { ScreenWithBlock } from './types'; /** * ProcessHandler is a class that manages the navigation flow of the application. * It keeps track of the current flow, the current screen, and the screen history. * It also provides methods for navigating to the next screen, navigating back, and changing the flow. */ export declare class ProcessHandler { #private; /** * The constructor initializes the ProcessHandler with a flow name, a project configuration, and a flow handler configuration. * It sets the current flow to the specified flow, the current screen to the InitSignup screen, and initializes the screen history as an empty array. */ constructor(i18next: i18n, corbadoApp: CorbadoApp | undefined, postProcess: () => void, handleNavigationEvents?: boolean); /** * Initializes the ProcessHandler. * Call this function after registering all callbacks. */ init(initialBlockFromComponentConfig?: BlockTypes): Promise>; onProcessCompleted(data: GeneralBlockCompleted): void; switchToBlock(blockType: BlockTypes): boolean; startAskForAbort(): void; dispose(): void; get currentScreenName(): ScreenNames; updateScreen(newScreen: ScreenNames): void; onScreenChange(cb: (value: ScreenWithBlock) => void): number; removeOnScreenChangeCallback(cbId: number): void; handleProcessUpdateFromUrl(emailVerifyFromUrl: EmailVerifyFromUrl): void; handleProcessUpdateBackend(processResponse: ProcessResponse, error?: CorbadoError): void; handleProcessUpdateFrontend(newPrimaryBlock: Block, newAlternatives?: Block[]): void; handleError(corbadoError: CorbadoError): void; }