/** * Lexicon registry for lexicon data packages. * * Lexicon packages register themselves by importing this module and calling registerLexicon(). */ import type { LexiconEntry, LexiconMetadata } from '../models/types.js'; /** * Options for looking up Strong's numbers. */ export interface LookupOptions { /** Specific lexicon source to query (if omitted, queries all) */ source?: string; /** Language filter */ language?: 'hebrew' | 'greek'; } /** * Function type for looking up by Strong's number. */ export type StrongsLookup = (strongsNumber: string) => Promise; /** * Function type for looking up by lemma. */ export type LemmaLookup = (lemma: string) => Promise; /** * Function type for searching definitions. */ export type DefinitionSearch = (query: string) => Promise; /** * Configuration for a lexicon source. */ export interface LexiconSource { /** Lexicon identifier (e.g., "stepbible-tbesh") */ id: string; /** Lexicon metadata */ metadata: LexiconMetadata; /** Function to look up by Strong's number */ lookupStrongs: StrongsLookup; /** Function to look up by lemma */ lookupLemma: LemmaLookup; /** Function to search definitions (optional) */ searchDefinition?: DefinitionSearch; /** Path to data directory (for Node.js file access) */ dataPath?: string; } /** * Register a lexicon source. * Called by lexicon packages when they are imported. */ export declare function registerLexicon(source: LexiconSource): void; /** * Unregister a lexicon source. */ export declare function unregisterLexicon(id: string): boolean; /** * Get a registered lexicon by id. */ export declare function getLexicon(id: string): LexiconSource | undefined; /** * List all registered lexicon ids. */ export declare function listLexicons(): string[]; /** * Get all registered lexicon sources. */ export declare function getAllLexicons(): Map; /** * Check if a lexicon is registered. */ export declare function hasLexicon(id: string): boolean; /** * Clear all registered lexicons (mainly for testing). */ export declare function clearLexicons(): void; /** * Normalize a Strong's number to canonical form. * Handles variations like "H1", "H0001", "H00001", "h1" → "H0001" */ export declare function normalizeStrongs(strongsNumber: string): string; /** * Look up a Strong's number across all registered lexicons. * Returns all matching entries from all sources. */ export declare function lookupStrongs(strongsNumber: string, options?: LookupOptions): Promise; /** * Look up a lemma across all registered lexicons. * Returns all matching entries from all sources. */ export declare function lookupLemma(lemma: string, options?: LookupOptions): Promise; /** * Result of transliteration lookup. */ export interface TransliterationResult { /** Combined full transliteration */ transliteration: string; /** Individual parts with their Strong's numbers */ parts: Array<{ strongs: string; transliteration: string; type: 'prefix' | 'root'; }>; } /** * Get the full transliteration for a word given its lemma. * Handles OpenScriptures-style lemmas with prefix codes (e.g., "b/7225"). * * @param lemma - The lemma string (e.g., "b/7225", "c/d/776", "430") * @param options - Lookup options * @returns TransliterationResult with combined transliteration and individual parts */ export declare function getTransliteration(lemma: string, options?: LookupOptions): Promise; //# sourceMappingURL=registry.d.ts.map