india-pincode-finder
Version:
Find detailed Indian address information by using a valid 6-digit PIN code. Ideal for logistics, address validation, fintech onboarding (KYC), e-commerce, and mapping services.
46 lines (45 loc) • 1.43 kB
TypeScript
export interface PincodeData {
district: string;
block: string;
state: string;
[key: string]: string;
}
/**
* Loads pincode data with in-memory caching
* @param jsonPath Optional path to a custom JSON file
*/
export declare function loadPincodeData(jsonPath?: string): {
[key: string]: PincodeData;
};
/**
* Clear all cached data
*/
export declare function clearCache(): void;
/**
* Get full address details for a pincode
* @param pincode 6-digit PIN code
* @returns Address object or null if not found
* @throws Error if the pincode is not a valid 6-digit number.
*/
export declare function pinToAddress(pincode: number): PincodeData | null;
/**
* Get state for a pincode
* @param pincode 6-digit PIN code
* @returns State name or null if not found
* @throws Error if the pincode is not a valid 6-digit number.
*/
export declare function pinToState(pincode: number): string | null;
/**
* Get district for a pincode
* @param pincode 6-digit PIN code
* @returns District name or null if not found
* @throws Error if the pincode is not a valid 6-digit number.
*/
export declare function pinToDistrict(pincode: number): string | null;
/**
* Get taluka/block for a pincode
* @param pincode 6-digit PIN code
* @returns Taluka/Block name or null if not found
* @throws Error if the pincode is not a valid 6-digit number.
*/
export declare function pinToTaluka(pincode: number): string | null;