export interface PeRecord { ruc: string; razon_social: string; estado: string; condicion: string; ubigeo: string; tipo_via: string; nombre_via: string; codigo_zona: string; tipo_zona: string; numero: string; interior: string; lote: string; departamento: string; manzana: string; kilometro: string; } export interface CoRecord { nit: string; razon_social: string; estado_matricula: string; [key: string]: string; } /** Full OCDS 1.1 compiledRelease + url field added by Latinfo. */ export interface PeLicitacion { ocid: string; url: string; date?: string; tender: { title?: string; description?: string; datePublished?: string; value?: { amount?: number; currency?: string; }; mainProcurementCategory?: string; procurementMethodDetails?: string; tenderPeriod?: { startDate?: string; endDate?: string; }; enquiryPeriod?: { startDate?: string; endDate?: string; durationInDays?: number; }; items?: Array<{ description?: string; quantity?: number; unit?: { name?: string; }; statusDetails?: string; additionalClassifications?: Array<{ scheme?: string; id?: string; }>; }>; documents?: Array<{ title?: string; url?: string; format?: string; }>; tenderers?: Array<{ name?: string; id?: string; }>; numberOfTenderers?: number; }; buyer?: { name?: string; id?: string; }; parties?: Array<{ name?: string; roles?: string[]; address?: { region?: string; locality?: string; }; }>; awards?: Array<{ status?: string; value?: { amount?: number; currency?: string; }; suppliers?: Array<{ name?: string; id?: string; }>; date?: string; }>; contracts?: Array<{ status?: string; value?: { amount?: number; }; period?: { startDate?: string; endDate?: string; durationInDays?: number; }; }>; planning?: { budget?: { amount?: { amount?: number; currency?: string; }; }; }; [key: string]: any; } export interface LicitacionesQuery { q?: string; category?: string; min_amount?: number; max_amount?: number; buyer?: string; method?: string; status?: string; limit?: number; } interface SourceConfig { prefix: string; baseName: string; idName: string; idLength: number; nameField: string; statusField: string; } declare class Country { protected request: (path: string) => Promise; protected rawRequest: (path: string) => Promise; protected cfg: SourceConfig; private mphfIndex; constructor(request: (path: string) => Promise, rawRequest: (path: string) => Promise, cfg: SourceConfig); /** Download and load MPHF index. Call once — enables offline search. */ loadIndex(): Promise; /** Check if there is a newer MPHF and update in background. Safe to call on every app open. */ refreshIndex(): void; /** Load MPHF index from a pre-fetched buffer (e.g., bundled in APK). */ loadIndexFromBuffer(buf: ArrayBuffer): void; /** Whether MPHF index is loaded (offline search available). */ get isOffline(): boolean; /** Unload MPHF index to free memory. */ unloadIndex(): void; /** Search by name. Uses MPHF locally if loaded, API otherwise. */ search(query: string): Promise[]>; /** Force offline search (throws if index not loaded). */ searchOffline(query: string): Promise[]>; } declare class Peru extends Country { constructor(request: (path: string) => Promise, rawRequest: (path: string) => Promise); ruc(ruc: string): Promise; licitaciones(query: LicitacionesQuery): Promise; } declare class Colombia extends Country { constructor(request: (path: string) => Promise, rawRequest: (path: string) => Promise); nit(nit: string): Promise; } export declare class Latinfo { private apiKey; private baseUrl; pe: Peru; co: Colombia; constructor(apiKey: string, options?: { baseUrl?: string; }); rotate(): Promise<{ api_key: string; github_username: string; }>; private request; private rawRequest; } export {};