import { type MouseEvent, type ReactNode } from 'react'; import type { LinkTarget } from '../components/AppLink.js'; import type { OpenMenu } from '../components/ContextMenu.js'; import type { MenuEntry } from '../components/MenuEntries.js'; interface Takeover { /** Where a page's list renders; null while the app's own navigation shows. */ slot: HTMLElement | null; showList: () => void; } export interface AppFrameTakeoverState { /** A page's list has the navigation. */ active: boolean; /** In place of the app's navigation while active: the element the list renders into. */ navigation: ReactNode; /** Leaves the list for the app's navigation, staying on the page. */ showNavigation: () => void; /** Brings the list back after `showNavigation`, such as when the reader picks the page's own * item in the app's navigation. */ showList: () => void; /** Give to `AppFrameTakeover`. */ takeover: Takeover; } /** A page's own list, such as its conversations, can take the place of the app's navigation * rather than open a second drawer on a narrow screen or a second column on a wide one. The host * owns the frame and the page owns the list, so the host holds this: it renders `navigation` in * the frame while `active`, and wraps the frame in `AppFrameTakeover` so the page's * `AppFrameListTakeover` or `AppFrameTakeoverContent` finds its place. `enabled` is the host's * call, such as a page that has a list. */ export declare function useAppFrameTakeover(enabled: boolean): AppFrameTakeoverState; /** Renders a page's own content in place of the app's navigation while the page has it. While * the app's navigation shows, or a phone's drawer is closed, the content stays mounted out of * view, so it keeps what it holds, such as a search, and still hears its shortcuts. What it * renders reads where it is from `useAppFrameNavigationPlacement`, as `ConversationSidebar` * does to become the navigation's list rather than a column beside the page. */ export declare function AppFrameTakeoverContent({ children }: { children: ReactNode; }): import("react").ReactPortal | null; export declare function AppFrameTakeover({ value, children }: { value: Takeover; children: ReactNode; }): import("react").JSX.Element; /** Atop a list that has the navigation: back to the app's own, staying on the page. The rail * shows its arrow alone, named by the label. */ export declare function AppFrameTakeoverBack({ onBack, label, className, }: { onBack: () => void; label?: string; className?: string; }): import("react").JSX.Element; export type AppFrameTakeoverRow = LinkTarget & { key: string; label: string; /** For a row that is not a link, such as in an app with no addresses. */ onClick?: ((event: MouseEvent) => void) | undefined; /** The same mark, time and second line the list's own row shows. */ leading?: ReactNode; time?: ReactNode; detail?: ReactNode; selected: boolean; menuItems: MenuEntry[]; }; export interface AppFrameTakeoverGroup { /** Also what remembers the group folded, so keep it the same across renders and visits. */ key: string; label: string; rows: AppFrameTakeoverRow[]; } /** A page's list as the frame's navigation, rendered into the host's place for it while there * is one. Each row carries its actions behind a button that is always shown, since a touch * screen has no hover to reveal it. A group's heading folds its rows away, and the list * remembers it folded; a folded group shows how many rows it holds. */ export declare function AppFrameListTakeover({ header, newItem, top, groups, groupsStorageKey, empty, openMenu, moreLabel, children, }: { /** Above the new item, such as an `AppFrameNavSwitch` between this list and a sibling's. */ header?: ReactNode; /** Starts a new one, above the list. */ newItem: LinkTarget & { label: string; selected: boolean; onClick?: ((event: MouseEvent) => void) | undefined; }; /** Under the new item, above the list: more `AppFrameNavItem`s, such as one that opens a * search. */ top?: ReactNode; groups: AppFrameTakeoverGroup[]; /** Where the groups the reader folded are remembered. Give the same one as the list this * stands in for, such as a `ConversationSidebar`'s, so both fold the same groups. */ groupsStorageKey?: string; /** In place of the groups when there are none. */ empty?: ReactNode; openMenu: OpenMenu; /** Names each row's menu button. */ moreLabel?: string; /** The list's menus and dialogs, rendered outside the navigation. */ children?: ReactNode; }): import("react").JSX.Element; export {};