import type { SdkWebViewLoadState } from '@dynamic-labs/types'; /** * The surface of a webview load controller that client modules consume. * Structurally satisfied by `createWebViewLoadController`'s return value — * kept minimal so the core registry doesn't depend on the controller * implementation. */ export type RegisteredWebViewLoadController = { getState: () => SdkWebViewLoadState; onStateChanged: (callback: (state: SdkWebViewLoadState) => void) => () => void; retry: () => Promise; }; export type WebViewLoadControllerRegistry = { /** The currently registered controller, or `null` when none exists yet. */ getController: () => RegisteredWebViewLoadController | null; /** * Subscribe to controller registrations. Returns an unsubscribe. Needed * because modules (e.g. `sdkModule`) are created with the client, while * the controller is registered later by the platform extension. */ onRegistered: (callback: (controller: RegisteredWebViewLoadController) => void) => () => void; /** * Register the webview load controller. Registering again replaces the * previous controller (e.g. when the platform extension re-initializes * its webview) and notifies `onRegistered` subscribers again. */ register: (controller: RegisteredWebViewLoadController) => void; }; export declare const createWebViewLoadControllerRegistry: () => WebViewLoadControllerRegistry;