import { Component as ReactComponent } from 'react'; import { Types as RXTypes } from 'reactxp'; export interface WebViewNavigationState { canGoBack: boolean; canGoForward: boolean; loading: boolean; url: string; title: string; readonly navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other'; } export interface WebViewErrorState extends WebViewNavigationState { description: string; domain: string; code: string; } export declare enum WebViewSandboxMode { None = 0, AllowForms = 1, AllowModals = 2, AllowOrientationLock = 4, AllowPointerLock = 8, AllowPopups = 16, AllowPopupsToEscapeSandbox = 32, AllowPresentation = 64, AllowSameOrigin = 128, AllowScripts = 256, AllowTopNavigation = 512, AllowMixedContentAlways = 1024, AllowMixedContentCompatibilityMode = 2048 } export interface WebViewSource { html: string; baseUrl?: string; } export interface WebViewShouldStartLoadEvent { url: string; } export interface WebViewNavigationEvent extends RXTypes.SyntheticEvent { nativeEvent: WebViewNavigationState; } export interface WebViewErrorEvent extends RXTypes.SyntheticEvent { nativeEvent: WebViewErrorState; } export interface WebViewMessageEvent extends RXTypes.SyntheticEvent { data: string; origin: string; } export interface WebViewProps extends RXTypes.CommonStyledProps { url?: string; source?: WebViewSource; headers?: Headers; onLoad?: (e: RXTypes.SyntheticEvent) => void; onNavigationStateChange?: (navigationState: WebViewNavigationState) => void; scalesPageToFit?: boolean; injectedJavaScript?: string; javaScriptEnabled?: boolean; mediaPlaybackRequiresUserAction?: boolean; allowsInlineMediaPlayback?: boolean; startInLoadingState?: boolean; domStorageEnabled?: boolean; onShouldStartLoadWithRequest?: (shouldStartLoadEvent: WebViewShouldStartLoadEvent) => boolean; onLoadStart?: (e: RXTypes.SyntheticEvent) => void; onError?: (e: RXTypes.SyntheticEvent) => void; onMessage?: (e: WebViewMessageEvent) => void; sandbox?: WebViewSandboxMode; } export declare abstract class WebView extends ReactComponent { abstract postMessage(message: string, targetOrigin?: string): void; abstract reload(): void; abstract goBack(): void; abstract goForward(): void; }