@styzy/vue-amap 1.3.0 → 1.4.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.
package/package.json CHANGED
@@ -1,55 +1,63 @@
1
- {
2
- "name": "@styzy/vue-amap",
3
- "version": "1.3.0",
4
- "description": "An AMap Plugins For Vue.js",
5
- "keywords": [
6
- "vue",
7
- "amap",
8
- "plugin"
9
- ],
10
- "author": {
11
- "name": "STYZY",
12
- "email": "styzyreal@126.com",
13
- "url": "https://our.styzy.cn"
14
- },
15
- "bugs": {
16
- "url": "https://github.com/styzy/vue-amap/issues",
17
- "email": "styzyreal@126.com"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git@github.com:styzy/vue-amap.git"
22
- },
23
- "main": "lib/vue-amap.common.js",
24
- "private": false,
25
- "license": "MIT",
26
- "scripts": {
27
- "dev": "vue-cli-service serve --open",
28
- "lib": "vue-cli-service build --target lib --name vue-amap --dest lib src/index.js"
29
- },
30
- "dependencies": {
31
- "core-js": "^3.6.5",
32
- "vue": "^2.6.11"
33
- },
34
- "devDependencies": {
35
- "@babel/core": "^7.12.16",
36
- "@babel/eslint-parser": "^7.12.16",
37
- "@prettier/plugin-pug": "^1.19.2",
38
- "@vue/cli-plugin-babel": "~5.0.8",
39
- "@vue/cli-plugin-eslint": "~5.0.8",
40
- "@vue/cli-plugin-router": "~4.5.0",
41
- "@vue/cli-plugin-vuex": "~4.5.0",
42
- "@vue/cli-service": "~5.0.8",
43
- "@vue/eslint-config-prettier": "^6.0.0",
44
- "babel-plugin-transform-remove-console": "^6.9.4",
45
- "eslint": "^7.32.0",
46
- "eslint-config-prettier": "^8.3.0",
47
- "eslint-plugin-prettier": "^4.0.0",
48
- "eslint-plugin-vue": "^8.0.3",
49
- "prettier": "^2.4.1",
50
- "stylus": "^0.54.7",
51
- "stylus-loader": "^3.0.2",
52
- "vue-cli-plugin-pug": "~2.0.0",
53
- "vue-template-compiler": "^2.6.14"
54
- }
55
- }
1
+ {
2
+ "name": "@styzy/vue-amap",
3
+ "version": "1.4.0",
4
+ "private": false,
5
+ "description": "An AMap Plugins For Vue.js",
6
+ "keywords": [
7
+ "vue",
8
+ "amap",
9
+ "plugin"
10
+ ],
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git@github.com:styzy/vue-amap.git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/styzy/vue-amap/issues",
18
+ "email": "styzyreal@126.com"
19
+ },
20
+ "author": {
21
+ "name": "STYZY",
22
+ "email": "styzyreal@126.com",
23
+ "url": "https://our.styzy.cn"
24
+ },
25
+ "scripts": {
26
+ "dev": "vue-cli-service serve --open",
27
+ "types": "vue-tsc --project tsconfig.types.json",
28
+ "lib": "vue-cli-service build --target lib --name vue-amap --dest lib src/index.ts"
29
+ },
30
+ "main": "lib/vue-amap.common.js",
31
+ "types": "types/index.d.ts",
32
+ "dependencies": {
33
+ "core-js": "^3.6.5",
34
+ "vue": "^2.6.11"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/core": "^7.12.16",
38
+ "@babel/eslint-parser": "^7.12.16",
39
+ "@prettier/plugin-pug": "^1.19.2",
40
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
41
+ "@typescript-eslint/parser": "^5.4.0",
42
+ "@vue/cli-plugin-babel": "~5.0.8",
43
+ "@vue/cli-plugin-eslint": "~5.0.8",
44
+ "@vue/cli-plugin-router": "~5.0.8",
45
+ "@vue/cli-plugin-typescript": "~5.0.0",
46
+ "@vue/cli-plugin-vuex": "~5.0.8",
47
+ "@vue/cli-service": "~5.0.8",
48
+ "@vue/eslint-config-prettier": "^6.0.0",
49
+ "@vue/eslint-config-typescript": "^9.1.0",
50
+ "babel-plugin-transform-remove-console": "^6.9.4",
51
+ "eslint": "^7.32.0",
52
+ "eslint-config-prettier": "^8.3.0",
53
+ "eslint-plugin-prettier": "^4.0.0",
54
+ "eslint-plugin-vue": "^8.0.3",
55
+ "prettier": "^2.4.1",
56
+ "stylus": "^0.54.7",
57
+ "stylus-loader": "^3.0.2",
58
+ "typescript": "~4.5.5",
59
+ "vue-cli-plugin-pug": "~2.0.0",
60
+ "vue-template-compiler": "^2.6.14"
61
+ }
62
+ }
63
+
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "jsx": "preserve",
7
+ "moduleResolution": "node",
8
+ "allowJs": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "useDefineForClassFields": true,
13
+ "sourceMap": true,
14
+ "baseUrl": ".",
15
+ "types": ["webpack-env"],
16
+ "paths": {
17
+ "@/*": ["src/*"],
18
+ "@types": ["types"]
19
+ },
20
+ "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
21
+ "outDir": "dist"
22
+ },
23
+ "include": [
24
+ "types/index.d.ts",
25
+ "src/**/*.ts",
26
+ "src/**/*.tsx",
27
+ "src/**/*.vue",
28
+ "test/**/*.ts",
29
+ "test/**/*.tsx",
30
+ "test/**/*.vue"
31
+ ],
32
+ "exclude": ["node_modules"]
33
+ }
34
+
@@ -0,0 +1,102 @@
1
+ type AMap = any
2
+
3
+ type AMapLoaderConfigOptions = {
4
+ /**
5
+ * 高德地图 API 密钥
6
+ */
7
+ key: string
8
+ /**
9
+ * SDK 版本
10
+ */
11
+ version: string
12
+ /**
13
+ * UI库 版本
14
+ */
15
+ uiVersion: string
16
+ /**
17
+ * 插件列表
18
+ */
19
+ plugins: Array<string>
20
+ }
21
+
22
+ /**
23
+ * 高德地图 SDK 加载器
24
+ */
25
+ interface IAMapLoader {
26
+ /**
27
+ * 高德地图 API 密钥
28
+ */
29
+ key: string
30
+ /**
31
+ * SDK 版本
32
+ */
33
+ version: string
34
+ /**
35
+ * UI库 版本
36
+ */
37
+ uiVersion: string
38
+ /**
39
+ * 插件列表
40
+ */
41
+ plugins: Array<string>
42
+ /**
43
+ * 回调函数名称
44
+ */
45
+ callbackName: string
46
+ /**
47
+ * 是否已加载 SDK
48
+ */
49
+ isSdkLoaded: boolean
50
+ /**
51
+ * 是否正在加载 SDK
52
+ */
53
+ isSdkLoading: boolean
54
+ /**
55
+ * 加载完成后的回调函数列表
56
+ */
57
+ callbacks: Array<() => void>
58
+ /**
59
+ * 配置高德地图 SDK 加载器
60
+ * @param options 高德地图 SDK 加载器配置项
61
+ * @returns
62
+ */
63
+ config: (options: AMapLoaderConfigOptions) => void
64
+ /**
65
+ * 加载高德地图 SDK
66
+ * - 使用 await 等待加载完成
67
+ * - 加载完成后,返回 AMap 类
68
+ */
69
+ load: () => Promise<AMap>
70
+ }
71
+
72
+ type InitOptions = AMapLoaderConfigOptions & {
73
+ /**
74
+ * 全局地图选项
75
+ */
76
+ globalMapOptions: GlobalMapOptions
77
+ }
78
+
79
+ type GlobalMapOptions = Record<string, any>
80
+
81
+ declare module '@styzy/vue-amap' {
82
+ import { PluginFunction } from 'vue'
83
+
84
+ /**
85
+ * 高德地图管理器
86
+ */
87
+ export default class AMapManager {
88
+ /**
89
+ * 高德地图管理器版本号
90
+ */
91
+ static version: string
92
+ /**
93
+ * 安装高德地图组件,提供给 Vue 安装,注册组件
94
+ */
95
+ static install: PluginFunction<void>
96
+ /**
97
+ * 初始化高德地图 SDK,加载地图脚本
98
+ * @param options 高德地图 SDK 加载器配置项
99
+ */
100
+ static initAMap(options: InitOptions): Promise<AMap>
101
+ }
102
+ }