UNPKG

digitalpin

Version:

Library for Geospatial Addressing Solution by India Post

24 lines 885 B
/** * Taken from https://github.com/CEPT-VZG/digipin */ type LatLngResult = { latitude: string; longitude: string; }; /** * Encodes latitude & longitude into a 10-digit alphanumeric DIGIPIN * @param lat - Latitude value between 2.5 and 38.5 * @param lon - Longitude value between 63.5 and 99.5 * @returns A formatted DIGIPIN string (e.g., "ABC-DEF-GHIJ") * @throws {Error} If latitude or longitude is out of range */ export declare function getDigiPin(lat: number, lon: number): string; /** * Decodes a DIGIPIN back into its central latitude & longitude * @param digiPin - A 10-digit DIGIPIN string (with or without hyphens) * @returns Object containing the decoded latitude and longitude * @throws {Error} If DIGIPIN format is invalid */ export declare function getLatLngFromDigiPin(digiPin: string): LatLngResult; export {}; //# sourceMappingURL=digipin.d.ts.map