import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js'; import '../blocks/components/devvit-blocks-renderer.js'; import '../blocks/components/devvit-blocks-web-view.js'; import type { AppPermissionState } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js'; import { WebViewImmersiveMode } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js'; import type { WebViewInternalEventMessage } from '@devvit/protos/json/devvit/ui/events/v1alpha/web_view.js'; import type { Metadata } from '@devvit/protos/lib/Types.js'; import type { LinkedBundle } from '@devvit/protos/types/devvit/runtime/bundle.js'; import type { UIResponse } from '@devvit/protos/types/devvit/ui/block_kit/v1beta/ui.js'; import { UIDimensions } from '@devvit/protos/types/devvit/ui/common/v1alpha/common.js'; import type { AdsMetadata } from '@devvit/shared-types/AdsMetadata.js'; import type { JsonObject } from '@devvit/shared-types/json.js'; import { type WebbitToken } from '@devvit/shared-types/webbit.js'; import type { FaceplateEvent } from '@reddit/faceplate/event-types.js'; import type { PropertyValues } from 'lit'; import { LitElement } from 'lit'; import type { DevvitClientPerformanceEvent, DevvitRealtimeSendEvent, DevvitRuntimeErrorEvent, DevvitRuntimePerformanceEvent, DevvitUIEffectEvent, DevvitUIError } from './dispatcher/events.js'; import { DevvitClientPerformanceEventName, DevvitRuntimeErrorEventName, DevvitRuntimePerformanceEventName } from './dispatcher/events.js'; import { type UIProps } from './dispatcher/mappers.js'; import type { UIApp } from './dispatcher/remote-app.js'; import { type BridgeContextWithMeta } from './web-view.js'; declare global { interface HTMLElementTagNameMap { 'devvit-surface': DevvitSurface; } interface HTMLElementEventMap { 'devvit-realtime-send': DevvitRealtimeSendEvent; 'devvit-ui-effect': DevvitUIEffectEvent; [DevvitClientPerformanceEventName]: DevvitClientPerformanceEvent; [DevvitRuntimePerformanceEventName]: DevvitRuntimePerformanceEvent; [DevvitRuntimeErrorEventName]: DevvitRuntimeErrorEvent; 'devvit-ui-error': Omit, 'detail'> & { detail: DevvitUIError; }; } } type ColorScheme = 'dark' | 'light' | undefined; /** * A component for rendering blocks somewhere inside of Reddit. This component should * have no opinions on where it is rendered, only that the props are supplied. * * The complexity of this class should only be the UI itself and proxying state * to devvit-blocks-renderer and Dispatcher. Don't put logic here that you can't * unit test. * * @slot - Loading / unloaded state. */ export declare class DevvitSurface extends LitElement { #private; static get styles(): import("lit").CSSResult[]; /** A small client that forwards GRPC requests to our backend */ remoteApp?: UIApp | undefined; /** The linked bundle ready to be executed the by dispatcher */ bundle?: LinkedBundle | undefined; /** The url or blob of code that creates the local runtime and associated worker */ localRuntimeCode?: string | Blob | undefined; /** Metadata forwarded into the LocalRuntime. Should be the same metadata that is passed to the RemoteApp */ metadata?: Metadata | undefined; /** AdsMetadata consumed on the client side for click behavior and tracking */ adsMetadata?: AdsMetadata | undefined; /** Data required for the "run as user" feature */ appPermissionState?: AppPermissionState | undefined; /** Signed `RequestContext` JWT. */ signedRequestContext: string | undefined; /** Opaque `WebViewClientData`. */ webViewClientData: JsonObject | undefined; /** Props passed into the request. Useful for things like postId */ requestProps?: UIProps; /** Enables debug logging for the local runtime */ runtimeDebugLogging: boolean; /** Color scheme that the surface renders the blocks into */ scheme?: ColorScheme; /** Enable the use of experimental blocks that are not production ready */ useExperimentalBlocks: boolean; /** Enable the use of speculative execution from within KMP */ useSpeculativeExecution: boolean; webViewUrlTemplate: string; webbitToken: WebbitToken; appPublicApiVersion: string; disableAssetSandbox: boolean; /** Width, height, and scale of this element, stays in sync as dimensions of element changes */ dimensions?: UIDimensions; private _rootBlock?; /** @public */ renderResponse?: UIResponse | undefined; private _blocksRenderer; constructor(); connectedCallback(): Promise; disconnectedCallback(): void; protected render(): import("lit-html").TemplateResult<1>; protected willUpdate(props: PropertyValues): Promise; protected getUpdateComplete(): Promise; /** See `DevvitBlocksWebView.postEvent()`. */ postEvent(ev: Readonly): void; /** * Returns a new bridge context for the specified mode. Used by the * `devvit-wrapper` fullscreen effect path same as `getWebViewUrl()`. */ getBridgeContext(mode: WebViewImmersiveMode): BridgeContextWithMeta; /** * Return the resolved webView URL. * This provides a clean API for accessing WebView URLs without traversing the shadow DOM. */ getWebViewUrl(): string | undefined; } export {}; //# sourceMappingURL=devvit-surface.d.ts.map