import type { WebViewImmersiveModeEffect } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js'; import { type WebViewAppMessage } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js'; import type { WebViewTelemetryClickEffect, WebViewTelemetryLoadedEffect } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/telemetry.js'; import type { WebViewInternalEventMessage } from '@devvit/protos/json/devvit/ui/events/v1alpha/web_view.js'; import type { JsonObject, JsonValue } from '@devvit/shared-types/json.js'; import type { PropertyValues } from 'lit'; import { LitElement } from 'lit'; import { type Share } from '../../client/effects/share.js'; import type { BridgeContextWithMeta } from '../../client/web-view.js'; import type { DevvitBlocksElement } from './DevvitBlocksElement.js'; export type DevvitWebViewClickEvent = CustomEvent; export type DevvitWebViewLoadedEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'devvit-blocks-web-view': DevvitBlocksWebView; } interface HTMLElementEventMap { 'devvit-web-view-message': CustomEvent; /** Custom event type for web view click events */ 'devvit-web-view-click': DevvitWebViewClickEvent; /** Custom event type for web view loaded duration */ 'devvit-web-view-loaded': DevvitWebViewLoadedEvent; 'devvit-web-view-share': CustomEvent; 'devvit-web-view-immersive-mode': CustomEvent; } } /** * Wraps an iframe to capture messages sent from within to be handled by the app rendering the Blocks */ export declare class DevvitBlocksWebView extends LitElement implements DevvitBlocksElement { #private; context: BridgeContextWithMeta | undefined; src: string | undefined; devMode: boolean; /** * Handles messages sent from the web view to the Devvit app. Only present on fullscreen web views. * * Originates from WebViewEffectHandler. * */ onReceivedPostMessage?: (data: JsonValue) => void; /** * Use ui.webView.postMessage() * @deprecated */ state: JsonObject | undefined; focusOnLoad: boolean; /** * When true, the embedded iframe will be focusable via keyboard navigation (tabindex="0"). * Defaults to false so that web views are not keyboard-focusable unless explicitly opted in. */ focusable: boolean; private _originDiffers; private _targetOrigin; pendingSrc: string | undefined; private _iframe; static get styles(): import("lit").CSSResult[]; connectedCallback(): void; disconnectedCallback(): void; /** * Send an event to the iframe. Events may be in response to effects or * initiated by the user. * * The data flow for effect responses is usually to * implement an `EffectHandler` subclass that owns observing the effect DOM * Event and then propagating it as a `devvit-ui-effect` Event with an * `onEvent()` callback that can be used to respond. */ postEvent(ev: Readonly): void; protected getUpdateComplete(): Promise; protected willUpdate(changedProperties: PropertyValues): void; protected updated(props: PropertyValues): void; reset(): void; /** @deprecated Blocks only. */ postMessage(message: WebViewAppMessage): void; render(): import("lit-html").TemplateResult<1>; } //# sourceMappingURL=devvit-blocks-web-view.d.ts.map