import { ImageResolvedAssetSource, NativeModules } from 'react-native'; const { MapplsDirectionWidgetReactNative } = NativeModules; const { RESOURCE_ADV_KEY, RESOURCE_ETA_KEY, RESOURCE_TRAFFIC_KEY, PROFILE_DRIVING_KEY, PROFILE_BIKING_KEY, PROFILE_TRUCKING_KEY, PROFILE_WALKING_KEY, OVERVIEW_FULL_KEY, OVERVIEW_FALSE_KEY, OVERVIEW_SIMPLIFIED_KEY, EXCLUDE_TOLLS_KEY, EXCLUDE_FERRY_KEY, EXCLUDE_MOTORWAY_KEY, POD_SUB_LOCALITY_KEY, POD_LOCALITY_KEY, POD_CITY_KEY, POD_VILLAGE_KEY, POD_SUB_DISTRICT_KEY, POD_DISTRICT_KEY, POD_STATE_KEY, POD_SUB_SUB_LOCALITY_KEY, GRAVITY_LEFT_KEY, GRAVITY_CENTER_KEY, GRAVITY_RIGHT_KEY, GRAVITY_TOP_KEY, GRAVITY_BOTTOM_KEY, SIZE_SMALL_KEY, SIZE_MEDIUM_KEY, SIZE_LARGE_KEY, ATTRIBUTIONS_CONGESTION_KEY, ATTRIBUTIONS_DISTANCE_KEY, ATTRIBUTIONS_DURATION_KEY, } = MapplsDirectionWidgetReactNative.getConstants(); enum DirectionsCriteria { //resources RESOURCE_ROUTE = RESOURCE_ADV_KEY, RESOURCE_ROUTE_ETA = RESOURCE_ETA_KEY, RESOURCE_ROUTE_TRAFFIC = RESOURCE_TRAFFIC_KEY, //profiles PROFILE_DRIVING = PROFILE_DRIVING_KEY, PROFILE_WALKING = PROFILE_WALKING_KEY, PROFILE_BIKING = PROFILE_BIKING_KEY, PROFILE_TRUCKING = PROFILE_TRUCKING_KEY, //overview OVERVIEW_FULL = OVERVIEW_FULL_KEY, OVERVIEW_FALSE = OVERVIEW_FALSE_KEY, OVERVIEW_SIMPLIFIED = OVERVIEW_SIMPLIFIED_KEY, //excludes EXCLUDE_FERRY = EXCLUDE_FERRY_KEY, EXCLUDE_MOTORWAY = EXCLUDE_MOTORWAY_KEY, EXCLUDE_TOLL = EXCLUDE_TOLLS_KEY, //attributions ATTRIBUTIONS_CONGESTION = ATTRIBUTIONS_CONGESTION_KEY, ATTRIBUTIONS_DISTANCE = ATTRIBUTIONS_DISTANCE_KEY, ATTRIBUTIONS_DURATION = ATTRIBUTIONS_DURATION_KEY, } enum PlaceOptionsConstants { //Pods POD_SUB_LOCALITY = POD_SUB_LOCALITY_KEY, POD_LOCALITY = POD_LOCALITY_KEY, POD_CITY = POD_CITY_KEY, POD_VILLAGE = POD_VILLAGE_KEY, POD_SUB_DISTRICT = POD_SUB_DISTRICT_KEY, POD_DISTRICT = POD_DISTRICT_KEY, POD_STATE = POD_STATE_KEY, POD_SUB_SUB_LOCALITY = POD_SUB_SUB_LOCALITY_KEY, //attributionHorizontalAlignment GRAVITY_LEFT = GRAVITY_LEFT_KEY, GRAVITY_CENTER = GRAVITY_CENTER_KEY, GRAVITY_RIGHT = GRAVITY_RIGHT_KEY, //attributionVerticalAlignment GRAVITY_TOP = GRAVITY_TOP_KEY, GRAVITY_BOTTOM = GRAVITY_BOTTOM_KEY, //logoSize SIZE_SMALL = SIZE_SMALL_KEY, SIZE_MEDIUM = SIZE_MEDIUM_KEY, SIZE_LARGE = SIZE_LARGE_KEY, } interface DestinationLocationProps { longitude:number, latitude:number, address:string, name:string, } interface DestinationMapplsPinProps { address: string; name: string; mapplsPin: string; } interface PlaceOptions { location?: [number,number]; filter?: string; historyCount?: number;//only for android zoom?: number; saveHistory?: boolean; //only for android pod?: PlaceOptionsConstants; tokenizeAddress?: boolean; backgroundColor?: string; toolbarColor?: string; hint?: string;//only for android attributionVerticalAlignment?: PlaceOptionsConstants; attributionHorizontalAlignment?: PlaceOptionsConstants; logoSize?:PlaceOptionsConstants; userAddedLocationEnable?: boolean; limit?: number; enableTextSearch?: boolean; minCharactersForSearch?: number; statusBarColor?: string; toolbarTintColor?: string; showPoweredByText?: boolean; hyperLocal?: boolean; isShowCurrentLocation?: boolean; debounce?: number; favoritePlaces?:Array; favoriteCount?:number; resultBackgroundColor?:string; placeNameTextColor?:string; addressTextColor?:string; savedPlaceNameTextColor?:string; favoritePlaceNameTextColor?:string; distanceTextColor?:string; errorBackgroundColor?:string; errorTextColor?:string; hintColor?:string; poweredByTextColor?:string; attributionBackgroundColor?:string; currentLocationBackground?:string; responseLang?:string; } interface DirectionFavoritePlace { placeName?:string; placeAddress?:string; mapplsPin?:string; latitude?:number; longitude?:number; otherInfo?:any; } interface CategoryCode { category:string; icon:ImageResolvedAssetSource; categoryCode:Array; markerIcon:ImageResolvedAssetSource; isSelected?:boolean; } interface DirectionProps { resource?: DirectionsCriteria; showStartNavigation?: boolean; showAlternative?: boolean; profile?: DirectionsCriteria; overview?: DirectionsCriteria; steps?: boolean; searchAlongRoute?:boolean; alongRouteBuffer?:number; categoryCodes?:Array; excludes?: Array;//only for Android attributions?:Array; destination?: DestinationLocationProps | DestinationMapplsPinProps; source?: DestinationLocationProps | DestinationMapplsPinProps; searchPlaceOption?: PlaceOptions; showAddWaypointOption?: boolean; showRouteReportSummary?: boolean; showTripCostSummary?: boolean; isSort?: boolean; routeType?: number; lessVerbose?:boolean; continueStraight?:boolean; geometries?:string; instructions?:boolean; showHeavyVehicleProfile?:boolean; showWalkingProfile?:boolean; mapplsStyle?:string; } type MapplsDirectionWidgetReactNativeType = { openDirectionWidget(directionProps: DirectionProps):Promise; }; const MapplsDirectionWidget = MapplsDirectionWidgetReactNative; export { DirectionsCriteria,PlaceOptionsConstants }; export default MapplsDirectionWidget as MapplsDirectionWidgetReactNativeType;