/** * The presentation mode of the web view. * 'inline' The web view is displayed inline within a feed or post detail page * 'expanded' The web view is displayed in a larger modal presentation * @experimental */ export type WebViewMode = 'inline' | 'expanded'; /** * A listener that is called when the web view mode changes. * @param mode The new mode, either 'inline' or 'expanded'. * @experimental */ export type WebViewModeListener = (mode: WebViewMode) => void; /** * Represents the current web view mode state for the application. * * @experimental */ export declare function getWebViewMode(): WebViewMode; /** * Requests expanded mode for the web view. * This will display the web view in a larger modal presentation. * * @param event The gesture that triggered the request, must be a trusted event. * @param entry The destination URI name. Eg, `'splash'` or `'default'`. Entry * names are the `devvit.json` `post.entrypoints` keys. Passing the * same entrypoint as currently loaded may cause a reload. * @returns A promise that resolves request has been received. * @throws When already expanded. * * @experimental * @example * ```ts * button.addEventListener('click', async (event) => { * await requestExpandedMode(event); * }); * ``` */ export declare function requestExpandedMode(event: MouseEvent, entry: string): void; /** * Exits expanded mode for the web view. * This will display the web view in an inline presentation. * * @param event The event that triggered the request, must be a trusted event. * @returns A promise that resolves request has been received. * @throws When already inlined. * * @experimental * @example * ```ts * button.addEventListener('click', async (event) => { * await exitExpandedMode(event); * }); * ``` */ export declare function exitExpandedMode(event: MouseEvent): void; /** * @deprecated This API is deprecated and will be removed in a future release. * use window.addEventListener("focus", () => { }) to receive notifications * when the web view mode changes back to inline. * Adds a listener that is called when the web view mode changes. Initial mode * is not reported. Web views in the process of destruction may not receive a * mode change event. * * @param callback The callback to be called when the mode changes. * @experimental */ export declare function addWebViewModeListener(callback: WebViewModeListener): void; /** * @deprecated This API is deprecated and will be removed in a future release. * Removes a listener that was previously added with `addWebViewModeListener`. * * @param callback The callback to be removed. * @experimental */ export declare function removeWebViewModeListener(callback: WebViewModeListener): void; //# sourceMappingURL=web-view-mode.d.ts.map