@smart100/spu-web-plugin 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -1 +1,3 @@
1
1
  # @smart100/spu-web-plugin
2
+
3
+ + node >= 18.15.0
package/dist/index.d.ts CHANGED
@@ -1,26 +1,94 @@
1
1
  import type { App } from 'vue'
2
2
  // import type { AxiosInstance } from 'axios'
3
3
 
4
- interface SPUWebPluginOptions {
5
- modulekey: string;
6
- modulename: string;
7
- moduleversion: string;
8
- router: any;
4
+ interface ISPUWebPluginOptions {
5
+ modulekey: string
6
+ modulename: string
7
+ moduleversion: string
8
+ router: any
9
9
  }
10
10
 
11
+ interface IAMapLoader {
12
+ load: (options?: {
13
+ plugins?: Array<string>
14
+ AMapUI?: {
15
+ plugins?: Array<string>
16
+ }
17
+ }) => Promise<any>
18
+ }
19
+
20
+ type StorageType = 'storage' | 'storage-1d' | 'storage-3m' | 'storage-1y'
21
+
22
+ type Cope = { width?: number, height?: number } | string | boolean
23
+
24
+ interface IDownload {
25
+ type?: 'att' | 'img',
26
+ source: string,
27
+ datetime: string | number,
28
+ storagetype?: StorageType,
29
+ cope?: Cope
30
+ }
31
+
32
+ interface IDownloadService {
33
+ getUrl: ({
34
+ type = 'img',
35
+ source = '',
36
+ datetime = '',
37
+ storagetype = 'storage',
38
+ cope = ''
39
+ }: IDownload) => Promise<any>
40
+ }
41
+
42
+
43
+ interface IUpload {
44
+ type?: 'att' | 'img',
45
+ file: File,
46
+ source?: string,
47
+ datetime?: string | number,
48
+ storagetype?: StorageType,
49
+ onprogress?: (p: number, _checkpoint?: any) => void
50
+ }
51
+
52
+ interface IUploadService {
53
+ upload: ({
54
+ type = 'img',
55
+ file,
56
+ source = '',
57
+ datetime = '',
58
+ storagetype = 'storage',
59
+ onprogress,
60
+ }: IUpload) => Promise<any>
61
+ }
62
+
63
+
64
+ type Location = {
65
+ longitude: string
66
+ latitude: string
67
+ address: string
68
+ [propName: string]: any
69
+ } | null
70
+
71
+
11
72
  export const lsProxy: any
12
73
  export const ssProxy: any
13
- export const getLocation: any
14
- export const getDistance: any
74
+ export const getLocation: () => Promise<Location>
75
+ export const getDistance: (p1: [number, number], p2: [number, number]) => Promise<any>
15
76
  export const spuAxios: any
16
77
  // export const spuAxios: AxiosInstance
17
78
  export const apaasAxios: any
18
- export const downloadService: any
19
- export const uploadService: any
20
-
79
+ export const downloadService: IDownloadService
80
+ export const uploadService: IUploadService
81
+ export const getUniqueid: () => string
82
+ export const getUuid: () => string
83
+ export const AMapLoader: IAMapLoader
84
+ export const getToken: () => string
85
+ export const getTokenExpires: () => string
86
+ export const getRefreshToken: () => string
87
+ export const getUser: (key?: string) => any
88
+ export const checkLogin: () => boolean
21
89
 
22
90
  interface ISPUWebPlugin {
23
- install (app: App, option: SPUWebPluginOptions): void
91
+ install (app: App, option: ISPUWebPluginOptions): void
24
92
  // install: any
25
93
  version: string
26
94
  }