{"version":3,"file":"types-DM3vioBY.mjs","names":[],"sources":["../src/search/types.ts"],"sourcesContent":["/**\n * Search Types\n *\n * Type definitions for the EmDash search system.\n */\n\n/**\n * Search configuration for a collection\n */\nexport const SEARCH_TOKENIZERS = [\"porter unicode61\", \"unicode61\", \"trigram\"] as const;\n\nexport type SearchTokenizer = (typeof SEARCH_TOKENIZERS)[number];\n\nexport interface SearchConfig {\n\t/** Whether search is enabled for this collection */\n\tenabled: boolean;\n\t/** Field weights for ranking (higher = more important) */\n\tweights?: Record<string, number>;\n\t/** Field slug used as the result title, from the collection's titleField. */\n\ttitleField?: string;\n\t/** FTS5 tokenizer configuration (defaults to English Porter stemming) */\n\ttokenize?: SearchTokenizer;\n}\n\n/**\n * Options for search queries\n */\nexport interface SearchOptions {\n\t/** Collections to search (defaults to all searchable collections) */\n\tcollections?: string[];\n\t/** Filter by content status (defaults to 'published') */\n\tstatus?: string;\n\t/** Filter by locale (omit to search all locales) */\n\tlocale?: string;\n\t/** Maximum results to return (defaults to 20) */\n\tlimit?: number;\n\t/** Pagination cursor */\n\tcursor?: string;\n}\n\n/**\n * Options for collection-specific search\n */\nexport interface CollectionSearchOptions {\n\t/** Filter by content status (defaults to 'published') */\n\tstatus?: string;\n\t/** Filter by locale (omit to search all locales) */\n\tlocale?: string;\n\t/** Maximum results to return (defaults to 20) */\n\tlimit?: number;\n\t/** Pagination cursor */\n\tcursor?: string;\n}\n\n/**\n * A single search result\n */\nexport interface SearchResult {\n\t/** Collection the result belongs to */\n\tcollection: string;\n\t/** Entry ID */\n\tid: string;\n\t/** Entry slug */\n\tslug: string | null;\n\t/** Content locale */\n\tlocale: string;\n\t/** Entry title (if available) */\n\ttitle?: string;\n\t/**\n\t * Highlighted snippet showing match context.\n\t *\n\t * Sanitized server-side to be safe for `set:html` / `innerHTML`:\n\t * all HTML metacharacters in the source text are escaped, and\n\t * matched terms are wrapped in literal `<mark>...</mark>` tags\n\t * (the only HTML the snippet is allowed to contain).\n\t */\n\tsnippet?: string;\n\t/** Relevance score (higher = more relevant) */\n\tscore: number;\n}\n\n/**\n * Response from a search query\n */\nexport interface SearchResponse {\n\t/** Search results */\n\titems: SearchResult[];\n\t/** Cursor for next page of results */\n\tnextCursor?: string;\n}\n\n/**\n * Options for suggestion/autocomplete queries\n */\nexport interface SuggestOptions {\n\t/** Collections to search (defaults to all searchable collections) */\n\tcollections?: string[];\n\t/** Filter by locale (omit to search all locales) */\n\tlocale?: string;\n\t/** Maximum suggestions to return (defaults to 5) */\n\tlimit?: number;\n}\n\n/**\n * A single suggestion result\n */\nexport interface Suggestion {\n\t/** Collection the suggestion belongs to */\n\tcollection: string;\n\t/** Entry ID */\n\tid: string;\n\t/** Entry slug, when available */\n\tslug?: string | null;\n\t/** Entry title */\n\ttitle: string;\n}\n\n/**\n * Search index statistics\n */\nexport interface SearchStats {\n\tcollections: Record<\n\t\tstring,\n\t\t{\n\t\t\t/** Number of indexed entries */\n\t\t\tindexed: number;\n\t\t\t/** When the index was last rebuilt */\n\t\t\tlastRebuilt?: string;\n\t\t}\n\t>;\n}\n"],"mappings":";;;;;;;;;AASA,MAAa,oBAAoB;CAAC;CAAoB;CAAa;CAAU"}