import { type LauncherSynonyms } from "./engine/engine"; import type { LauncherAnswer, LauncherFact, LauncherIcon, LauncherResultGroup, LauncherSearchItem, LauncherSection } from "./NavLauncherProps"; export type LauncherResult = { /** Unique within the result list; prefixed `screen:`, `module:`, `action:` or by the group id. */ id: string; /** Row text. */ label: string; /** Second line, such as the module a screen belongs to. */ context?: string; /** Row icon. */ icon?: LauncherIcon; /** Short text appended to `context`. */ hint?: string; /** Count or short text shown on the row. */ badge?: number | string; /** Destination of the row. */ href?: string; /** Action to perform instead of navigating. */ run?: () => void; /** Screen the row stands for, so it can be pinned and counted; a module row carries its first screen. */ screenId?: string; /** Set on `searchLauncherSections` rows: a module row or one of its screens. */ kind?: "module" | "screen"; /** Keyword that matched a module or screen whose own name did not. */ keywordHint?: string; /** Shows the "New" tag after the label. */ isNew?: boolean; /** Label/value pairs shown in the Preview pane. */ facts?: readonly LauncherFact[]; /** Direct-answer payload rendered as an answer card. */ answer?: LauncherAnswer; /** Relevance from the spotlight engine; higher ranks first. */ score?: number; }; export type LauncherResultView = { /** Group id, e.g. "actions" or a `LauncherResultGroup.id`. */ id: string; /** Group heading. */ label: string; /** Matching rows in rank order. */ items: LauncherResult[]; }; export declare function filterItems(items: readonly LauncherSearchItem[], query: string): LauncherSearchItem[]; export declare function flattenScreens(sections: readonly LauncherSection[]): LauncherResult[]; /** @deprecated Legacy flat search; NavLauncher uses searchLauncherSections (classic) or the spotlight engine. */ export declare function searchLauncher(input: { /** Text to match; all whitespace-separated tokens must appear. */ query: string; /** Sections whose screens are searched, flattened and de-duplicated by screen id. */ sections: readonly LauncherSection[]; /** Command rows matched by label, context and keywords. */ actions?: readonly LauncherSearchItem[]; /** Remote result groups appended unfiltered, in the given order. */ extraResults?: readonly LauncherResultGroup[]; /** Heading of the Screens group. */ screensLabel: string; /** Heading of the Actions group. */ actionsLabel: string; }): LauncherResultView[]; export type LauncherSectionResult = { /** Id of the source `LauncherSection`. */ id: string; /** Heading of the source section. */ label: string; /** Matching module rows, each followed by its matching screens. */ items: LauncherResult[]; }; /** Search that keeps the sections: per section, matching modules, each followed by its matching screens. */ export declare function searchLauncherSections(input: { /** Text to match; all whitespace-separated tokens must appear. */ query: string; /** Sections whose modules and screens are searched. */ sections: readonly LauncherSection[]; /** Command rows matched by label, context and keywords. */ actions?: readonly LauncherSearchItem[]; /** Remote result groups appended unfiltered, in the given order. */ extraResults?: readonly LauncherResultGroup[]; /** Heading of the Actions group. */ actionsLabel: string; }): { sections: LauncherSectionResult[]; groups: LauncherResultView[]; }; export type HighlightSegment = { /** A slice of the original text. */ text: string; /** True when the slice matched the query. */ isMatch: boolean; }; /** Highlight options; `fuzzy` also marks prefix, typo, initial and accent-folded matches. */ export type HighlightOptions = { /** Also marks prefix, typo, initial and accent-folded matches; off marks plain substrings only. */ fuzzy?: boolean; /** Equivalent terms to mark too; only read when `fuzzy` is set. */ synonyms?: LauncherSynonyms; }; /** Splits `text` so every case-insensitive occurrence of a query token is its own matched segment. */ export declare function highlightSegments(text: string, query: string, options?: HighlightOptions): HighlightSegment[];