import * as vue from 'vue'; import { PropType, MaybeRefOrGetter } from 'vue'; import { DocSearchProps } from '@docsearch/react'; import { LocaleConfig } from 'vuepress/shared'; import { DeepRequired } from '@vuepress/helper/shared'; type DocSearchLocaleData = DeepRequired>; /** * DocSearch locale options * * DocSearch 多语言选项 */ type DocSearchLocaleOptions = Partial>; /** * DocSearch options * * DocSearch 选项 */ interface DocSearchOptions extends DocSearchLocaleOptions { /** * Locale options * * 多语言选项 */ locales?: LocaleConfig; } declare const DocSearch: vue.DefineComponent; default: () => {}; }; }>, () => (vue.VNode | null)[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; default: () => {}; }; }>> & Readonly<{}>, { containerId: string; options: DocSearchOptions; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; /** * DocSearch client locale options * * DocSearch 客户端多语言选项 */ type DocSearchClientLocaleOptions = Partial; /** * DocSearch client options * * DocSearch 客户端选项 */ interface DocSearchClientOptions extends DocSearchClientLocaleOptions { /** * Locale options * * 多语言选项 */ locales?: Record; } /** * Customize DocSearch options * * 自定义 DocSearch 选项 * * @param options - DocSearch options, support plain object, ref or getter / DocSearch 选项,支持普通对象,Ref 或 Getter * * @example * ```ts * import { defineDocSearchConfig } from '@vuepress/plugin-docsearch/client' * * // Use plain object * defineDocSearchConfig({ * translations: { * button: { * buttonText: 'Search', * }, * }, * }) * * // Use ref * const options = ref({ * translations: { * button: { * buttonText: 'Search', * }, * }, * }) * defineDocSearchConfig(options) * * // Use getter * defineDocSearchConfig(() => ({ * translations: { * button: { * buttonText: isDarkMode.value ? 'Search in dark' : 'Search in light', * }, * }, * })) * ``` */ declare const defineDocSearchConfig: (options: MaybeRefOrGetter) => void; export { DocSearch, defineDocSearchConfig }; export type { DocSearchClientLocaleOptions, DocSearchClientOptions, DocSearchLocaleData, DocSearchLocaleOptions, DocSearchOptions };