import { SidepanelShortcuts, InitialAskAiMessage, DocSearchCallbacks, DocSearchTheme, DocSearchRef } from '@docsearch/core'; export { DocSearchCallbacks, DocSearchRef } from '@docsearch/core'; import React, { JSX } from 'react'; type AskAiSearchParameters = { facetFilters?: string[]; filters?: string; attributesToRetrieve?: string[]; restrictSearchableAttributes?: string[]; distinct?: boolean | number | string; }; type AgentStudioSearchParameters = Record>; type AlgoliaLogoTranslations = Partial<{ poweredByText: string; }>; type ToolCallTranslations = { /** * Text shown while assistant is preparing tool call. */ preToolCallText: string; /** * Text shown while assistant is performing search tool call. */ searchingText: string; /** * Text shown while assistant is finished performing tool call. */ toolCallResultText: string; }; type ConversationScreenTranslations = Partial; type NewConversationScreenTranslations = Partial<{ /** * Title to be shown on the new conversation/starting screen. **/ titleText: string; /** * Introduction text displayed on the new conversation/starting screen. **/ introductionText: string; }>; type PromptFormTranslations = Partial<{ /** * Initial placeholder for the prompt input. **/ promptPlaceholderText: string; /** * Placeholder text for wile a conversation is streaming. **/ promptAnsweringText: string; /** * Placeholder text for after a question has already been asked. **/ promptAskAnotherQuestionText: string; /** * Disclaimer text displayed beneath the prompt form. **/ promptDisclaimerText: string; promptLabelText: string; promptAriaLabelText: string; }>; type PanelVariant = 'floating' | 'inline'; type PanelSide = 'left' | 'right'; type HeaderTranslations = Partial<{ /** * The main title text shown on the header. **/ title: string; /** * The title text shown on the conversation history screen. **/ conversationHistoryTitle: string; /** * The text shown on the start a conversation button. **/ newConversationText: string; /** * The text shown on the view conversation history button. **/ viewConversationHistoryText: string; }>; /** * Imperative handle exposed by the Sidepanel component for programmatic control. */ interface SidepanelRef { /** Opens the sidepanel. */ open: () => void; /** Closes the sidepanel. */ close: () => void; /** Returns true once the component is mounted and ready. */ readonly isReady: boolean; /** Returns true if the sidepanel is currently open. */ readonly isOpen: boolean; } type SidepanelTranslations = Partial<{ /** * Translation texts for the Sidepanel header. **/ header: HeaderTranslations; /** * Translation texts for the prompt form. **/ promptForm: PromptFormTranslations; /** * Translation texts for the conversation screen. **/ conversationScreen: ConversationScreenTranslations; /** * Translation texts for the new conversation/starting screen. **/ newConversationScreen: NewConversationScreenTranslations; /** * Translation text for the Algolia logo. **/ logo: AlgoliaLogoTranslations; }>; type SidepanelProps$1 = { /** * Variant of the Sidepanel positioning. * * - `inline` pushes page content when opened * - `floating` is positioned above all other content on page. * * @default 'floating' */ variant?: PanelVariant; /** * Side of the page which the panel will originate from. * * @default 'right' */ side?: PanelSide; /** * The selector of the element to push when Sidepanel opens with `inline` variant. * * @default `'#root, main, .app, body'` */ pushSelector?: string; /** * Width of the Sidepanel (px or any CSS width). * * @default `360px` **/ width?: number | string; /** * Width when expanded (px or any CSS width). * * @default `580px` **/ expandedWidth?: number | string; /** * The container element where the panel should be portaled to. * * @default `document.body` */ portalContainer?: DocumentFragment | Element | null; /** * Enables displaying suggested questions on new conversation screen. * * @default false */ suggestedQuestions?: boolean; /** * Translations specific to the Sidepanel panel. **/ translations?: SidepanelTranslations; /** * Configuration for keyboard shortcuts. Allows enabling/disabling specific shortcuts. * * @default `{ 'Ctrl/Cmd+I': true }` */ keyboardShortcuts?: SidepanelShortcuts; useStagingEnv?: boolean; }; type Props$1 = Omit & SidepanelProps$1 & SidepanelSearchParameters & { isOpen?: boolean; onOpen: () => void; onClose: () => void; initialMessage?: InitialAskAiMessage; }; declare const Sidepanel: React.ForwardRefExoticComponent>; type SidepanelButtonTranslations = Partial<{ /** * Text to be displayed when button has variant: `inline`. * * @default 'Ask AI' **/ buttonText: string; /** * Aria label text for the button. * * @default 'Ask AI' **/ buttonAriaLabel: string; }>; type ButtonVariant = 'floating' | 'inline'; type SidepanelButtonProps = { /** * Variant of the button positioning and styling. * * - `inline` displays the button inline where rendered, with extra text * - `floating` displays the button floating in bottom right of screen with just icon. * * @default 'floating' **/ variant?: ButtonVariant; /** * Translations specific to the Sidepanel button. **/ translations?: SidepanelButtonTranslations; /** * Configuration for keyboard shortcuts. Allows enabling/disabling specific shortcuts. * * @default `{ 'Ctrl/Cmd+I': true }` */ keyboardShortcuts?: SidepanelShortcuts; }; type Props = React.ComponentProps<'button'> & SidepanelButtonProps; declare const SidepanelButton: ({ variant, keyboardShortcuts, translations, ...props }: Props) => JSX.Element; type SidepanelSearchParameters = { /** * **Experimental:** Whether to use Agent Studio as the chat backend. * * This is an experimental feature and its API may change without notice in future releases. * Use with caution in production environments. * * @default false */ agentStudio?: never; /** * The search parameters to use for the ask AI feature. * * **NOTE**: If using `agentStudio = true`, the `searchParameters` object is * keyed by the index name. */ searchParameters?: AskAiSearchParameters; } | { agentStudio: false; searchParameters?: AskAiSearchParameters; } | { agentStudio: true; /** * The search parameters to use for the ask AI feature. * Keyed by the index name. * * @example * { * "INDEX_NAME": { distinct: false } * } */ searchParameters?: AgentStudioSearchParameters; }; type DocSearchSidepanelProps = DocSearchCallbacks & { /** * The assistant ID to use for the ask AI feature. */ assistantId: string; /** * Public api key with search permissions for the index. */ apiKey: string; /** * Algolia application id used by the search client. */ appId: string; /** * The index name to use for the ask AI feature. Your assistant will search this index for relevant documents. */ indexName: string; /** * Configuration for keyboard shortcuts. Allows enabling/disabling specific shortcuts. * * @default `{ 'Ctrl/Cmd+I': true }` */ keyboardShortcuts?: SidepanelShortcuts; /** * Theme overrides applied to the Sidepanel button and panel. * * @default 'light' */ theme?: DocSearchTheme; /** * Props specific to the Sidepanel button. */ button?: Omit; /** * Props specific to the Sidepanel panel. */ panel?: Omit; }; type SidepanelProps = DocSearchSidepanelProps & SidepanelSearchParameters; declare const DocSearchSidepanel: React.ForwardRefExoticComponent>; export { DocSearchSidepanel, Sidepanel, SidepanelButton }; export type { ButtonVariant, DocSearchSidepanelProps, SidepanelButtonProps, SidepanelButtonTranslations, SidepanelProps$1 as SidepanelProps, SidepanelRef, SidepanelSearchParameters, SidepanelTranslations };