/** * Control+Tab in the desktop app: switch between recently viewed chats, most * recent first, as ⌘Tab switches apps. The list spans the person's workspaces, * so it also jumps between chats in different workspaces. A quick press goes back to the previous * chat (press again to return); holding Control shows the list, each Tab moves * down it (Shift+Tab up), and releasing Control opens the highlighted chat. * * The list is read once when the switcher opens, so it holds still while the * person cycles through it. */ import type { ChatDirectorySnapshot } from "./chat-directory.js"; /** At most this many chats; older ones are a search away in ⌘K. */ export declare const SWITCHER_LIMIT = 10; /** A press shorter than this switches without ever drawing the list. */ export declare const SWITCHER_SHOW_DELAY_MS = 140; export type ChatSwitcherState = Readonly<{ /** Chats in the order shown, most recently viewed first. */ ids: readonly string[]; /** The highlighted chat. */ index: number; /** Whether the list is drawn (after the delay, or once Tab is pressed again). */ visible: boolean; }>; /** * The chats to switch between, most recently viewed first, with the open chat * (when there is one) at the front. Null when there is nowhere to switch to. */ export declare function openChatSwitcher(directory: Pick, currentChatId: string | null, backwards: boolean, /** Whether a workspace is still open to the person; chats elsewhere are left out. */ reachable?: (workspaceId: string) => boolean): ChatSwitcherState | null; /** Tab moves down the list and Shift+Tab up, wrapping at the ends. */ export declare function stepChatSwitcher(state: ChatSwitcherState, step: 1 | -1): ChatSwitcherState; /** Control+Tab exactly: no ⌘, no ⌥ (Shift reverses). */ export declare function isSwitcherKey(event: Pick): boolean;