import React, { JSX } from 'react'; interface DocSearchModalShortcuts { /** * Enable/disable the Ctrl/Cmd+K shortcut to toggle the DocSearch modal. * * @default true */ 'Ctrl/Cmd+K'?: boolean; /** * Enable/disable the / shortcut to open the DocSearch modal. * * @default true */ '/'?: boolean; } interface SidepanelShortcuts { /** * Enable/disable the Ctrl/Cmd+I shortcut to toggle the DocSearch sidepanel. * * @default true */ 'Ctrl/Cmd+I'?: boolean; } type KeyboardShortcuts = DocSearchModalShortcuts & SidepanelShortcuts; /** * Default keyboard shortcuts configuration for DocSearch. * These values are used when no keyboardShortcuts prop is provided * or when specific shortcuts are not configured. */ declare const DEFAULT_KEYBOARD_SHORTCUTS: Required; /** * Merges user-provided keyboard shortcuts with defaults. * * @param userShortcuts - Optional user configuration. * @returns Complete keyboard shortcuts configuration with defaults applied. */ declare function useKeyboardShortcuts(userShortcuts?: KeyboardShortcuts): Required; type DocSearchTheme = 'dark' | 'light'; interface UseThemeProps { theme?: DocSearchTheme; } declare const useTheme: ({ theme }: UseThemeProps) => void; type DocSearchState = 'modal-askai' | 'modal-search' | 'ready' | 'sidepanel'; type View = 'modal' | 'sidepanel' | (Record & string); type InitialAskAiMessage = { query: string; messageId?: string; suggestedQuestionId?: string; }; type OnAskAiToggle = (active: boolean, initialMessage?: InitialAskAiMessage) => void; /** * Imperative handle exposed by the DocSearch provider for programmatic control. */ interface DocSearchRef { /** Opens the search modal. */ open: () => void; /** Closes the search modal. */ close: () => void; /** Opens Ask AI mode (sidepanel if available, otherwise modal). */ openAskAi: (initialMessage?: InitialAskAiMessage) => void; /** Opens the sidepanel directly (no-op if sidepanel view not registered). */ openSidepanel: (initialMessage?: InitialAskAiMessage) => void; /** Returns true once the component is mounted and ready. */ readonly isReady: boolean; /** Returns true if the modal is currently open. */ readonly isOpen: boolean; /** Returns true if the sidepanel is currently open. */ readonly isSidepanelOpen: boolean; /** Returns true if sidepanel view is registered (hybrid mode). */ readonly isSidepanelSupported: boolean; } interface DocSearchContext { docsearchState: DocSearchState; setDocsearchState: (newState: DocSearchState) => void; searchButtonRef: React.RefObject; initialQuery: string; keyboardShortcuts: Required; openModal: () => void; closeModal: () => void; isAskAiActive: boolean; isModalActive: boolean; onAskAiToggle: OnAskAiToggle; initialAskAiMessage: InitialAskAiMessage | undefined; clearInitialAskAiMessage: () => void; registerView: (view: View) => void; isHybridModeSupported: boolean; } /** * Lifecycle callbacks for DocSearch. */ interface DocSearchCallbacks { /** Called once DocSearch is mounted and ready for interaction. */ onReady?: () => void; /** Called when the modal opens. */ onOpen?: () => void; /** Called when the modal closes. */ onClose?: () => void; /** Called when the sidepanel opens. */ onSidepanelOpen?: () => void; /** Called when the sidepanel closes. */ onSidepanelClose?: () => void; } interface DocSearchProps extends DocSearchCallbacks { children: Array | JSX.Element | React.ReactNode | null; theme?: DocSearchTheme; initialQuery?: string; keyboardShortcuts?: KeyboardShortcuts; } declare const DocSearch: React.ForwardRefExoticComponent>; declare function useDocSearch(): DocSearchContext; interface UseDocSearchKeyboardEventsProps { isOpen: boolean; onOpen: () => void; onClose: () => void; /** * Deprecated: Still here for backwards compat. * * @deprecated */ onInput?: (event: KeyboardEvent) => void; /** * Deprecated: Still here for backwards compat. * * @deprecated */ searchButtonRef?: React.RefObject; isAskAiActive: boolean; onAskAiToggle: (toggle: boolean) => void; keyboardShortcuts?: KeyboardShortcuts; } declare function useDocSearchKeyboardEvents({ isOpen, isAskAiActive, onAskAiToggle, onClose, onOpen, keyboardShortcuts, }: UseDocSearchKeyboardEventsProps): void; export { DEFAULT_KEYBOARD_SHORTCUTS, DocSearch, useDocSearch, useDocSearchKeyboardEvents, useKeyboardShortcuts, useTheme }; export type { DocSearchCallbacks, DocSearchContext, DocSearchModalShortcuts, DocSearchProps, DocSearchRef, DocSearchState, DocSearchTheme, InitialAskAiMessage, KeyboardShortcuts, OnAskAiToggle, SidepanelShortcuts, UseDocSearchKeyboardEventsProps, UseThemeProps, View };