Browse Source

move to react-native-amap-kit

wd 7 years ago
parent
commit
3b4449d4ef
5 changed files with 49 additions and 26 deletions
  1. 1 1
      index.ts
  2. 2 22
      lib/index.d.ts
  3. 9 3
      package.json
  4. 6 0
      tsconfig.json
  5. 31 0
      yarn.lock

+ 1 - 1
index.ts

@@ -1,6 +1,6 @@
 import { createSelector, OutputSelector } from 'reselect';
 import Global from './Common';
-import { Marker, Circle, Line, Polygon} from 'react-native-smart-amap';
+import { Marker, Circle, Line, Polygon} from 'react-native-amap-kit';
 import {
     latLngDegreesToDecimal,
     latLngDecimalToDegrees,

+ 2 - 22
lib/index.d.ts

@@ -1,5 +1,7 @@
 import { OutputSelector } from 'reselect';
+import { Marker, Circle, Line, Polygon } from 'react-native-amap-kit';
 import { latLngDegreesToDecimal, latLngDecimalToDegrees } from './Utils';
+export { Marker, Circle, Line, Polygon };
 export interface CoordinateShort {
     lat: number;
     lng: number;
@@ -151,28 +153,6 @@ declare type AirspaceInfo = AirspaceInfoLocal | AirspaceInfoServer;
 declare type PassingPointLocal = PassingPointNavLocal | PassingPointNormalLocal | PassingPointAirlineLocal;
 declare type PassingPointServer = PassingPointNavServer | PassingPointNormalServer | PassingPointAirlineServer;
 export declare type Coordinate = CoordinateLong | CoordinateShort;
-export interface Circle {
-    coordinate: Coordinate;
-    radius: number;
-    lineWidth: number;
-    strokeColor: string;
-    fillColor: string;
-}
-export interface Marker {
-    coordinate: Coordinate;
-    imageName: string;
-}
-export interface Polygon {
-    lineWidth: number;
-    strokeColor: string;
-    fillColor: string;
-    coordinates: Coordinate[];
-}
-export interface Line {
-    lineWidth: number;
-    strokeColor: string;
-    coordinates: Coordinate[];
-}
 export interface CirclesAndMarkers {
     circles: Circle[];
     markers: Marker[];

+ 9 - 3
package.json

@@ -21,13 +21,14 @@
     "jest": "^23.6.0",
     "react-test-renderer": "16.0.0-beta.5",
     "ts-jest": "^23.10.4",
-    "typescript": "^3.1.4",
-    "react-native-smart-amap": "ssh+git://git@git.corp.brilliantaero.com:BA/react-native-smart-amap.git"
+    "typescript": "^3.1.4"
   },
   "jest": {
     "preset": "ts-jest",
     "testEnvironment": "node",
-    "testMatch": [ "**/__tests__/*-test.ts" ],
+    "testMatch": [
+      "**/__tests__/*-test.ts"
+    ],
     "globals": {
       "ts-jest": {
         "babelConfig": true,
@@ -46,5 +47,10 @@
         ]
       }
     }
+  },
+  "peerDependencies": {
+    "@types/react": "^16.7.17",
+    "@types/react-native": "^0.57.19",
+    "react-native-amap-kit": "^2.0.4"
   }
 }

+ 6 - 0
tsconfig.json

@@ -8,6 +8,12 @@
     "outDir": "./lib",
     "declaration": true,
 
+    "types": [
+      "react",
+      "react-native",
+      "jest"
+    ],
+
     "noEmit": false,
     "moduleResolution": "node",
     "esModuleInterop": true,

+ 31 - 0
yarn.lock

@@ -28,6 +28,27 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"
   integrity sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==
 
+"@types/prop-types@*":
+  version "15.5.8"
+  resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.8.tgz#8ae4e0ea205fe95c3901a5a1df7f66495e3a56ce"
+  integrity sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw==
+
+"@types/react-native@^0.57.19":
+  version "0.57.19"
+  resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.57.19.tgz#2fa4d1ca9ee9f67e58a6480b5182ee0ffeec75bb"
+  integrity sha512-BLfoi7FN5hj8NpCTptMXXN0yslkOo8WuIFZNJIBAfdXtuCyaYnEY/lbjJIgy9fT2Y6cMDJchQbT280bexLDjsg==
+  dependencies:
+    "@types/prop-types" "*"
+    "@types/react" "*"
+
+"@types/react@*", "@types/react@^16.7.17":
+  version "16.7.17"
+  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.7.17.tgz#3242e796a1ffbba4f49eae5915a67f4c079504e9"
+  integrity sha512-YcXcaoXaxo7A76mBCGlKlN2aZu3REQfF0DTrhiyXVJLA7PDdxVCr+wiQOrkVNn44D/zLlIyDSn3U918Ve0AaEA==
+  dependencies:
+    "@types/prop-types" "*"
+    csstype "^2.2.0"
+
 abab@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
@@ -1154,6 +1175,11 @@ cssstyle@^1.0.0:
   dependencies:
     cssom "0.3.x"
 
+csstype@^2.2.0:
+  version "2.5.8"
+  resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.5.8.tgz#4ce5aa16ea0d562ef9105fa3ae2676f199586a35"
+  integrity sha512-r4DbsyNJ7slwBSKoGesxDubRWJ71ghG8W2+1HcsDlAo12KGca9dDLv0u98tfdFw7ldBdoA7XmCnI6Q8LpAJXaQ==
+
 dashdash@^1.12.0:
   version "1.14.1"
   resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -3369,6 +3395,11 @@ rc@^1.2.7:
     minimist "^1.2.0"
     strip-json-comments "~2.0.1"
 
+react-native-amap-kit@^2.0.4:
+  version "2.0.4"
+  resolved "https://registry.yarnpkg.com/react-native-amap-kit/-/react-native-amap-kit-2.0.4.tgz#6f9d95f8ee9df8ba639a93c1e4ed3e551ac32664"
+  integrity sha512-aqrUSd74T31iaUBHldXW5YjF+Jx9BKYJtAF3OCiQxKEbf5bxiBvCIhCq0e86vPwAMJiOdrY1KQ787LV2DGuNIA==
+
 react-test-renderer@16.0.0-beta.5:
   version "16.0.0-beta.5"
   resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.0.0-beta.5.tgz#6169e2ea96e8d21645662b369c23239974cd1f11"