import type { VNode } from 'vue'; import type { ContentNavigationItem } from '@nuxt/content'; import type { AppConfig } from '@nuxt/schema'; import type { UseFuseOptions } from '@vueuse/integrations/useFuse'; import theme from '#build/b24ui/content/content-search'; import type { ButtonProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconComponent, LinkPropsKeys } from '../../types'; import type { ComponentConfig } from '../../types/tv'; type ContentSearch = ComponentConfig; export interface ContentSearchLink extends Omit { label?: string; description?: string; /** * @IconComponent */ icon?: IconComponent; children?: ContentSearchLink[]; } export interface ContentSearchFile { id: string; title: string; titles: string[]; level: number; content: string; } export interface ContentSearchItem extends Omit, CommandPaletteItem { level?: number; /** * @IconComponent */ icon?: IconComponent; } /** * @memo not use loadingIcon */ export interface ContentSearchProps extends Pick, Pick, ContentSearchItem>, 'icon' | 'placeholder' | 'autofocus' | 'loading' | 'closeIcon' | 'groups'> { /** * @defaultValue 'md' */ size?: ContentSearch['variants']['size']; /** * Display a close button in the input (useful when inside a Modal for example). * `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"} * @emits 'update:open' * @defaultValue true */ close?: boolean | Omit; /** * Keyboard shortcut to open the search (used by [`defineShortcuts`](https://bitrix24.github.io/b24ui/docs/composables/define-shortcuts/)) * @defaultValue 'meta_k' */ shortcut?: string; /** Links group displayed as the first group in the command palette. */ links?: T[]; navigation?: ContentNavigationItem[]; files?: ContentSearchFile[]; /** * Options for [useFuse](https://vueuse.org/integrations/useFuse) passed to the [CommandPalette](https://bitrix24.github.io/b24ui/docs/components/command-palette/). * @defaultValue { fuseOptions: { ignoreLocation: true, includeMatches: true, useTokenSearch: true, threshold: 0.1, keys: ['label', 'description', 'suffix'] }, resultLimit: 12, matchAllWhenSearchEmpty: true } */ fuse?: UseFuseOptions; /** * Delay (in milliseconds) before the search term is passed to Fuse (debounced). * Useful for large doc sets where running fuzzy search on every keystroke is the bottleneck — the input stays responsive while Fuse only re-runs after typing settles. * Set to `0` to disable. * @defaultValue 100 */ searchDelay?: number; /** * When `true`, the theme command will be added to the groups. * @defaultValue true */ colorMode?: boolean; class?: any; b24ui?: ContentSearch['slots'] & CommandPaletteProps, ContentSearchItem>['b24ui']; } export type ContentSearchSlots = CommandPaletteSlots & { content?(props: { close: () => void; }): VNode[]; }; declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal<(ContentSearchProps & { searchTerm?: string; }) & { "onUpdate:searchTerm"?: ((value: string) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: import("vue").ShallowUnwrapRef<{ commandPaletteRef: Readonly>; }>) => void; attrs: any; slots: ContentSearchSlots; emit: (event: "update:searchTerm", value: string) => void; }>) => import("vue").VNode & { __ctx?: Awaited; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};