/** * Source registry for scripture data packages. * * Data packages register themselves by importing this module and calling registerSource(). */ import type { EditionMetadata, VerseData } from './models/types.js'; import type { Scheme } from './versification/schemes.js'; /** * Function type for loading a verse. */ export type VerseLoader = (book: string, chapter: number, verse: number) => Promise; /** * Function type for loading a chapter. */ export type ChapterLoader = (book: string, chapter: number) => Promise; /** * Function type for loading cache data. */ export type CacheLoader = (cacheName: string) => Promise>; /** * Function type for listing books. */ export type BooksLister = () => string[]; /** * Configuration for a scripture source. */ export interface ScriptureSource { /** Edition identifier (e.g., "crosswire-KJV") */ edition: string; /** Edition metadata */ metadata: EditionMetadata; /** Function to load a single verse */ loadVerse: VerseLoader; /** Function to load an entire chapter */ loadChapter: ChapterLoader; /** Function to load cache data */ loadCache: CacheLoader; /** Function to list available books */ listBooks: BooksLister; /** Path to data directory (for Node.js file access) */ dataPath?: string; /** Path to cache directory (for Node.js file access) */ cachePath?: string; /** * Versification scheme this edition numbers by (e.g. 'MT', 'LXX', 'English'). * Self-declared here so a new edition aligns via `getParallelVerses`/`mapVerse` * with NO core change — `schemeFor()` reads this first, falling back to the * legacy hardcoded `EDITION_SCHEME` map only for editions that don't declare it. */ versificationScheme?: Scheme; } /** * Register a scripture source. * Called by data packages when they are imported. */ export declare function registerSource(source: ScriptureSource): void; /** * Unregister a scripture source. */ export declare function unregisterSource(edition: string): boolean; /** * Get a registered source by edition name. */ export declare function getSource(edition: string): ScriptureSource | undefined; /** * List all registered edition names. */ export declare function listEditions(): string[]; /** * Get all registered sources. */ export declare function getAllSources(): Map; /** * Check if an edition is registered. */ export declare function hasEdition(edition: string): boolean; /** * Clear all registered sources (mainly for testing). */ export declare function clearSources(): void; //# sourceMappingURL=registry.d.ts.map