import { SearchBarBaseProps } from '@backstage/plugin-search-react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; import { SearchResultSet } from '@backstage/plugin-search-common'; import * as _backstage_core_plugin_api from '@backstage/core-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api'; /** * Props for {@link HomePageSearchBar}. * * @public */ type HomePageSearchBarProps = Partial>; /** * @public */ interface SearchModalChildrenProps { /** * A function that should be invoked when navigating away from the modal. */ toggleModal: () => void; /** * Ability to provide custom components to render the result items */ resultItemComponents?: ReactNode | ((resultSet: SearchResultSet) => JSX.Element); } /** * @public */ interface SearchModalProps { /** * If true, it renders the modal. */ open?: boolean; /** * This is supposed to be used together with the open prop. * If `hidden` is true, it hides the modal. * If `open` is false, the value of `hidden` has no effect on the modal. * Use `open` for controlling whether the modal should be rendered or not. */ hidden?: boolean; /** * a function invoked when a search item is pressed or when the dialog * should be closed. */ toggleModal: () => void; /** * A function that returns custom content to render in the search modal in * place of the default. */ children?: (props: SearchModalChildrenProps) => JSX.Element; /** * Optional ability to pass in result item component renderers. */ resultItemComponents?: SearchModalChildrenProps['resultItemComponents']; } /** * @public */ declare const SearchModal: (props: SearchModalProps) => react_jsx_runtime.JSX.Element; /** * The state of the search modal, as well as functions for changing the modal's * visibility. * * @public */ type SearchModalValue = { state: { hidden: boolean; open: boolean; }; toggleModal: () => void; setOpen: (open: boolean) => void; }; /** * Props for the SearchModalProvider. * @public */ type SearchModalProviderProps = { /** * Children which should have access to the SearchModal context and the * associated useSearchModal() hook. */ children: ReactNode; /** * Pass true if the modal should be rendered initially. */ showInitially?: boolean; }; /** * A context provider responsible for storing and managing state related to the * search modal. * * @remarks * If you need to control visibility of the search toggle outside of the modal * itself, you can optionally place this higher up in the react tree where your * custom code and the search modal share the same context. * * @example * ```tsx * import { * SearchModalProvider, * SidebarSearchModal, * } from '@backstage/plugin-search'; * * // ... * * * * * {({ toggleModal }) => } * * * ``` * * @public */ declare const SearchModalProvider: (props: SearchModalProviderProps) => react_jsx_runtime.JSX.Element; /** * Use this hook to manage the state of {@link SearchModal} * and change its visibility. Monitors route changes setting the hidden state * to avoid having to call toggleModal on every result click. * * @public * * @param initialState - pass `true` to make the modal initially visible * @returns an object containing the state of the modal together with * functions for changing the visibility of the modal. */ declare function useSearchModal(initialState?: boolean): SearchModalValue; /** * @public */ declare const SearchPage$1: () => react_jsx_runtime.JSX.Element; /** * @public */ type SearchTypeAccordionProps = { name: string; types: Array<{ value: string; name: string; icon: JSX.Element; }>; defaultValue?: string; showCounts?: boolean; }; /** * @public */ type SearchTypeTabsProps = { types: Array<{ value: string; name: string; }>; defaultValue?: string; }; /** * Props for {@link SearchType}. * * @public */ type SearchTypeProps = { className?: string; name: string; values?: string[]; defaultValue?: string[] | string | null; }; /** * @public */ declare const SearchType: { (props: SearchTypeProps): react_jsx_runtime.JSX.Element; Accordion(props: SearchTypeAccordionProps): react_jsx_runtime.JSX.Element; Tabs(props: SearchTypeTabsProps): react_jsx_runtime.JSX.Element; }; /** * Props for {@link SidebarSearch}. * * @public */ type SidebarSearchProps = { icon?: IconComponent; }; /** * @public */ declare const SidebarSearch: (props: SidebarSearchProps) => react_jsx_runtime.JSX.Element; /** * Props for {@link SidebarSearchModal}. * * @public */ type SidebarSearchModalProps = Pick & { icon?: IconComponent; }; /** * @public */ declare const searchPlugin: _backstage_core_plugin_api.BackstagePlugin<{ root: _backstage_core_plugin_api.RouteRef; }, {}>; /** * @public */ declare const SearchPage: () => react_jsx_runtime.JSX.Element; /** * @public */ declare const SidebarSearchModal: (props: SidebarSearchModalProps) => JSX.Element | null; /** * @public */ declare const HomePageSearchBar: (props: HomePageSearchBarProps) => react_jsx_runtime.JSX.Element; /** * @public */ declare const searchTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"search", { readonly "searchModal.viewFullResults": "View Full Results"; readonly "searchType.tabs.allTitle": "All"; readonly "searchType.allResults": "All Results"; readonly "searchType.accordion.collapse": "Collapse"; readonly "searchType.accordion.numberOfResults": "{{number}} results"; readonly "searchType.accordion.allTitle": "All"; readonly "sidebarSearchModal.title": "Search"; }>; export { HomePageSearchBar, SearchPage$1 as Router, SearchModal, SearchModalProvider, SearchPage, SearchType, SidebarSearch, SidebarSearchModal, searchPlugin as plugin, searchPlugin, searchTranslationRef, useSearchModal }; export type { HomePageSearchBarProps, SearchModalChildrenProps, SearchModalProps, SearchModalProviderProps, SearchModalValue, SearchTypeAccordionProps, SearchTypeProps, SearchTypeTabsProps, SidebarSearchModalProps, SidebarSearchProps };