/** * @fileoverview Indexing utilities for the search engine. * Pre-computes normalized text and tokens for efficient searching. */ import type { IndexedItem, RawItem } from './types'; /** * Builds a search index from raw items. * Pre-computes normalized text and tokens for each item for efficient searching. * * @param {RawItem[]} items - Array of raw items with id and label * @returns {IndexedItem[]} Array of indexed items with pre-computed norm and tokens * * @example * const items = [ * { id: '1', label: 'System Grid Control' }, * { id: '2', label: 'Network Manager' } * ]; * const indexed = buildIndex(items); * // [ * // { id: '1', label: 'System Grid Control', norm: 'system grid control', tokens: ['system', 'grid', 'control'] }, * // { id: '2', label: 'Network Manager', norm: 'network manager', tokens: ['network', 'manager'] } * // ] */ export declare function buildIndex(items: RawItem[]): IndexedItem[]; /** * Updates the index when items change. * This is an alias for buildIndex for semantic clarity. * * @param {RawItem[]} items - Array of raw items with id and label * @returns {IndexedItem[]} Array of indexed items with pre-computed norm and tokens */ export declare function rebuildIndex(items: RawItem[]): IndexedItem[];