@dcloudio/uni-app-x 0.3.0 → 0.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.
Files changed (41) hide show
  1. package/.env +1 -0
  2. package/package.json +6 -3
  3. package/types/uni/ext/index.d.ts +19 -0
  4. package/types/uni/ext/lib/uni-audio/utssdk/index.d.ts +13 -0
  5. package/types/uni/ext/lib/uni-audio/utssdk/interface.d.ts +804 -0
  6. package/types/uni/ext/lib/uni-exit/utssdk/index.d.ts +19 -0
  7. package/types/uni/ext/lib/uni-exit/utssdk/interface.d.ts +63 -0
  8. package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +33 -0
  9. package/types/uni/ext/lib/uni-file-manager/utssdk/interface.d.ts +132 -0
  10. package/types/uni/ext/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +9 -0
  11. package/types/uni/ext/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +31 -0
  12. package/types/uni/ext/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +11 -0
  13. package/types/uni/ext/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +135 -0
  14. package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/index.d.ts +13 -0
  15. package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +120 -0
  16. package/types/uni/ext/lib/uni-getDeviceInfo/utssdk/index.d.ts +13 -0
  17. package/types/uni/ext/lib/uni-getDeviceInfo/utssdk/interface.d.ts +144 -0
  18. package/types/uni/ext/lib/uni-getLocation-system/utssdk/index.d.ts +15 -0
  19. package/types/uni/ext/lib/uni-getLocation-system/utssdk/interface.d.ts +99 -0
  20. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/index.d.ts +15 -0
  21. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/interface.d.ts +93 -0
  22. package/types/uni/ext/lib/uni-getNetworkType/utssdk/index.d.ts +23 -0
  23. package/types/uni/ext/lib/uni-getNetworkType/utssdk/interface.d.ts +67 -0
  24. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/index.d.ts +13 -0
  25. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/interface.d.ts +213 -0
  26. package/types/uni/ext/lib/uni-getSystemInfo/utssdk/index.d.ts +29 -0
  27. package/types/uni/ext/lib/uni-getSystemInfo/utssdk/interface.d.ts +517 -0
  28. package/types/uni/ext/lib/uni-getSystemSetting/utssdk/index.d.ts +11 -0
  29. package/types/uni/ext/lib/uni-getSystemSetting/utssdk/interface.d.ts +61 -0
  30. package/types/uni/ext/lib/uni-media/utssdk/index.d.ts +93 -0
  31. package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +877 -0
  32. package/types/uni/ext/lib/uni-network/utssdk/index.d.ts +61 -0
  33. package/types/uni/ext/lib/uni-network/utssdk/interface.d.ts +569 -0
  34. package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +23 -0
  35. package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +67 -0
  36. package/types/uni/ext/lib/uni-prompt/utssdk/index.d.ts +69 -0
  37. package/types/uni/ext/lib/uni-prompt/utssdk/interface.d.ts +686 -0
  38. package/types/uni/ext/lib/uni-storage/utssdk/index.d.ts +87 -0
  39. package/types/uni/ext/lib/uni-storage/utssdk/interface.d.ts +575 -0
  40. package/types/uni/ext/lib/uni-websocket/utssdk/index.d.ts +49 -0
  41. package/types/uni/ext/lib/uni-websocket/utssdk/interface.d.ts +511 -0
@@ -0,0 +1,19 @@
1
+ import {
2
+ ExitSuccess as ExitSuccessOrigin,
3
+ ExitSuccessCallback as ExitSuccessCallbackOrigin,
4
+ ExitFailCallback as ExitFailCallbackOrigin,
5
+ ExitCompleteCallback as ExitCompleteCallbackOrigin,
6
+ ExitOptions as ExitOptionsOrigin,
7
+ Exit as ExitOrigin,
8
+ Uni as UniOrigin
9
+ } from './interface'
10
+
11
+ declare global {
12
+ type ExitSuccess = ExitSuccessOrigin
13
+ type ExitSuccessCallback = ExitSuccessCallbackOrigin
14
+ type ExitFailCallback = ExitFailCallbackOrigin
15
+ type ExitCompleteCallback = ExitCompleteCallbackOrigin
16
+ type ExitOptions = ExitOptionsOrigin
17
+ type Exit = ExitOrigin
18
+ interface Uni extends UniOrigin { }
19
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * uni.exit成功回调参数
3
+ */
4
+ export type ExitSuccess = {
5
+ errMsg: string
6
+ }
7
+
8
+ /**
9
+ * uni.exit成功回调函数定义
10
+ */
11
+ export type ExitSuccessCallback = (res: ExitSuccess) => void
12
+ /**
13
+ * uni.exit失败回调函数定义
14
+ */
15
+ export type ExitFailCallback = (res: UniError) => void
16
+ /**
17
+ * uni.exit完成回调函数定义
18
+ */
19
+ export type ExitCompleteCallback = (res: any) => void
20
+
21
+ /**
22
+ * uni.exit参数定义
23
+ */
24
+ export type ExitOptions = {
25
+ /**
26
+ * 接口调用成功的回调函数
27
+ */
28
+ success: ExitSuccessCallback | null,
29
+ /**
30
+ * 接口调用失败的回调函数
31
+ */
32
+ fail: ExitFailCallback | null,
33
+ /**
34
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
35
+ */
36
+ complete: ExitCompleteCallback | null
37
+ }
38
+
39
+
40
+ export interface Uni {
41
+
42
+ /**
43
+ * 退出当前应用
44
+ * @uniPlatform {
45
+ * "app": {
46
+ * "android": {
47
+ * "osVer": "4.4.4",
48
+ * "uniVer": "√",
49
+ * "unixVer": "3.9.0"
50
+ * },
51
+ * "ios": {
52
+ * "osVer": "x",
53
+ * "uniVer": "x",
54
+ * "unixVer": "x"
55
+ * }
56
+ * }
57
+ * }
58
+ * @uniVueVersion 2,3 //支持的vue版本
59
+ */
60
+ exit: Exit;
61
+ }
62
+
63
+ export type Exit = (options?: ExitOptions | null) => void;
@@ -0,0 +1,33 @@
1
+ import {
2
+ ReadFileSuccessResult as ReadFileSuccessResultOrigin,
3
+ ReadFileFailResult as ReadFileFailResultOrigin,
4
+ ReadFileSuccessCallback as ReadFileSuccessCallbackOrigin,
5
+ ReadFileFailCallback as ReadFileFailCallbackOrigin,
6
+ ReadFileCompleteCallback as ReadFileCompleteCallbackOrigin,
7
+ ReadFileOptions as ReadFileOptionsOrigin,
8
+ WriteFileSuccessResult as WriteFileSuccessResultOrigin,
9
+ WriteFileFailResult as WriteFileFailResultOrigin,
10
+ WriteFileSuccessCallback as WriteFileSuccessCallbackOrigin,
11
+ WriteFileFailCallback as WriteFileFailCallbackOrigin,
12
+ WriteFileCompleteCallback as WriteFileCompleteCallbackOrigin,
13
+ WriteFileOptions as WriteFileOptionsOrigin,
14
+ GetFileSystemManager as GetFileSystemManagerOrigin,
15
+ Uni as UniOrigin
16
+ } from './interface'
17
+
18
+ declare global {
19
+ type ReadFileSuccessResult = ReadFileSuccessResultOrigin
20
+ type ReadFileFailResult = ReadFileFailResultOrigin
21
+ type ReadFileSuccessCallback = ReadFileSuccessCallbackOrigin
22
+ type ReadFileFailCallback = ReadFileFailCallbackOrigin
23
+ type ReadFileCompleteCallback = ReadFileCompleteCallbackOrigin
24
+ type ReadFileOptions = ReadFileOptionsOrigin
25
+ type WriteFileSuccessResult = WriteFileSuccessResultOrigin
26
+ type WriteFileFailResult = WriteFileFailResultOrigin
27
+ type WriteFileSuccessCallback = WriteFileSuccessCallbackOrigin
28
+ type WriteFileFailCallback = WriteFileFailCallbackOrigin
29
+ type WriteFileCompleteCallback = WriteFileCompleteCallbackOrigin
30
+ type WriteFileOptions = WriteFileOptionsOrigin
31
+ type GetFileSystemManager = GetFileSystemManagerOrigin
32
+ interface Uni extends UniOrigin { }
33
+ }
@@ -0,0 +1,132 @@
1
+
2
+ export type ReadFileSuccessResult = {
3
+ data: string
4
+ }
5
+
6
+ export type ReadFileFailResult = {
7
+ /**
8
+ * 错误码
9
+ */
10
+ errCode: number,
11
+ /**
12
+ * 调用API的名称
13
+ */
14
+ errSubject: string,
15
+ /**
16
+ * 错误的详细信息
17
+ */
18
+ errMsg: string,
19
+ }
20
+
21
+ export type ReadFileSuccessCallback = (res: ReadFileSuccessResult) => void
22
+
23
+ export type ReadFileFailCallback = (res: ReadFileFailResult) => void
24
+
25
+ export type ReadFileCompleteCallback = (res: any) => void
26
+
27
+
28
+
29
+ export type ReadFileOptions = {
30
+ /**
31
+ * base64 / utf-8
32
+ */
33
+ encoding: string,
34
+ /**
35
+ * 文件路径,支持相对地址和绝对地址
36
+ */
37
+ filePath: string,
38
+ /**
39
+ * 接口调用的回调函数
40
+ */
41
+ success: ReadFileSuccessCallback | null,
42
+ /**
43
+ * 接口调用失败的回调函数
44
+ */
45
+ fail: ReadFileFailCallback | null,
46
+ /**
47
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
48
+ */
49
+ complete: ReadFileCompleteCallback | null
50
+ }
51
+
52
+
53
+ export type WriteFileSuccessResult = {
54
+ filePath: string,
55
+ }
56
+
57
+ export type WriteFileFailResult = {
58
+ /**
59
+ * 错误码
60
+ */
61
+ errCode: number,
62
+ /**
63
+ * 调用API的名称
64
+ */
65
+ errSubject: string,
66
+ /**
67
+ * 错误的详细信息
68
+ */
69
+ errMsg: string,
70
+ }
71
+
72
+ export type WriteFileSuccessCallback = (res: WriteFileSuccessResult) => void
73
+
74
+ export type WriteFileFailCallback = (res: WriteFileFailResult) => void
75
+
76
+ export type WriteFileCompleteCallback = (res: any) => void
77
+
78
+
79
+ export type WriteFileOptions = {
80
+ /**
81
+ * 文件路径,只支持绝对地址
82
+ */
83
+ filePath: string,
84
+ /**
85
+ * 写入的文本内容
86
+ */
87
+ data: string,
88
+ /**
89
+ * 接口调用的回调函数
90
+ */
91
+ success: WriteFileSuccessCallback | null,
92
+ /**
93
+ * 接口调用失败的回调函数
94
+ */
95
+ fail: WriteFileFailCallback | null,
96
+ /**
97
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
98
+ */
99
+ complete: WriteFileCompleteCallback | null
100
+ }
101
+
102
+
103
+ export interface FileSystemManager {
104
+ readFile(config: ReadFileOptions): void;
105
+ writeFile(config: WriteFileOptions): void;
106
+ }
107
+
108
+
109
+ export type GetFileSystemManager = () => FileSystemManager;
110
+
111
+
112
+ export interface Uni {
113
+ /**
114
+ * 获取文件管理器
115
+ * @uniPlatform {
116
+ * "app": {
117
+ * "android": {
118
+ * "osVer": "4.4.4",
119
+ * "uniVer": "√",
120
+ * "unixVer": "3.9.0"
121
+ * },
122
+ * "ios": {
123
+ * "osVer": "x",
124
+ * "uniVer": "x",
125
+ * "unixVer": "x"
126
+ * }
127
+ * }
128
+ * }
129
+ * @uniVueVersion 2,3 //支持的vue版本
130
+ */
131
+ getFileSystemManager: GetFileSystemManager
132
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ GetAccessibilityInfo as GetAccessibilityInfoOrigin,
3
+ Uni as UniOrigin
4
+ } from './interface'
5
+
6
+ declare global {
7
+ type GetAccessibilityInfo = GetAccessibilityInfoOrigin
8
+ interface Uni extends UniOrigin { }
9
+ }
@@ -0,0 +1,31 @@
1
+
2
+
3
+ export type GetAccessibilityInfo = () => UTSJSONObject;
4
+
5
+ export interface Uni {
6
+ /**
7
+ * GetAccessibilityInfo()
8
+ * @description
9
+ * 获取app基本信息
10
+ * @return {object}
11
+ * @uniPlatform {
12
+ * "app": {
13
+ * "android": {
14
+ * "osVer": "4.4",
15
+ * "uniVer": "x",
16
+ * "unixVer": "3.9.0"
17
+ * },
18
+ * "ios": {
19
+ * "osVer": "9.0",
20
+ * "uniVer": "x",
21
+ * "unixVer": "3.9.0"
22
+ * }
23
+ * }
24
+ * }
25
+ * @example
26
+ ```typescript
27
+ uni.getAccessibilityInfo()
28
+ ```
29
+ */
30
+ getAccessibilityInfo: GetAccessibilityInfo
31
+ }
@@ -0,0 +1,11 @@
1
+ import {
2
+ GetAppAuthorizeSetting as GetAppAuthorizeSettingOrigin,
3
+ GetAppAuthorizeSettingResult as GetAppAuthorizeSettingResultOrigin,
4
+ Uni as UniOrigin
5
+ } from './interface'
6
+
7
+ declare global {
8
+ type GetAppAuthorizeSetting = GetAppAuthorizeSettingOrigin
9
+ type GetAppAuthorizeSettingResult = GetAppAuthorizeSettingResultOrigin
10
+ interface Uni extends UniOrigin { }
11
+ }
@@ -0,0 +1,135 @@
1
+ export interface Uni {
2
+ /**
3
+ * getAppAuthorizeSetting()
4
+ * @description
5
+ * 获取 APP 授权设置。
6
+ * @param {void}
7
+ * @return {GetAppAuthorizeSettingResult}
8
+ * @tutorial http://uniapp.dcloud.io/api/system/getappauthorizesetting
9
+ * @uniPlatform {
10
+ * "app": {
11
+ * "android": {
12
+ * "osVer": "4.4",
13
+ * "uniVer": "√",
14
+ * "unixVer": "3.9.0"
15
+ * },
16
+ * "ios": {
17
+ * "osVer": "9.0",
18
+ * "uniVer": "√",
19
+ * "unixVer": "3.9.0"
20
+ * }
21
+ * }
22
+ * }
23
+ * @example
24
+ ```typescript
25
+ uni.getAppAuthorizeSetting()
26
+ ```
27
+ */
28
+ getAppAuthorizeSetting: GetAppAuthorizeSetting;
29
+ }
30
+
31
+
32
+ export type GetAppAuthorizeSetting = () => GetAppAuthorizeSettingResult;
33
+ export type GetAppAuthorizeSettingResult = {
34
+ /**
35
+ * 允许 App 使用相册的开关(仅 iOS 支持)
36
+ * - authorized: 已经获得授权,无需再次请求授权
37
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
38
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
39
+ * @type 'authorized' | 'denied' | 'not determined'
40
+ */
41
+ albumAuthorized: string | null,
42
+ /**
43
+ * 允许 App 使用蓝牙的开关(仅 iOS 支持)
44
+ * - authorized: 已经获得授权,无需再次请求授权
45
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
46
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
47
+ * - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `BlueTooth(低功耗蓝牙)` 模块
48
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
49
+ */
50
+ bluetoothAuthorized: string | null,
51
+ /**
52
+ * 允许 App 使用摄像头的开关
53
+ * - authorized: 已经获得授权,无需再次请求授权
54
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
55
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
56
+ * - config error: Android平台:表示没有授予 `android.permission.CAMERA` 权限;iOS平台没有该值
57
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
58
+ */
59
+ cameraAuthorized: string,
60
+ /**
61
+ * 允许 App 使用定位的开关
62
+ * - authorized: 已经获得授权,无需再次请求授权
63
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
64
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
65
+ * - config error: Android平台:表示没有授予 `android.permission.ACCESS_COARSE_LOCATION` 权限;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块
66
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
67
+ */
68
+ locationAuthorized: string,
69
+ /**
70
+ * 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 支持)
71
+ * - reduced: 模糊定位
72
+ * - full: 精准定位
73
+ * - unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块)
74
+ * @type 'reduced' | 'full' | 'unsupported'
75
+ */
76
+ locationAccuracy: string | null,
77
+ /**
78
+ * 定位准确度(推荐使用 locationAccuracy 属性)。true 表示模糊定位,false 表示精确定位(仅 iOS 支持)
79
+ * @type boolean
80
+ */
81
+ locationReducedAccuracy: boolean | null,
82
+ /**
83
+ * 允许 App 使用麦克风的开关
84
+ * - authorized: 已经获得授权,无需再次请求授权
85
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
86
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
87
+ * - config error: Android平台:表示没有授予 `android.permission.RECORD_AUDIO` 权限;iOS平台没有该值
88
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
89
+ */
90
+ microphoneAuthorized: string,
91
+ /**
92
+ * 允许 App 通知的开关
93
+ * - authorized: 已经获得授权,无需再次请求授权
94
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
95
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
96
+ * - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
97
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
98
+ */
99
+ notificationAuthorized: string,
100
+ /**
101
+ * 允许 App 通知带有提醒的开关(仅 iOS 10.0+ 支持)
102
+ * - authorized: 已经获得授权,无需再次请求授权
103
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
104
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
105
+ * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
106
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
107
+ */
108
+ notificationAlertAuthorized: string | null,
109
+ /**
110
+ * 允许 App 通知带有标记的开关(仅 iOS 10.0+ 支持)
111
+ * - authorized: 已经获得授权,无需再次请求授权
112
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
113
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
114
+ * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
115
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
116
+ */
117
+ notificationBadgeAuthorized: string | null,
118
+ /**
119
+ * 允许 App 通知带有声音的开关(仅 iOS 10.0+ 支持)
120
+ * - authorized: 已经获得授权,无需再次请求授权
121
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
122
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
123
+ * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
124
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
125
+ */
126
+ notificationSoundAuthorized: string | null,
127
+ /**
128
+ * 允许读写日历的开关(仅微信小程序支持)
129
+ * - authorized: 已经获得授权,无需再次请求授权
130
+ * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
131
+ * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
132
+ * @type 'authorized' | 'denied' | 'not determined'
133
+ */
134
+ phoneCalendarAuthorized: string | null
135
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ GetAppBaseInfoOptions as GetAppBaseInfoOptionsOrigin,
3
+ GetAppBaseInfoResult as GetAppBaseInfoResultOrigin,
4
+ GetAppBaseInfo as GetAppBaseInfoOrigin,
5
+ Uni as UniOrigin
6
+ } from './interface'
7
+
8
+ declare global {
9
+ type GetAppBaseInfoOptions = GetAppBaseInfoOptionsOrigin
10
+ type GetAppBaseInfoResult = GetAppBaseInfoResultOrigin
11
+ type GetAppBaseInfo = GetAppBaseInfoOrigin
12
+ interface Uni extends UniOrigin { }
13
+ }
@@ -0,0 +1,120 @@
1
+
2
+ /**
3
+ * 过滤app基本信息,其中filter参数可设置为
4
+ "appId",
5
+ "appName",
6
+ "appVersion",
7
+ "appVersionCode",
8
+ "appLanguage",
9
+ "language",
10
+ "version",
11
+ "appWgtVersion",
12
+ "hostLanguage",
13
+ "hostVersion",
14
+ "hostName",
15
+ "hostPackageName",
16
+ "hostSDKVersion",
17
+ "hostTheme",
18
+ */
19
+ export type GetAppBaseInfoOptions = {
20
+ filter: Array<string>
21
+ };
22
+
23
+ export type GetAppBaseInfoResult = {
24
+ /**
25
+ * manifest.json 中应用appid,即DCloud appid。
26
+ */
27
+ appId?: string,
28
+ /**
29
+ * manifest.json 中应用名称
30
+ */
31
+ appName?: string,
32
+ /**
33
+ * manifest.json 中应用版本名称。
34
+ */
35
+ appVersion?: string,
36
+ /**
37
+ * manifest.json 中应用版本名号。
38
+ */
39
+ appVersionCode?: string,
40
+ /**
41
+ * 应用设置的语言en、zh-Hans、zh-Hant、fr、es
42
+ */
43
+ appLanguage?: string,
44
+ /**
45
+ * 应用设置的语言
46
+ */
47
+ language?: string,
48
+ /**
49
+ * 引擎版本号
50
+ */
51
+ version?: string,
52
+ /**
53
+ * 应用资源(wgt)的版本名称。
54
+ */
55
+ appWgtVersion?: string,
56
+ /**
57
+ * 小程序宿主语言
58
+ */
59
+ hostLanguage?: string,
60
+ /**
61
+ * App、小程序宿主版本。
62
+ */
63
+ hostVersion?: string,
64
+ /**
65
+ * 小程序宿主名称
66
+ */
67
+ hostName?: string,
68
+ /**
69
+ * 小程序宿主包名
70
+ */
71
+ hostPackageName?: string,
72
+ /**
73
+ * uni小程序SDK版本、小程序客户端基础库版本
74
+ */
75
+ hostSDKVersion?: string,
76
+ /**
77
+ * 系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)
78
+ */
79
+ hostTheme?: string,
80
+ /**
81
+ * 是否uni-app x
82
+ */
83
+ isUniAppX: boolean
84
+ }
85
+
86
+
87
+ export type GetAppBaseInfo = (config: GetAppBaseInfoOptions | null) => GetAppBaseInfoResult;
88
+
89
+
90
+ export interface Uni {
91
+ /**
92
+ * GetAppBaseInfo(Object object)
93
+ * @description
94
+ * 获取app基本信息
95
+ * @param {AppBaseInfoOptions} option
96
+ * @return {object}
97
+ * @tutorial https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html
98
+ * @uniPlatform {
99
+ * "app": {
100
+ * "android": {
101
+ * "osVer": "4.4",
102
+ * "uniVer": "√",
103
+ * "unixVer": "3.9.0"
104
+ * },
105
+ * "ios": {
106
+ * "osVer": "9.0",
107
+ * "uniVer": "√",
108
+ * "unixVer": "3.9.0"
109
+ * }
110
+ * }
111
+ * }
112
+ * @example
113
+ ```typescript
114
+ uni.getAppBaseInfo({
115
+ filter:[]
116
+ })
117
+ ```
118
+ */
119
+ getAppBaseInfo: GetAppBaseInfo
120
+ }
@@ -0,0 +1,13 @@
1
+ import {
2
+ GetDeviceInfoOptions as GetDeviceInfoOptionsOrigin,
3
+ GetDeviceInfoResult as GetDeviceInfoResultOrigin,
4
+ GetDeviceInfo as GetDeviceInfoOrigin,
5
+ Uni as UniOrigin
6
+ } from './interface'
7
+
8
+ declare global {
9
+ type GetDeviceInfoOptions = GetDeviceInfoOptionsOrigin
10
+ type GetDeviceInfoResult = GetDeviceInfoResultOrigin
11
+ type GetDeviceInfo = GetDeviceInfoOrigin
12
+ interface Uni extends UniOrigin { }
13
+ }