/** * #web_view.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { ConsentStatusEvent } from "../../effect_types/v1alpha/app_permission.js"; import type { OrderResultEvent } from "../../effect_types/v1alpha/create_order.js"; import type { FormCanceledEvent, FormSubmittedEvent } from "../../effect_types/v1alpha/show_form.js"; import type { UpdateRequestContextEvent } from "../../effect_types/v1alpha/update_request_context.js"; import type { RealtimeSubscriptionEvent } from "../../effects/v1alpha/realtime_subscriptions.js"; import type { WebViewImmersiveMode } from "../../effects/web_view/v1alpha/immersive_mode.js"; import type { WebViewScreenshotRequestEvent } from "../../effects/web_view/v1alpha/screenshot.js"; /** * Blocks only. * * @deprecated */ export declare enum WebViewVisibility { WEBVIEW_VISIBLE = 0, WEBVIEW_HIDDEN = 1, UNRECOGNIZED = -1 } /** * Fired when the content of a WebView within a `` block calls * `window.parent.postMessage()`. Blocks only. * * @deprecated */ export type WebViewPostMessageEvent = { /** * Can be a Struct or a scalar value since postMessage doesn't restrict the * type of 'message'. * @deprecated Use json_string instead */ message?: any | undefined; /** JSON string payload */ jsonString: string; }; /** * Fired from the client when the visibility of a fullscreen WebView changes. * Blocks only. * * @deprecated */ export type WebViewFullScreenEvent = { visibility: WebViewVisibility; }; /** * Eg, the user initiates a request to mount the Blocks * view (`useWebView().mount()`), the web view is shown in the client, and the * client posts an event to Blocks that the web view is visible. Blocks only. * * @deprecated */ export type WebViewEvent = { postMessage?: WebViewPostMessageEvent | undefined; fullScreen?: WebViewFullScreenEvent | undefined; }; /** * Event dispatched from the client to the web view when the user initiates * expanded or inline mode. */ export type WebViewImmersiveModeChangedEvent = { immersiveMode: WebViewImmersiveMode; }; /** * This is the message sent from the client to the web view via `postMessage()` * for all Webbit events. For web, this is the sender's type. Events are * initiated by the user as opposed to effects which are side-effects of running * the web view. Additionally, some effects have responses that may be events. */ export type WebViewInternalEventMessage = { /** * ID of the event message, matches the id of the * `WebViewInternalMessage` effect that triggered it. Empty when event is not * an effect response. */ id: string; formCanceled?: FormCanceledEvent | undefined; formSubmitted?: FormSubmittedEvent | undefined; realtimeEvent?: RealtimeSubscriptionEvent | undefined; immersiveModeEvent?: WebViewImmersiveModeChangedEvent | undefined; consentStatus?: ConsentStatusEvent | undefined; orderResult?: OrderResultEvent | undefined; updateRequestContext?: UpdateRequestContextEvent | undefined; screenshotRequest?: WebViewScreenshotRequestEvent | undefined; }; /** * Message sent from the client to the web view via `postMessage()`. The * structure must match `MessageEvent`. Web uses the actual `MessageEvent` from * the standard web API. Only the native clients use `WebViewMessageEvent` but * all clients use `MessageData`. * * "Event" refers to a `MessageEvent`, not event as in event vs effect. The * data of `WebViewMessageEvent` could be anything. * * See https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent. */ export type WebViewMessageEvent = { /** event payload */ data?: WebViewMessageEvent_MessageData | undefined; }; /** For web view's, this is the type of MessageEvent.data. */ export type WebViewMessageEvent_MessageData = { /** 'devvit-message' */ type: string; /** event type */ data?: WebViewInternalEventMessage | undefined; }; //# sourceMappingURL=web_view.d.ts.map