export type EmbeddedWebViewSubscription = { remove: () => void; }; export type EmbeddedWebViewOnMessageEvent = { message: string; }; export type EmbeddedWebViewOnShouldStartLoadEvent = { id: string; url: string; isTopFrame: boolean; }; export type EmbeddedWebViewOnLoadErrorEvent = { url: string; code: number; domain: string; description: string; isProvisional: boolean; }; /** * Fired when the native webview starts a provisional navigation — the * request has been issued but no response bytes have arrived yet. * Maps to `WKNavigationDelegate.didStartProvisionalNavigation` on iOS and * `WebViewClient.onPageStarted` on Android. */ export type EmbeddedWebViewOnLoadStartEvent = { url: string; }; /** * Fired when the response has committed and the native webview has begun * rendering. Maps to `WKNavigationDelegate.didCommit` on iOS and * `WebViewClient.onPageCommitVisible` on Android. */ export type EmbeddedWebViewOnLoadEvent = { url: string; }; /** * Fired when the native webview finishes loading the page. Maps to * `WKNavigationDelegate.didFinish` on iOS and `WebViewClient.onPageFinished` * on Android. */ export type EmbeddedWebViewOnLoadEndEvent = { url: string; }; export type EmbeddedWebViewEventName = 'onMessage' | 'onShouldStartLoad' | 'onLoadError' | 'onLoadStart' | 'onLoad' | 'onLoadEnd'; export type EmbeddedWebViewNativeModule = { setUrl: (url: string) => Promise; setVisible: (visible: boolean) => Promise; setDebuggingEnabled: (enabled: boolean) => Promise; destroy: () => Promise; postMessage: (message: string) => Promise; respondToShouldStartLoad: (id: string, allow: boolean) => Promise; addListener: (eventName: EmbeddedWebViewEventName, listener: (event: T) => void) => EmbeddedWebViewSubscription; }; /** * Reports whether the EmbeddedWebView native module is linked into the * currently running native binary. * * The embedded webview was introduced mid-version, so an over-the-air JS * update can land on an older binary that predates the native module. Callers * use this to decide between the native overlay path and the * react-native-webview fallback before wiring any side effects. * * `requireOptionalNativeModule` returns `null` (instead of throwing) when the * module is absent. Any unexpected throw is treated as "unavailable" so a * runtime quirk can never break the calling flow. */ export declare const isEmbeddedWebViewAvailable: () => boolean; export declare const getEmbeddedWebView: () => EmbeddedWebViewNativeModule;