UNPKG

@zerospacegg/vynthra

Version:
35 lines (28 loc) 903 B
import type { Entity } from "@zerospacegg/iolin"; import type { Summary } from "@zerospacegg/iolin/meta/search-index"; // Search result types export interface SingleMatch { type: "single"; entity: Summary; fullEntity: Entity; // Will be the full entity data from iolin } export interface MultiMatch { type: "multi"; matches: Summary[]; } export interface NoMatch { type: "none"; query: string; } export type SearchResult = SingleMatch | MultiMatch | NoMatch; // Search options export interface SearchOptions { fuzzyThreshold?: number; // Minimum similarity score for fuzzy matching (0-1) maxResults?: number; // Maximum number of results to return for multi-match } // Internal search match scoring export interface ScoredMatch { entity: Summary; score: number; matchType: "exact-id" | "exact-slug" | "slug-end" | "id-segment" | "fuzzy-id" | "fuzzy-slug" | "fuzzy-name"; }