import { type CSSProperties, type ReactNode } from 'react'; import type { OpenMenu } from '../../components/ContextMenu.js'; import { type MenuEntry } from '../../components/MenuEntries.js'; export declare const SIDEBAR_DEFAULT_WIDTH_PX = 256; /** The column a conversation list lives in: it animates between its width * and a rail, unless a drag is setting the width right now. */ export declare function SidebarPanel({ collapsed, width, railWidth, resizing, label, className, style, children, }: { collapsed: boolean; width?: number; railWidth?: number; resizing?: boolean; label?: string | undefined; className?: string; style?: CSSProperties; children: ReactNode; }): import("react").JSX.Element; export declare function SidebarToggle({ collapsed, onToggle, openLabel, closeLabel, className, }: { collapsed: boolean; onToggle: () => void; openLabel: string; closeLabel: string; className?: string; }): import("react").JSX.Element; /** A group's heading. With `toggle` it is a button that folds the group's rows away and brings * them back, and a folded group shows how many rows it holds. */ export declare function SidebarGroupHeading({ children, tone, testId, toggle, }: { children: ReactNode; /** 'attention' is for the group the reader is being asked to act on. */ tone?: 'default' | 'attention'; testId?: string | undefined; toggle?: { collapsed: boolean; onToggle: () => void; /** The id of the list it folds. */ controls: string; count: number; } | undefined; }): import("react").JSX.Element; /** A row's first line, the same in every list: what it is, and when it last * moved, abbreviated, on the right. */ export declare function SidebarRowTitle({ children, time, }: { children: ReactNode; /** When it last changed, short: a compact `RelativeTime`. */ time?: ReactNode; }): import("react").JSX.Element; /** A row's content: an optional mark before it (a status dot, a shared * icon), the title with its time, and an optional line under it for what the * mark cannot say, such as the machine or a state that needs the reader. */ export declare function SidebarRowBody({ leading, title, time, detail, }: { leading?: ReactNode; title: ReactNode; time?: ReactNode; detail?: ReactNode; }): import("react").JSX.Element; /** An action a row's menu offers, and why it is unavailable when it is. */ export interface SessionMenuAction { onClick: () => void; disabledReason?: string | undefined; /** The key that does the same while the row has focus, as the menu shows it: bind it with * the row's `shortcuts`. */ shortcut?: string | undefined; } /** A row's menu in one order wherever a list of conversations or sessions * shows: rename, share, download, then delete apart. Each is left out unless given. */ export declare function useSessionMenu(): (actions: { rename?: SessionMenuAction | undefined; share?: SessionMenuAction | undefined; download?: SessionMenuAction | undefined; remove?: SessionMenuAction | undefined; }) => MenuEntry[]; /** In place of a list with nothing to show: none yet, nothing matching, or * why it could not load. */ export declare function SidebarEmpty({ title, error }: { title: string; error?: string | undefined; }): import("react").JSX.Element; /** A key that acts on a row while focus is in it, such as Backspace to delete it. */ export interface SidebarRowShortcut { /** Any of these, written as for `Kbd`: `Backspace`, `A`, `Mod+Enter`. */ keys: string | readonly string[]; /** Given the row, as `menuItems` is, so a delete can move focus on once it's gone. */ onPress: (row: HTMLLIElement) => void; } /** Rows carry `data-sidebar-row`, so the list can move between them with the arrow keys. */ export declare const SIDEBAR_ROW_SELECTOR = "[data-sidebar-row]"; /** One entry in the list: the row highlights while it is the open one or * while its menu is up, and the menu opens from its button or a right-click. */ export declare function SidebarRow({ selected, menuItems, openMenu, shortcuts, className, children, }: { selected: boolean; /** Its menu. A function builds it as it opens, given the row, so an action can name the row * it acts on, such as the row a delete removes. */ menuItems: MenuEntry[] | ((row: HTMLLIElement) => MenuEntry[]); openMenu: OpenMenu; /** Keys that act on the row while focus is in it. Show each beside its action in the menu, * with the entry's `shortcut`. A key held down acts once. */ shortcuts?: SidebarRowShortcut[] | undefined; className?: string; children: ReactNode; }): import("react").JSX.Element; /** One entry in the collapsed rail: a square the size of the toggle, with the * same highlight as a row, holding whatever stands in for the item. With * `href` it is a link to the item, and `onSelect` runs only for a plain click. */ export declare function SidebarRailItem({ selected, label, href, onSelect, testId, children, }: { selected: boolean; /** Names the icon-only button, and shows beside it on hover. */ label: string; href?: string | undefined; onSelect?: (() => void) | undefined; testId?: string; children: ReactNode; }): import("react").JSX.Element; export declare function RenameDialog({ open, title, label, placeholder, confirmLabel, value, onChange, onConfirm, onClose, }: { open: boolean; title: string; label: string; placeholder: string; confirmLabel: string; value: string; onChange: (value: string) => void; onConfirm: () => void; onClose: () => void; }): import("react").JSX.Element; export interface RowDialogStrings { deleteTitle: string; deleteBody: (item: T) => ReactNode; deleteAction: string; renameTitle: string; renameLabel: string; renamePlaceholder: string; renameAction: string; } /** How a delete was asked for. */ export interface RowDeleteRequest { /** What the dialog opens on. Cancel by default, so a stray Enter deletes nothing; `confirm` * when a key pressed on the row asked for it, such as Backspace, so Enter answers it. */ initialFocus?: 'cancel' | 'confirm' | undefined; } /** The delete confirmation and rename dialog every list of rows needs, with * the item they are about. A handler that returns false keeps its dialog * open, for a refusal the reader should see before trying again. Given the * item's row, a delete moves focus on to the next row once the row is gone. */ export declare function useRowDialogs({ strings, nameOf, onDelete, onRename, }: { strings: RowDialogStrings; nameOf: (item: T) => string; onDelete: (item: T) => Promise | boolean | undefined; onRename: (item: T, name: string) => Promise | boolean | undefined; }): { requestDelete: (item: T, row?: Element | null, request?: RowDeleteRequest) => void; requestRename: (item: T) => void; dialogs: ReactNode; };