/*! * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved. * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") * * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and limitations under the License. */ import { type MessageBus } from "../../tools/createMessageBus.js"; import { type FullscreenMessage } from "./fullscreenMessageChannel.js"; export type FullscreenModeHost = { /** * Stop listening, and clear the stack, so fullscreen never outlives the page part that owned it. UI Shell calls this when it unmounts. */ destroy: () => void; }; export type CreateFullscreenModeHostArgs = { /** * Carries fullscreen messages between every app on the page. * @default a `createBrowserMessageBus` on `fullscreenMessageChannel` */ fullscreenMessageBus?: MessageBus; /** * The window to listen on for Escape. * @default window */ keyWindow?: Window; }; /** * Create the fullscreen mode host: the one place on the page that owns the stack of fullscreen ids and answers every app's requests. * * Unified UI Shell runs one for you, because only one shell renders on a page while any number of apps can. Call this yourself only in an app that renders without UI Shell. Rendering the shell's parts without `renderUiShell` loses more than fullscreen, so prefer the shell. * * Escape removes the top id, so each press goes back one step. A dialog, menu, or popover that handles Escape first wins, because it stops the keypress or marks it handled before it reaches `window`. Screen reader users in browse mode don't send Escape to the page, so fullscreen never exits under them by surprise; the fullscreen button is how they leave. * * Two hosts on one page, such as two shells on a Storybook docs page, stay in step: each one adopts every stack the other sends. A host with nothing in fullscreen doesn't answer `stateRequested`, so a host that starts late can never send an empty stack over a real one. * * @experimental The fullscreen API is in alpha and may change in a future release. */ export declare const createFullscreenModeHost: ({ fullscreenMessageBus, keyWindow, }?: CreateFullscreenModeHostArgs) => FullscreenModeHost; //# sourceMappingURL=createFullscreenModeHost.d.ts.map