UNPKG

india-state-district

Version:

A lightweight TypeScript library for handling Indian states and districts data with type safety, geolocation support, and easy integration

37 lines 2.75 kB
"use strict"; /** * Main entry point for the india-state-district package * Exports all public functionality */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getIndiaFlagDataUrl = exports.getIndiaFlagSVG = exports.INDIA_FLAG_COLORS = exports.INDIA_FLAG_SVG = exports.IndiaStateDistrict = exports.createIndiaStateDistrict = exports.isGeolocationSupported = exports.detectStateFromLocation = exports.getAllStatesWithDistricts = exports.getCurrentState = exports.getAllStateCodes = exports.getAllStates = exports.getDistricts = void 0; const india_state_district_factory_1 = require("./services/india-state-district.factory"); Object.defineProperty(exports, "createIndiaStateDistrict", { enumerable: true, get: function () { return india_state_district_factory_1.createIndiaStateDistrict; } }); const india_state_district_service_1 = require("./services/india-state-district.service"); Object.defineProperty(exports, "IndiaStateDistrict", { enumerable: true, get: function () { return india_state_district_service_1.IndiaStateDistrict; } }); const india_flag_1 = require("./assets/india-flag"); Object.defineProperty(exports, "INDIA_FLAG_SVG", { enumerable: true, get: function () { return india_flag_1.INDIA_FLAG_SVG; } }); Object.defineProperty(exports, "INDIA_FLAG_COLORS", { enumerable: true, get: function () { return india_flag_1.INDIA_FLAG_COLORS; } }); Object.defineProperty(exports, "getIndiaFlagSVG", { enumerable: true, get: function () { return india_flag_1.getIndiaFlagSVG; } }); Object.defineProperty(exports, "getIndiaFlagDataUrl", { enumerable: true, get: function () { return india_flag_1.getIndiaFlagDataUrl; } }); // Create default instance const india = (0, india_state_district_factory_1.createIndiaStateDistrict)(); // Export direct utility functions from default instance const getDistricts = (stateCode) => india.getDistrictsForState(stateCode); exports.getDistricts = getDistricts; const getAllStates = () => india.getAllStates(); exports.getAllStates = getAllStates; const getAllStateCodes = () => india.getAllStateCodes(); exports.getAllStateCodes = getAllStateCodes; const getCurrentState = () => india.getCurrentState(); exports.getCurrentState = getCurrentState; const getAllStatesWithDistricts = () => india.getAllStatesWithDistricts(); exports.getAllStatesWithDistricts = getAllStatesWithDistricts; //<----- Geolocation exports -----> const detectStateFromLocation = (options) => india.detectStateFromLocation(options); exports.detectStateFromLocation = detectStateFromLocation; const isGeolocationSupported = () => india.isGeolocationSupported(); exports.isGeolocationSupported = isGeolocationSupported; // Export default instance exports.default = india; //# sourceMappingURL=index.js.map