UNPKG

digipinjs

Version:

A comprehensive TypeScript library for encoding and decoding Indian geographic coordinates into DIGIPIN format (Indian Postal Digital PIN system). Features CLI tools, caching, batch processing, and Express middleware for seamless integration.

30 lines 777 B
type Coordinate = { latitude: number; longitude: number; }; interface Bounds { minLat: number; maxLat: number; minLon: number; maxLon: number; } declare const BOUNDS: Bounds; export type DigiPinFormat = 'hyphenated' | 'compact'; export interface EncodeOptions { format?: DigiPinFormat; roundTo?: number | 'none'; useCache?: boolean; } export interface DecodeOptions { useCache?: boolean; } /** * Encode latitude & longitude into DIGIPIN. */ export declare function getDigiPin(lat: number, lon: number, options?: EncodeOptions): string; /** * Decode DIGIPIN back to lat/lon center. */ export declare function getLatLngFromDigiPin(pin: string, options?: DecodeOptions): Coordinate; export { BOUNDS }; //# sourceMappingURL=core.d.ts.map