react-native-map4d-services 1.0.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,111 +1,217 @@
1
- export declare type MFLocationComponent = {
2
- latitude: number;
3
- longitude: number;
4
- alias?: string;
5
- };
6
- export declare type MFViewboxComponent = {
7
- southwest: MFLocationComponent;
8
- northeast: MFLocationComponent;
9
- };
10
- export declare enum MFTravelMode {
11
- car = "car",
12
- bike = "bike",
13
- foot = "foot",
14
- motorcycle = "motorcycle"
15
- }
16
- export declare enum MFRouteWeighting {
17
- shortest = "shortest",
18
- fastest = "fastest",
19
- balance = "balance"
20
- }
21
- export declare enum MFLanguageResult {
22
- en = "en",
23
- vi = "vi"
24
- }
25
- export declare enum MFRouteType {
26
- motorway = "motorway",
27
- trunk = "trunk",
28
- ferry = "ferry",
29
- bridge = "bridge",
30
- tunnel = "tunnel"
31
- }
32
- export declare type MFRouteRestriction = {
33
- location?: MFLocationComponent;
34
- radius?: number;
35
- viewbox?: MFViewboxComponent;
36
- path?: MFLocationComponent[];
37
- types?: MFRouteType[] | string[];
38
- };
39
- export declare type MFSuggestionParams = {
40
- text: string;
41
- location?: MFLocationComponent;
42
- acronym?: boolean;
43
- };
44
- export declare type MFTextSearchParams = {
45
- text: string;
46
- types?: string[];
47
- datetime?: number;
48
- location?: MFLocationComponent;
49
- };
50
- export declare type MFNearbySearchParams = {
51
- location: MFLocationComponent;
52
- radius: number;
53
- text?: string;
54
- types?: string[];
55
- tags?: string[];
56
- datetime?: number;
57
- };
58
- export declare type MFViewboxSearchParams = {
59
- viewbox: MFViewboxComponent;
60
- text?: string;
61
- types?: string[];
62
- tags?: string[];
63
- datetime?: number;
64
- };
65
- export declare type MFGeocodeParams = {
66
- location?: MFLocationComponent;
67
- address?: string;
68
- viewbox?: MFViewboxComponent;
69
- };
70
- export declare type MFDirectionsParams = {
71
- origin: MFLocationComponent;
72
- destination: MFLocationComponent;
73
- waypoints?: MFLocationComponent[];
74
- mode?: MFTravelMode | string;
75
- weighting?: MFRouteWeighting | string;
76
- language?: MFLanguageResult | string;
77
- restriction?: MFRouteRestriction;
78
- };
79
- export declare type MFRouteETAParams = {
80
- origins: MFLocationComponent[];
81
- destination: MFLocationComponent;
82
- mode?: MFTravelMode | string;
83
- weighting?: MFRouteWeighting | string;
84
- language?: MFLanguageResult | string;
85
- restriction?: MFRouteRestriction;
86
- };
87
- export declare type MFDistanceMatrixParams = {
88
- origins: MFLocationComponent[];
89
- destinations: MFLocationComponent[];
90
- mode?: MFTravelMode | string;
91
- weighting?: MFRouteWeighting | string;
92
- language?: MFLanguageResult | string;
93
- restriction?: MFRouteRestriction;
94
- };
95
- export declare type MFGraphRouteParams = {
96
- locations: MFLocationComponent[];
97
- mode?: MFTravelMode | string;
98
- weighting?: MFRouteWeighting | string;
99
- language?: MFLanguageResult | string;
100
- restriction?: MFRouteRestriction;
101
- };
102
- export declare function fetchSuggestion(params: MFSuggestionParams): Promise<any>;
103
- export declare function fetchPlaceDetail(placeId: string): Promise<any>;
104
- export declare function fetchTextSearch(params: MFTextSearchParams): Promise<any>;
105
- export declare function fetchNearbySearch(params: MFNearbySearchParams): Promise<any>;
106
- export declare function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any>;
107
- export declare function fetchGeocode(params: MFGeocodeParams): Promise<any>;
108
- export declare function fetchDirections(params: MFDirectionsParams): Promise<any>;
109
- export declare function fetchRouteETA(params: MFRouteETAParams): Promise<any>;
110
- export declare function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any>;
111
- export declare function fetchGraphRoute(params: MFGraphRouteParams): Promise<any>;
1
+ export declare type MFLocationComponent = {
2
+ latitude: number;
3
+ longitude: number;
4
+ alias?: string;
5
+ };
6
+ export declare type MFViewboxComponent = {
7
+ southwest: MFLocationComponent;
8
+ northeast: MFLocationComponent;
9
+ };
10
+ export declare enum MFTravelMode {
11
+ car = "car",
12
+ bike = "bike",
13
+ foot = "foot",
14
+ motorcycle = "motorcycle"
15
+ }
16
+ export declare enum MFRouteWeighting {
17
+ shortest = "shortest",
18
+ fastest = "fastest",
19
+ balance = "balance"
20
+ }
21
+ export declare enum MFLanguageResult {
22
+ en = "en",
23
+ vi = "vi"
24
+ }
25
+ export declare enum MFRouteType {
26
+ motorway = "motorway",
27
+ trunk = "trunk",
28
+ ferry = "ferry",
29
+ bridge = "bridge",
30
+ tunnel = "tunnel"
31
+ }
32
+ export declare type MFRouteRestriction = {
33
+ location?: MFLocationComponent;
34
+ radius?: number;
35
+ viewbox?: MFViewboxComponent;
36
+ path?: MFLocationComponent[];
37
+ types?: MFRouteType[] | string[];
38
+ };
39
+ export declare type MFSuggestionParams = {
40
+ text: string;
41
+ location?: MFLocationComponent;
42
+ acronym?: boolean;
43
+ };
44
+ export declare type MFTextSearchParams = {
45
+ text: string;
46
+ types?: string[];
47
+ datetime?: number;
48
+ location?: MFLocationComponent;
49
+ };
50
+ export declare type MFNearbySearchParams = {
51
+ location: MFLocationComponent;
52
+ radius: number;
53
+ text?: string;
54
+ types?: string[];
55
+ tags?: string[];
56
+ datetime?: number;
57
+ };
58
+ export declare type MFViewboxSearchParams = {
59
+ viewbox: MFViewboxComponent;
60
+ text?: string;
61
+ types?: string[];
62
+ tags?: string[];
63
+ datetime?: number;
64
+ };
65
+ export declare type MFGeocodeParams = {
66
+ location?: MFLocationComponent;
67
+ address?: string;
68
+ viewbox?: MFViewboxComponent;
69
+ };
70
+ export declare type MFDirectionsParams = {
71
+ origin: MFLocationComponent;
72
+ destination: MFLocationComponent;
73
+ waypoints?: MFLocationComponent[];
74
+ mode?: MFTravelMode | string;
75
+ weighting?: MFRouteWeighting | string;
76
+ language?: MFLanguageResult | string;
77
+ restriction?: MFRouteRestriction;
78
+ };
79
+ export declare type MFDistanceMatrixParams = {
80
+ origins: MFLocationComponent[];
81
+ destinations: MFLocationComponent[];
82
+ mode?: MFTravelMode | string;
83
+ weighting?: MFRouteWeighting | string;
84
+ language?: MFLanguageResult | string;
85
+ restriction?: MFRouteRestriction;
86
+ };
87
+ declare type MFServiceResponse<T> = {
88
+ code: string;
89
+ message?: string;
90
+ result?: T;
91
+ };
92
+ export declare type MFSuggestionResult = Array<{
93
+ id?: string;
94
+ name?: string;
95
+ address?: string;
96
+ distance?: number;
97
+ location?: {
98
+ lat: number;
99
+ lng: number;
100
+ };
101
+ types?: string[];
102
+ [_: string]: unknown;
103
+ }>;
104
+ export declare type MFSuggestionResponse = MFServiceResponse<MFSuggestionResult>;
105
+ export declare function fetchSuggestion(params: MFSuggestionParams): Promise<MFSuggestionResponse>;
106
+ export declare type MFPlaceDetailResult = {
107
+ id?: string;
108
+ name?: string;
109
+ description?: string;
110
+ address?: string;
111
+ addressComponents?: Array<any>;
112
+ distance?: number;
113
+ location?: {
114
+ lat: number;
115
+ lng: number;
116
+ };
117
+ types?: string[];
118
+ tags?: string[];
119
+ photos?: Array<any>;
120
+ metadata?: Array<any>;
121
+ [_: string]: unknown;
122
+ };
123
+ export declare type MFPlaceDetailResponse = MFServiceResponse<MFPlaceDetailResult>;
124
+ export declare function fetchPlaceDetail(placeId: string): Promise<MFPlaceDetailResponse>;
125
+ export declare type MFTextSearchResult = Array<{
126
+ id?: string;
127
+ name?: string;
128
+ address?: string;
129
+ distance?: number;
130
+ location?: {
131
+ lat: number;
132
+ lng: number;
133
+ };
134
+ types?: string[];
135
+ [_: string]: unknown;
136
+ }>;
137
+ export declare type MFTextSearchResponse = MFServiceResponse<MFTextSearchResult>;
138
+ export declare function fetchTextSearch(params: MFTextSearchParams): Promise<MFTextSearchResponse>;
139
+ export declare type MFNearbySearchResult = Array<{
140
+ id?: string;
141
+ name?: string;
142
+ address?: string;
143
+ distance?: number;
144
+ location?: {
145
+ lat: number;
146
+ lng: number;
147
+ };
148
+ types?: string[];
149
+ [_: string]: unknown;
150
+ }>;
151
+ export declare type MFNearbySearchResponse = MFServiceResponse<MFNearbySearchResult>;
152
+ export declare function fetchNearbySearch(params: MFNearbySearchParams): Promise<MFNearbySearchResponse>;
153
+ export declare type MFViewboxSearchResult = Array<{
154
+ id?: string;
155
+ name?: string;
156
+ address?: string;
157
+ distance?: number;
158
+ location?: {
159
+ lat: number;
160
+ lng: number;
161
+ };
162
+ types?: string[];
163
+ [_: string]: unknown;
164
+ }>;
165
+ export declare type MFViewboxSearchResponse = MFServiceResponse<MFViewboxSearchResult>;
166
+ export declare function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<MFViewboxSearchResponse>;
167
+ export declare type MFGeocodeResult = Array<{
168
+ id?: string;
169
+ name?: string;
170
+ address?: string;
171
+ distance?: number;
172
+ location?: {
173
+ lat: number;
174
+ lng: number;
175
+ };
176
+ types?: string[];
177
+ addressComponents?: Array<any>;
178
+ [_: string]: unknown;
179
+ }>;
180
+ export declare type MFGeocodeResponse = MFServiceResponse<MFGeocodeResult>;
181
+ export declare function fetchGeocode(params: MFGeocodeParams): Promise<MFGeocodeResponse>;
182
+ export declare type MFDirectionsResult = {
183
+ routes?: Array<{
184
+ summary?: string;
185
+ overviewPolyline?: string;
186
+ distance?: {
187
+ [key: string]: any;
188
+ };
189
+ duration?: {
190
+ [key: string]: any;
191
+ };
192
+ legs?: Array<{
193
+ [key: string]: any;
194
+ }>;
195
+ snappedWaypoints?: Array<{
196
+ lat: number;
197
+ lng: number;
198
+ }>;
199
+ [_: string]: unknown;
200
+ }>;
201
+ [_: string]: unknown;
202
+ };
203
+ export declare type MFDirectionsResponse = MFServiceResponse<MFDirectionsResult>;
204
+ export declare function fetchDirections(params: MFDirectionsParams): Promise<MFDirectionsResponse>;
205
+ export declare type MFDistanceMatrixResult = {
206
+ originAddresses?: string[];
207
+ destinationAddresses?: string[];
208
+ routeRows: Array<{
209
+ elements: Array<{
210
+ [key: string]: any;
211
+ }>;
212
+ }>;
213
+ [_: string]: unknown;
214
+ };
215
+ export declare type MFDistanceMatrixResponse = MFServiceResponse<MFDistanceMatrixResult>;
216
+ export declare function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<MFDistanceMatrixResponse>;
217
+ export {};
package/package.json CHANGED
@@ -1,150 +1,151 @@
1
- {
2
- "name": "react-native-map4d-services",
3
- "version": "1.0.2",
4
- "description": "React Native Map4dServices for iOS + Android",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
10
- "files": [
11
- "src",
12
- "lib",
13
- "android",
14
- "ios",
15
- "cpp",
16
- "react-native-map4d-services.podspec",
17
- "!lib/typescript/example",
18
- "!android/build",
19
- "!ios/build",
20
- "!**/__tests__",
21
- "!**/__fixtures__",
22
- "!**/__mocks__"
23
- ],
24
- "scripts": {
25
- "test": "jest",
26
- "typescript": "tsc --noEmit",
27
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
- "prepare": "bob build",
29
- "release": "release-it",
30
- "example": "yarn --cwd example",
31
- "pods": "cd example && pod-install --quiet",
32
- "bootstrap": "yarn example && yarn && yarn pods"
33
- },
34
- "keywords": [
35
- "react",
36
- "react-native",
37
- "map4d",
38
- "services",
39
- "map4d-services",
40
- "iotlink"
41
- ],
42
- "repository": "https://github.com/map4d/map4d-services-react-native",
43
- "author": "IOTLink <admin@iotlink.com.vn> (https://iotlink.com.vn/)",
44
- "license": "MIT",
45
- "bugs": {
46
- "url": "https://github.com/map4d/map4d-services-react-native/issues"
47
- },
48
- "homepage": "https://github.com/map4d/map4d-services-react-native#readme",
49
- "publishConfig": {
50
- "registry": "https://registry.npmjs.org/"
51
- },
52
- "devDependencies": {
53
- "@commitlint/config-conventional": "^11.0.0",
54
- "@react-native-community/eslint-config": "^2.0.0",
55
- "@release-it/conventional-changelog": "^2.0.0",
56
- "@types/jest": "^26.0.0",
57
- "@types/react": "^16.9.19",
58
- "@types/react-native": "0.62.13",
59
- "commitlint": "^11.0.0",
60
- "eslint": "^7.2.0",
61
- "eslint-config-prettier": "^7.0.0",
62
- "eslint-plugin-prettier": "^3.1.3",
63
- "husky": "^6.0.0",
64
- "jest": "^26.0.1",
65
- "pod-install": "^0.1.0",
66
- "prettier": "^2.0.5",
67
- "react": "16.13.1",
68
- "react-native": "0.63.4",
69
- "react-native-builder-bob": "^0.18.0",
70
- "release-it": "^14.2.2",
71
- "typescript": "^4.1.3"
72
- },
73
- "peerDependencies": {
74
- "react": "*",
75
- "react-native": "*"
76
- },
77
- "jest": {
78
- "preset": "react-native",
79
- "modulePathIgnorePatterns": [
80
- "<rootDir>/example/node_modules",
81
- "<rootDir>/lib/"
82
- ]
83
- },
84
- "commitlint": {
85
- "extends": [
86
- "@commitlint/config-conventional"
87
- ]
88
- },
89
- "release-it": {
90
- "git": {
91
- "commitMessage": "chore: release ${version}",
92
- "tagName": "v${version}"
93
- },
94
- "npm": {
95
- "publish": true
96
- },
97
- "github": {
98
- "release": true
99
- },
100
- "plugins": {
101
- "@release-it/conventional-changelog": {
102
- "preset": "angular"
103
- }
104
- }
105
- },
106
- "eslintConfig": {
107
- "root": true,
108
- "extends": [
109
- "@react-native-community",
110
- "prettier"
111
- ],
112
- "rules": {
113
- "prettier/prettier": [
114
- "error",
115
- {
116
- "quoteProps": "consistent",
117
- "singleQuote": true,
118
- "tabWidth": 2,
119
- "trailingComma": "es5",
120
- "useTabs": false
121
- }
122
- ]
123
- }
124
- },
125
- "eslintIgnore": [
126
- "node_modules/",
127
- "lib/"
128
- ],
129
- "prettier": {
130
- "quoteProps": "consistent",
131
- "singleQuote": true,
132
- "tabWidth": 2,
133
- "trailingComma": "es5",
134
- "useTabs": false
135
- },
136
- "react-native-builder-bob": {
137
- "source": "src",
138
- "output": "lib",
139
- "targets": [
140
- "commonjs",
141
- "module",
142
- [
143
- "typescript",
144
- {
145
- "project": "tsconfig.build.json"
146
- }
147
- ]
148
- ]
149
- }
150
- }
1
+ {
2
+ "name": "react-native-map4d-services",
3
+ "version": "1.2.0",
4
+ "description": "React Native Map4dServices for iOS + Android",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "*.podspec",
17
+ "react-native-map4d-services.podspec",
18
+ "!lib/typescript/example",
19
+ "!android/build",
20
+ "!ios/build",
21
+ "!**/__tests__",
22
+ "!**/__fixtures__",
23
+ "!**/__mocks__"
24
+ ],
25
+ "scripts": {
26
+ "test": "jest",
27
+ "typescript": "tsc --noEmit",
28
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
+ "prepare": "bob build",
30
+ "release": "release-it",
31
+ "example": "yarn --cwd example",
32
+ "pods": "cd example && pod-install --quiet",
33
+ "bootstrap": "yarn example && yarn && yarn pods"
34
+ },
35
+ "keywords": [
36
+ "react",
37
+ "react-native",
38
+ "map4d",
39
+ "services",
40
+ "map4d-services",
41
+ "iotlink"
42
+ ],
43
+ "repository": "https://github.com/map4d/map4d-services-react-native",
44
+ "author": "IOTLink <admin@iotlink.com.vn> (https://iotlink.com.vn/)",
45
+ "license": "MIT",
46
+ "bugs": {
47
+ "url": "https://github.com/map4d/map4d-services-react-native/issues"
48
+ },
49
+ "homepage": "https://github.com/map4d/map4d-services-react-native#readme",
50
+ "publishConfig": {
51
+ "registry": "https://registry.npmjs.org/"
52
+ },
53
+ "devDependencies": {
54
+ "@commitlint/config-conventional": "^11.0.0",
55
+ "@react-native-community/eslint-config": "^2.0.0",
56
+ "@release-it/conventional-changelog": "^2.0.0",
57
+ "@types/jest": "^26.0.0",
58
+ "@types/react": "^16.9.19",
59
+ "@types/react-native": "0.62.13",
60
+ "commitlint": "^11.0.0",
61
+ "eslint": "^7.2.0",
62
+ "eslint-config-prettier": "^7.0.0",
63
+ "eslint-plugin-prettier": "^3.1.3",
64
+ "husky": "^6.0.0",
65
+ "jest": "^26.0.1",
66
+ "pod-install": "^0.1.0",
67
+ "prettier": "^2.0.5",
68
+ "react": "16.13.1",
69
+ "react-native": "0.63.4",
70
+ "react-native-builder-bob": "^0.18.0",
71
+ "release-it": "^14.2.2",
72
+ "typescript": "^4.1.3"
73
+ },
74
+ "peerDependencies": {
75
+ "react": "*",
76
+ "react-native": "*"
77
+ },
78
+ "jest": {
79
+ "preset": "react-native",
80
+ "modulePathIgnorePatterns": [
81
+ "<rootDir>/example/node_modules",
82
+ "<rootDir>/lib/"
83
+ ]
84
+ },
85
+ "commitlint": {
86
+ "extends": [
87
+ "@commitlint/config-conventional"
88
+ ]
89
+ },
90
+ "release-it": {
91
+ "git": {
92
+ "commitMessage": "chore: release ${version}",
93
+ "tagName": "v${version}"
94
+ },
95
+ "npm": {
96
+ "publish": true
97
+ },
98
+ "github": {
99
+ "release": true
100
+ },
101
+ "plugins": {
102
+ "@release-it/conventional-changelog": {
103
+ "preset": "angular"
104
+ }
105
+ }
106
+ },
107
+ "eslintConfig": {
108
+ "root": true,
109
+ "extends": [
110
+ "@react-native-community",
111
+ "prettier"
112
+ ],
113
+ "rules": {
114
+ "prettier/prettier": [
115
+ "error",
116
+ {
117
+ "quoteProps": "consistent",
118
+ "singleQuote": true,
119
+ "tabWidth": 2,
120
+ "trailingComma": "es5",
121
+ "useTabs": false
122
+ }
123
+ ]
124
+ }
125
+ },
126
+ "eslintIgnore": [
127
+ "node_modules/",
128
+ "lib/"
129
+ ],
130
+ "prettier": {
131
+ "quoteProps": "consistent",
132
+ "singleQuote": true,
133
+ "tabWidth": 2,
134
+ "trailingComma": "es5",
135
+ "useTabs": false
136
+ },
137
+ "react-native-builder-bob": {
138
+ "source": "src",
139
+ "output": "lib",
140
+ "targets": [
141
+ "commonjs",
142
+ "module",
143
+ [
144
+ "typescript",
145
+ {
146
+ "project": "tsconfig.build.json"
147
+ }
148
+ ]
149
+ ]
150
+ }
151
+ }