UNPKG

@stacksjs/stx

Version:

A performant UI Framework. Powered by Bun.

45 lines 1.16 kB
import type { AnalyzedComponent, StoryContext } from './types'; /** * Build search index from story files */ export declare function buildSearchIndex(ctx: StoryContext): void; /** * Build search index from analyzed components */ export declare function buildComponentSearchIndex(components: AnalyzedComponent[]): void; /** * Search the index */ export declare function search(query: string, limit?: any): SearchResult[]; /** * Get recent searches from localStorage (client-side) */ export declare function getRecentSearches(): string[]; /** * Clear the search index */ export declare function clearSearchIndex(): void; /** * Get search index size */ export declare function getSearchIndexSize(): number; /** * Generate search index JSON for static builds */ export declare function exportSearchIndex(): string; /** * Import search index from JSON */ export declare function importSearchIndex(json: string): void; /** * Search result item */ export declare interface SearchResult { type: 'story' | 'component' | 'prop' | 'slot' title: string description?: string storyId: string variantId?: string score: number match: string }