import { ComboboxInputProps } from '@headlessui/react'; import { FC, ReactNode } from 'react'; import { PagefindSearchOptions } from '../../types.js'; import 'mdast'; import 'next'; import 'zod'; import '../../server/schemas.js'; import './lib/index.js'; import 'rehype-katex/lib/index.js'; import 'better-react-mathjax'; import 'rehype-pretty-code'; import '../../types.generated.js'; import '@mdx-js/mdx'; import 'rehype-katex'; declare function importPagefind(): Promise; type InputProps = Omit; interface SearchProps extends InputProps { /** * Not found text. * @default 'No results found.' */ emptyResult?: ReactNode; /** * Error text. * @default 'Failed to load search index.' * */ errorText?: ReactNode; /** * Loading text. * @default 'Loading…' */ loading?: ReactNode; /** * Placeholder text. * @default 'Search documentation…' */ placeholder?: string; /** Input container CSS class name. */ className?: string; searchOptions?: PagefindSearchOptions; /** * Callback function that triggers whenever the search input changes. * * This prop is **not serializable** and cannot be used directly in a server-side layout. * * To use this prop, wrap the component in a **client-side** wrapper. Example: * * ```tsx filename="search-with-callback.jsx" * 'use client' * * import { Search } from 'nextra/components' * * export function SearchWithCallback() { * return ( * { * console.log('Search query:', query) * }} * /> * ) * } * ``` * * Then pass the wrapper to the layout: * * ```tsx filename="app/layout.jsx" * import { SearchWithCallback } from '../path/to/your/search-with-callback' * // ... * } {...rest} /> * ``` * * @param query - The current search input string. */ onSearch?: (query: string) => void; } /** * A built-in search component provides a seamless and fast search * experience out of the box. Under the hood, it leverages the * [Pagefind package](https://pagefind.app) — a fully client-side search engine optimized for static * sites. Pagefind indexes your content at build time and enables highly performant, * zero-JavaScript-dependency searches at runtime. * * @see [Nextra search setup guide](https://nextra.site/docs/guide/search) */ declare const Search: FC; export { Search, importPagefind };