import { PostalCode } from '../../domain/models/PostalCode.js'; import { SearchableRepository, PostalCodeFilter } from '../../domain/repositories/PostalCodeRepository.js'; import { DataProvider } from '../../domain/repositories/DataProvider.js'; import { SearchStrategy } from '../../domain/services/SearchStrategy.js'; /** * Configuration for the TsPostalCodeRepository. */ export interface TsRepoConfig { /** * If true, enables fuzzy search mode using Fuse.js. * @default false */ useFuzzy?: boolean; /** * The threshold for fuzzy search sensitivity (0.0 to 1.0). * Lower values are more strict. * @default 0.4 */ fuzzyThreshold?: number; /** * Optional custom data provider. Defaults to internal TsDataProvider. */ dataProvider?: DataProvider; /** * Optional custom search strategy. Defaults to InvertedIndexStrategy. */ searchStrategy?: SearchStrategy; } /** * Implementation of SearchableRepository. * Optimized with Flyweight pattern, dynamic imports, and secondary indexing. */ export declare class TsPostalCodeRepository implements SearchableRepository { private allData; private allLoadPromise; private postalCodeIndex; private readonly useFuzzy; private readonly fuzzyThreshold; private readonly dataProvider; private searchStrategy; constructor(config?: TsRepoConfig); /** * Internal helper to build an index for postal codes. */ private buildIndex; /** * Internal helper to load data for a specific province. */ private loadProvince; /** * Internal helper to load all data. */ private ensureAllLoaded; /** * Internal helper to ensure search strategy is initialized. */ private ensureSearchStrategy; /** * Search for postal codes matching multiple keywords. */ findByKeywords(keywords: string[], provinceCode?: string): Promise; /** * Search for postal codes matching a specific code. * Optimized with secondary index for postal codes. */ findByCode(code: string, provinceCode?: string): Promise; /** * Search for postal codes matching the given structured filter. */ findByFilter(filter: PostalCodeFilter, provinceCode?: string): Promise; /** * Clear the memory cache. */ clearMemory(): void; } //# sourceMappingURL=TsPostalCodeRepository.d.ts.map