@smart100/spu-web-plugin 0.0.4 → 0.0.5

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