/*! * Copyright (c) 2024-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 SetStateAction } from "react"; import { type TranslationOverrides, type TranslationProviderProps } from "../i18n.generated/i18n.js"; import { MessageBus } from "../tools/createMessageBus.js"; import { type ReactRootElements } from "../web-component/createReactRootElements.js"; import { UiShellContentProps, UiShellNavComponentProps } from "./uiShellContentTypes.js"; import { UiShellProviderProps } from "./UiShellProvider.js"; import { UiShellBreakpointConfig } from "./useUiShellBreakpoints.js"; export declare const defaultComponentProps: UiShellNavComponentProps; /** * Runtime-updatable translation settings forwarded to UI Shell's internal `OdysseyProvider`. * * Consumers pass these as initial props to `renderUiShell({...})` and can update them later by calling `setTranslationSettings(...)` on the returned object. */ export type UiShellTranslationSettings = Pick & { translationOverrides?: TranslationOverrides; }; export type UiShellProps = { /** * Customized breakpoints for UI Shell. * * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin). */ breakpointConfig?: UiShellBreakpointConfig; /** * Called once the shell's fullscreen mode host is running. The function it returns is called when the shell unmounts, before the host stops. * * `renderUiShell` passes this so the fullscreen state it returns only listens to the page while the shell is on it. */ connectFullscreenState?: () => () => void; /** * Notifies when subscribed to prop changes. * * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready. */ onSubscriptionCreated: () => void; /** * This is a callback that provides a subscriber callback to listen for changes to state. It allows UI Shell to listen for state changes. * * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state. */ subscribeToPropChanges: MessageBus>["subscribe"]; /** * Subscriber for runtime-updatable translation settings (`languageCode`, `translationOverrides`). * * These are forwarded to the shell's internal `OdysseyProvider` so consumers can drive shell localization from their own i18n source instead of the browser's `navigator.language`. * * Optional for backward compatibility — when omitted, the shell falls back to `window.navigator.language` (its prior behavior). */ subscribeToTranslationSettings?: MessageBus>["subscribe"]; /** * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it. */ uiShellAppElement: ReactRootElements["appRootElement"]; /** * Typically, this is your `` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a ``. */ uiShellStylesElement: ReactRootElements["stylesRootElement"]; } & UiShellProviderProps & Pick; declare const MemoizedUiShell: import("react").MemoExoticComponent<({ appBackgroundColor, appBackgroundContrastMode, appElement, appElementScrollingMode, breakpointConfig, closeSideNavMenu, connectFullscreenState, hasStandardAppContentPadding, initialVisibleSections, onError, onSubscriptionCreated, optionalComponents, sideNavBackgroundColor, sideNavBackgroundContrastColor, subscribeToCloseRightSideMenu, subscribeToCloseSideNavMenu, subscribeToPropChanges, subscribeToTranslationSettings, topNavBackgroundColor, uiShellAppElement, uiShellStylesElement, }: UiShellProps) => import("@emotion/react/jsx-runtime").JSX.Element | null>; export { MemoizedUiShell as UiShell }; //# sourceMappingURL=UiShell.d.ts.map