@dcloudio/uni-app-x 0.6.0 → 0.6.2
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 +2 -2
- package/types/native/Element.d.ts +4 -4
- package/types/native/IApp.d.ts +1 -1
- package/types/native/IComment.d.ts +5 -0
- package/types/native/IDocument.d.ts +2 -1
- package/types/native/ITextNode.d.ts +6 -0
- package/types/native/NestedPreScrollEvent.d.ts +20 -1
- package/types/native/StartNestedScrollEvent.d.ts +19 -0
- package/types/native/StopNestedScrollEvent.d.ts +26 -0
- package/types/native/SwiperAnimationFinishEvent.d.ts +6 -0
- package/types/native/SwiperChangeEvent.d.ts +6 -0
- package/types/native/SwiperTransitionEvent.d.ts +6 -0
- package/types/native/global.d.ts +8 -1
- package/types/native/index.d.ts +4 -0
- package/types/page.d.ts +19 -24
- package/types/uni/core/lib/base/event/index.d.ts +1 -0
- package/types/uni/core/lib/base/interceptor/index.d.ts +1 -0
- package/types/uni/core/lib/lifecycle/index.d.ts +1 -0
- package/types/uni/core/lib/performance/index.d.ts +1 -0
- package/types/uni/core/lib/route/index.d.ts +1 -0
- package/types/uni/core/lib/ui/create-selector-query/index.d.ts +1 -0
- package/types/uni/core/lib/ui/get-element-by-id/index.d.ts +1 -0
- package/types/uni/core/lib/ui/load-font-face/index.d.ts +1 -0
- package/types/uni/core/lib/ui/page-scroll-to/index.d.ts +1 -0
- package/types/uni/core/lib/ui/pull-down-refresh/index.d.ts +1 -0
- package/types/uni/core/lib/ui/set-navigation-bar-color/index.d.ts +1 -0
- package/types/uni/core/lib/ui/set-navigation-bar-title/index.d.ts +1 -0
- package/types/uni/core/lib/ui/tab-bar/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-push/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-verify/utssdk/index.d.ts +46 -0
- package/types/uni/uts-plugin-api/lib/uni-verify/utssdk/interface.d.ts +201 -0
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/index.d.ts +3 -0
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +26 -2
- package/uts-plugin.d.ts +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-app-x",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "uni-app x types",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"author": "DCloud",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build:types:plugin": "npm run build:types:plugin:api && npm run build:types:plugin:component && npm run build:types:plugin:modules",
|
|
15
15
|
"build:types:meta": "node ./scripts/build-meta.js",
|
|
16
16
|
"build:types:native": "node ./scripts/build-native.js",
|
|
17
|
-
"build:types": "build:types:native && npm run build:types:core && npm run build:types:plugin"
|
|
17
|
+
"build:types": "npm run build:types:native && npm run build:types:core && npm run build:types:plugin"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"delete": "^1.1.0",
|
|
@@ -114,17 +114,17 @@ export interface Element {
|
|
|
114
114
|
offsetLeft: number
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* 只读属性
|
|
117
|
+
* 只读属性 元素的顶部边界偏移值 单位px
|
|
118
118
|
*/
|
|
119
119
|
offsetTop: number
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* 只读属性
|
|
122
|
+
* 只读属性 元素的布局宽度,宽度包含border、padding的数据值 单位px
|
|
123
123
|
*/
|
|
124
124
|
offsetWidth: number
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
/**
|
|
127
|
-
* 只读属性
|
|
127
|
+
* 只读属性 元素的布局高度,高度包含border、padding的数据值 单位px
|
|
128
128
|
*/
|
|
129
129
|
offsetHeight: number
|
|
130
130
|
|
package/types/native/IApp.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeData } from "./NodeData";
|
|
2
2
|
import { Element } from "./Element";
|
|
3
|
+
import { IComment } from "./IComment";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @package io.dcloud.uniapp.runtime
|
|
@@ -16,7 +17,7 @@ export interface IDocument extends Element {
|
|
|
16
17
|
|
|
17
18
|
createElement(data: NodeData): Element
|
|
18
19
|
|
|
19
|
-
createComment(data: string):
|
|
20
|
+
createComment(data: string): IComment
|
|
20
21
|
|
|
21
22
|
notifyLayout(): void
|
|
22
23
|
|
|
@@ -12,7 +12,26 @@ export class NestedPreScrollEvent extends Event {
|
|
|
12
12
|
/**
|
|
13
13
|
* y轴滚动距离
|
|
14
14
|
*/
|
|
15
|
-
deltaY: number
|
|
15
|
+
deltaY: number
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 是否由触摸行为发生的Event
|
|
19
|
+
* @uniPlatform {
|
|
20
|
+
* "app": {
|
|
21
|
+
* "android": {
|
|
22
|
+
* "osVer": "5.0",
|
|
23
|
+
* "uniVer": "x",
|
|
24
|
+
* "unixVer": "3.99"
|
|
25
|
+
* },
|
|
26
|
+
* "ios": {
|
|
27
|
+
* "osVer": "x",
|
|
28
|
+
* "uniVer": "x",
|
|
29
|
+
* "unixVer": "x"
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
isTouch: boolean
|
|
16
35
|
|
|
17
36
|
/**
|
|
18
37
|
* 通知到子节点x,y轴滚动距离的消耗
|
|
@@ -9,4 +9,23 @@ export class StartNestedScrollEvent extends Event {
|
|
|
9
9
|
* 开始滚动子节点对象
|
|
10
10
|
*/
|
|
11
11
|
node: Element
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 是否由触摸行为发生的Event
|
|
15
|
+
* @uniPlatform {
|
|
16
|
+
* "app": {
|
|
17
|
+
* "android": {
|
|
18
|
+
* "osVer": "5.0",
|
|
19
|
+
* "uniVer": "x",
|
|
20
|
+
* "unixVer": "3.99"
|
|
21
|
+
* },
|
|
22
|
+
* "ios": {
|
|
23
|
+
* "osVer": "x",
|
|
24
|
+
* "uniVer": "x",
|
|
25
|
+
* "unixVer": "x"
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
isTouch: boolean
|
|
12
31
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Event } from "./Event";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @package io.dcloud.uniapp.runtime
|
|
5
|
+
* @uniPlatform {
|
|
6
|
+
* "app": {
|
|
7
|
+
* "android": {
|
|
8
|
+
* "osVer": "5.0",
|
|
9
|
+
* "uniVer": "x",
|
|
10
|
+
* "unixVer": "3.99"
|
|
11
|
+
* },
|
|
12
|
+
* "ios": {
|
|
13
|
+
* "osVer": "x",
|
|
14
|
+
* "uniVer": "x",
|
|
15
|
+
* "unixVer": "x"
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export class StopNestedScrollEvent extends Event {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 是否由触摸行为发生的Event
|
|
24
|
+
*/
|
|
25
|
+
isTouch: boolean
|
|
26
|
+
}
|
package/types/native/global.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// 本文件为自动构建生成
|
|
1
2
|
import {
|
|
2
3
|
WebViewStyles as WebViewStylesOrigin,
|
|
3
4
|
WebViewProgressStyles as WebViewProgressStylesOrigin,
|
|
@@ -47,6 +48,7 @@ import {
|
|
|
47
48
|
SwiperTransitionEvent as SwiperTransitionEventOrigin,
|
|
48
49
|
SwiperChangeEvent as SwiperChangeEventOrigin,
|
|
49
50
|
SwiperAnimationFinishEvent as SwiperAnimationFinishEventOrigin,
|
|
51
|
+
StopNestedScrollEvent as StopNestedScrollEventOrigin,
|
|
50
52
|
StartNestedScrollEvent as StartNestedScrollEventOrigin,
|
|
51
53
|
SourceError as SourceErrorOrigin,
|
|
52
54
|
TakeSnapshotOptions as TakeSnapshotOptionsOrigin,
|
|
@@ -75,6 +77,7 @@ import {
|
|
|
75
77
|
ImageLoadEvent as ImageLoadEventOrigin,
|
|
76
78
|
ImageErrorEvent as ImageErrorEventOrigin,
|
|
77
79
|
IUniError as IUniErrorOrigin,
|
|
80
|
+
ITextNode as ITextNodeOrigin,
|
|
78
81
|
IPageManager as IPageManagerOrigin,
|
|
79
82
|
UniCallbackWrapper as UniCallbackWrapperOrigin,
|
|
80
83
|
NavigationBarButtonTapEvent as NavigationBarButtonTapEventOrigin,
|
|
@@ -84,6 +87,7 @@ import {
|
|
|
84
87
|
IPage as IPageOrigin,
|
|
85
88
|
INavigationBar as INavigationBarOrigin,
|
|
86
89
|
IDocument as IDocumentOrigin,
|
|
90
|
+
IComment as ICommentOrigin,
|
|
87
91
|
IApp as IAppOrigin,
|
|
88
92
|
Event as EventOrigin,
|
|
89
93
|
Element as ElementOrigin,
|
|
@@ -170,6 +174,8 @@ declare global {
|
|
|
170
174
|
type SwiperChangeEvent = SwiperChangeEventOrigin
|
|
171
175
|
const SwiperAnimationFinishEvent: typeof SwiperAnimationFinishEventOrigin
|
|
172
176
|
type SwiperAnimationFinishEvent = SwiperAnimationFinishEventOrigin
|
|
177
|
+
const StopNestedScrollEvent: typeof StopNestedScrollEventOrigin
|
|
178
|
+
type StopNestedScrollEvent = StopNestedScrollEventOrigin
|
|
173
179
|
const StartNestedScrollEvent: typeof StartNestedScrollEventOrigin
|
|
174
180
|
type StartNestedScrollEvent = StartNestedScrollEventOrigin
|
|
175
181
|
const SourceError: typeof SourceErrorOrigin
|
|
@@ -219,6 +225,7 @@ declare global {
|
|
|
219
225
|
const ImageErrorEvent: typeof ImageErrorEventOrigin
|
|
220
226
|
type ImageErrorEvent = ImageErrorEventOrigin
|
|
221
227
|
type IUniError = IUniErrorOrigin
|
|
228
|
+
type ITextNode = ITextNodeOrigin
|
|
222
229
|
const IPageManager: typeof IPageManagerOrigin
|
|
223
230
|
type IPageManager = IPageManagerOrigin
|
|
224
231
|
const UniCallbackWrapper: typeof UniCallbackWrapperOrigin
|
|
@@ -234,7 +241,7 @@ declare global {
|
|
|
234
241
|
type IPage = IPageOrigin
|
|
235
242
|
type INavigationBar = INavigationBarOrigin
|
|
236
243
|
type IDocument = IDocumentOrigin
|
|
237
|
-
|
|
244
|
+
type IComment = ICommentOrigin
|
|
238
245
|
type IApp = IAppOrigin
|
|
239
246
|
const Event: typeof EventOrigin
|
|
240
247
|
type Event = EventOrigin
|
package/types/native/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// 本文件为自动构建生成
|
|
1
2
|
export * from './WebViewStyles'
|
|
2
3
|
export * from './WebViewMessageEvent'
|
|
3
4
|
export * from './WebViewLoadingEvent'
|
|
@@ -21,6 +22,7 @@ export * from './TabTapEvent'
|
|
|
21
22
|
export * from './SwiperTransitionEvent'
|
|
22
23
|
export * from './SwiperChangeEvent'
|
|
23
24
|
export * from './SwiperAnimationFinishEvent'
|
|
25
|
+
export * from './StopNestedScrollEvent'
|
|
24
26
|
export * from './StartNestedScrollEvent'
|
|
25
27
|
export * from './SourceError'
|
|
26
28
|
export * from './SnapshotOptions'
|
|
@@ -43,10 +45,12 @@ export * from './InputBlurEvent'
|
|
|
43
45
|
export * from './ImageLoadEvent'
|
|
44
46
|
export * from './ImageErrorEvent'
|
|
45
47
|
export * from './IUniError'
|
|
48
|
+
export * from './ITextNode'
|
|
46
49
|
export * from './IPageManager'
|
|
47
50
|
export * from './IPage'
|
|
48
51
|
export * from './INavigationBar'
|
|
49
52
|
export * from './IDocument'
|
|
53
|
+
export * from './IComment'
|
|
50
54
|
export * from './IApp'
|
|
51
55
|
export * from './Event'
|
|
52
56
|
export * from './Element'
|
package/types/page.d.ts
CHANGED
|
@@ -168,7 +168,7 @@ interface OnResizeOptions {
|
|
|
168
168
|
size: OnResizeSize
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
interface
|
|
171
|
+
interface OnShareAppMessageOption {
|
|
172
172
|
/**
|
|
173
173
|
* 转发事件来源。
|
|
174
174
|
* 可选值:
|
|
@@ -186,7 +186,7 @@ interface ShareAppMessageOption {
|
|
|
186
186
|
webViewUrl?: string;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
interface
|
|
189
|
+
interface OnAddToFavoritesOption {
|
|
190
190
|
/**
|
|
191
191
|
* 转发事件来源。
|
|
192
192
|
* 可选值:
|
|
@@ -215,7 +215,7 @@ interface CustomFavoritesContent {
|
|
|
215
215
|
imageUrl?: string;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
interface
|
|
218
|
+
interface OnTabItemTapOption {
|
|
219
219
|
/**
|
|
220
220
|
* 被点击 tabItem 的序号,从0开始
|
|
221
221
|
*/
|
|
@@ -230,7 +230,7 @@ interface TabItemTapOption {
|
|
|
230
230
|
text: string;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
interface
|
|
233
|
+
interface OnNavigationBarButtonTapOption {
|
|
234
234
|
/**
|
|
235
235
|
* 原生标题栏按钮数组的下标
|
|
236
236
|
*/
|
|
@@ -246,15 +246,6 @@ type Record<K extends keyof any, T> = {
|
|
|
246
246
|
|
|
247
247
|
type NativeMap<K extends string, V> = Map<K, V> & Record<K, V>
|
|
248
248
|
|
|
249
|
-
type OnLoadOptions = NativeMap<string, any>
|
|
250
|
-
|
|
251
|
-
interface OnBackPressOptions {
|
|
252
|
-
/**
|
|
253
|
-
* - backbutton 顶部导航栏左边的返回按钮或 Android 实体返回键
|
|
254
|
-
* - navigateBack 返回 API,即 uni.navigateBack()
|
|
255
|
-
*/
|
|
256
|
-
from: 'backbutton' | 'navigateBack';
|
|
257
|
-
}
|
|
258
249
|
|
|
259
250
|
interface NavigationBarSearchInputEvent {
|
|
260
251
|
/**
|
|
@@ -268,10 +259,6 @@ interface PageInstanceBaseProps<D extends AnyObject = any> {
|
|
|
268
259
|
* 到当前页面的路径,类型为 `String`
|
|
269
260
|
*/
|
|
270
261
|
route?: string;
|
|
271
|
-
/**
|
|
272
|
-
* 获取当前页面的webview对象实例。仅 App 平台支持
|
|
273
|
-
*/
|
|
274
|
-
$getAppWebview?: () => PlusWebviewWebviewObject;
|
|
275
262
|
/**
|
|
276
263
|
* 当前页面的 Vue 实例
|
|
277
264
|
*/
|
|
@@ -895,7 +882,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
895
882
|
* }
|
|
896
883
|
*}
|
|
897
884
|
*/
|
|
898
|
-
|
|
885
|
+
onShareAppMessage?(options: OnShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
|
|
899
886
|
/**
|
|
900
887
|
* 用户点击右上角转发到朋友圈
|
|
901
888
|
*
|
|
@@ -1031,7 +1018,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
1031
1018
|
* }
|
|
1032
1019
|
*}
|
|
1033
1020
|
*/
|
|
1034
|
-
|
|
1021
|
+
onAddToFavorites?(options: OnAddToFavoritesOption): CustomFavoritesContent;
|
|
1035
1022
|
/**
|
|
1036
1023
|
* 页面滚动触发事件的处理函数
|
|
1037
1024
|
*
|
|
@@ -1100,7 +1087,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
1100
1087
|
* }
|
|
1101
1088
|
*}
|
|
1102
1089
|
*/
|
|
1103
|
-
|
|
1090
|
+
onPageScroll?(options: OnPageScrollOptions): void;
|
|
1104
1091
|
/**
|
|
1105
1092
|
* 页面尺寸改变时触发
|
|
1106
1093
|
* @param options 页面滚动参数
|
|
@@ -1167,7 +1154,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
1167
1154
|
* }
|
|
1168
1155
|
*}
|
|
1169
1156
|
*/
|
|
1170
|
-
|
|
1157
|
+
onResize?(options: OnResizeOptions): void;
|
|
1171
1158
|
/**
|
|
1172
1159
|
* 当前是 tab 页时,点击 tab 时触发
|
|
1173
1160
|
* @param options tab 点击参数
|
|
@@ -1234,7 +1221,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
1234
1221
|
* }
|
|
1235
1222
|
*}
|
|
1236
1223
|
*/
|
|
1237
|
-
|
|
1224
|
+
onTabItemTap?(options: OnTabItemTapOption): void;
|
|
1238
1225
|
/**
|
|
1239
1226
|
* 监听原生标题栏按钮点击事件
|
|
1240
1227
|
* @param options tab 点击参数
|
|
@@ -1301,7 +1288,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
|
|
|
1301
1288
|
* }
|
|
1302
1289
|
*}
|
|
1303
1290
|
*/
|
|
1304
|
-
|
|
1291
|
+
onNavigationBarButtonTap?(options: OnNavigationBarButtonTapOption): void;
|
|
1305
1292
|
/**
|
|
1306
1293
|
* 监听页面返回
|
|
1307
1294
|
* @param options tab 点击参数
|
|
@@ -1580,7 +1567,15 @@ declare global {
|
|
|
1580
1567
|
* `getCurrentPages()` 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,数组中的元素为页面实例,第一个元素为首页,最后一个元素为当前页面。
|
|
1581
1568
|
* @tutorial https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages
|
|
1582
1569
|
*/
|
|
1583
|
-
|
|
1570
|
+
const getCurrentPages: () => BasePage[]
|
|
1571
|
+
type OnLoadOptions = NativeMap<string, any>
|
|
1572
|
+
interface OnBackPressOptions {
|
|
1573
|
+
/**
|
|
1574
|
+
* - backbutton 顶部导航栏左边的返回按钮或 Android 实体返回键
|
|
1575
|
+
* - navigateBack 返回 API,即 uni.navigateBack()
|
|
1576
|
+
*/
|
|
1577
|
+
from: 'backbutton' | 'navigateBack';
|
|
1578
|
+
}
|
|
1584
1579
|
}
|
|
1585
1580
|
|
|
1586
1581
|
declare module '@vue/runtime-core' {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference path='./lib/uni-websocket/utssdk/index.d.ts' />
|
|
2
|
+
/// <reference path='./lib/uni-verify/utssdk/index.d.ts' />
|
|
2
3
|
/// <reference path='./lib/uni-storage/utssdk/index.d.ts' />
|
|
3
4
|
/// <reference path='./lib/uni-push/utssdk/index.d.ts' />
|
|
4
5
|
/// <reference path='./lib/uni-prompt/utssdk/index.d.ts' />
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// 本文件为自动构建生成
|
|
2
|
+
import {
|
|
3
|
+
GetUniverifyManager as GetUniverifyManagerOrigin,
|
|
4
|
+
UniverifyManager as UniverifyManagerOrigin,
|
|
5
|
+
PreLoginOptions as PreLoginOptionsOrigin,
|
|
6
|
+
LoginOptions as LoginOptionsOrigin,
|
|
7
|
+
UniverifyStyle as UniverifyStyleOrigin,
|
|
8
|
+
PreLoginSuccessCallback as PreLoginSuccessCallbackOrigin,
|
|
9
|
+
PreLoginFail as PreLoginFailOrigin,
|
|
10
|
+
PreLoginFailCallback as PreLoginFailCallbackOrigin,
|
|
11
|
+
PreLoginComplete as PreLoginCompleteOrigin,
|
|
12
|
+
PreLoginCompleteCallback as PreLoginCompleteCallbackOrigin,
|
|
13
|
+
LoginSuccess as LoginSuccessOrigin,
|
|
14
|
+
LoginSuccessCallback as LoginSuccessCallbackOrigin,
|
|
15
|
+
LoginFail as LoginFailOrigin,
|
|
16
|
+
LoginFailCallback as LoginFailCallbackOrigin,
|
|
17
|
+
LoginComplete as LoginCompleteOrigin,
|
|
18
|
+
LoginCompleteCallback as LoginCompleteCallbackOrigin,
|
|
19
|
+
UniverifyErrorCode as UniverifyErrorCodeOrigin,
|
|
20
|
+
UniverifyErrorCode as UniverifyErrorCodeOrigin,
|
|
21
|
+
InternalResponse as InternalResponseOrigin,
|
|
22
|
+
Uni as UniOrigin
|
|
23
|
+
} from './interface'
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
type GetUniverifyManager = GetUniverifyManagerOrigin
|
|
27
|
+
type UniverifyManager = UniverifyManagerOrigin
|
|
28
|
+
type PreLoginOptions = PreLoginOptionsOrigin
|
|
29
|
+
type LoginOptions = LoginOptionsOrigin
|
|
30
|
+
type UniverifyStyle = UniverifyStyleOrigin
|
|
31
|
+
type PreLoginSuccessCallback = PreLoginSuccessCallbackOrigin
|
|
32
|
+
type PreLoginFail = PreLoginFailOrigin
|
|
33
|
+
type PreLoginFailCallback = PreLoginFailCallbackOrigin
|
|
34
|
+
type PreLoginComplete = PreLoginCompleteOrigin
|
|
35
|
+
type PreLoginCompleteCallback = PreLoginCompleteCallbackOrigin
|
|
36
|
+
type LoginSuccess = LoginSuccessOrigin
|
|
37
|
+
type LoginSuccessCallback = LoginSuccessCallbackOrigin
|
|
38
|
+
type LoginFail = LoginFailOrigin
|
|
39
|
+
type LoginFailCallback = LoginFailCallbackOrigin
|
|
40
|
+
type LoginComplete = LoginCompleteOrigin
|
|
41
|
+
type LoginCompleteCallback = LoginCompleteCallbackOrigin
|
|
42
|
+
type UniverifyErrorCode = UniverifyErrorCodeOrigin
|
|
43
|
+
type UniverifyErrorCode = UniverifyErrorCodeOrigin
|
|
44
|
+
type InternalResponse = InternalResponseOrigin
|
|
45
|
+
interface Uni extends UniOrigin { }
|
|
46
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
export interface Uni {
|
|
2
|
+
/**
|
|
3
|
+
* @description 获取一键登录管理对象
|
|
4
|
+
* @tutorial https://uniapp.dcloud.net.cn/univerify.html#univerifymanager
|
|
5
|
+
* @uniPlatform {
|
|
6
|
+
* "app": {
|
|
7
|
+
* "android": {
|
|
8
|
+
* "osVer": "4.4",
|
|
9
|
+
* "uniVer": "√",
|
|
10
|
+
* "unixVer": "3.99"
|
|
11
|
+
* },
|
|
12
|
+
* "ios": {
|
|
13
|
+
* "osVer": "9.0",
|
|
14
|
+
* "uniVer": "√",
|
|
15
|
+
* "unixVer": "x"
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
getUniverifyManager : GetUniverifyManager
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type GetUniverifyManager = () => UniverifyManager
|
|
24
|
+
|
|
25
|
+
export interface UniverifyManager {
|
|
26
|
+
/**
|
|
27
|
+
* @description 预登录
|
|
28
|
+
* @uniPlatform {
|
|
29
|
+
* "app": {
|
|
30
|
+
* "android": {
|
|
31
|
+
* "osVer": "4.4",
|
|
32
|
+
* "uniVer": "√",
|
|
33
|
+
* "unixVer": "3.99"
|
|
34
|
+
* },
|
|
35
|
+
* "ios": {
|
|
36
|
+
* "osVer": "9.0",
|
|
37
|
+
* "uniVer": "√",
|
|
38
|
+
* "unixVer": "x"
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
preLogin(options : PreLoginOptions) : void
|
|
44
|
+
/**
|
|
45
|
+
* @description 登录
|
|
46
|
+
* @uniPlatform {
|
|
47
|
+
* "app": {
|
|
48
|
+
* "android": {
|
|
49
|
+
* "osVer": "4.4",
|
|
50
|
+
* "uniVer": "√",
|
|
51
|
+
* "unixVer": "3.99"
|
|
52
|
+
* },
|
|
53
|
+
* "ios": {
|
|
54
|
+
* "osVer": "9.0",
|
|
55
|
+
* "uniVer": "√",
|
|
56
|
+
* "unixVer": "x"
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
login(options : LoginOptions) : void
|
|
62
|
+
/**
|
|
63
|
+
* @description 关闭登录页
|
|
64
|
+
* @uniPlatform {
|
|
65
|
+
* "app": {
|
|
66
|
+
* "android": {
|
|
67
|
+
* "osVer": "4.4",
|
|
68
|
+
* "uniVer": "√",
|
|
69
|
+
* "unixVer": "3.99"
|
|
70
|
+
* },
|
|
71
|
+
* "ios": {
|
|
72
|
+
* "osVer": "9.0",
|
|
73
|
+
* "uniVer": "√",
|
|
74
|
+
* "unixVer": "x"
|
|
75
|
+
* }
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
*/
|
|
79
|
+
close() : void
|
|
80
|
+
/**
|
|
81
|
+
* @description 预登录是否有效
|
|
82
|
+
* @uniPlatform {
|
|
83
|
+
* "app": {
|
|
84
|
+
* "android": {
|
|
85
|
+
* "osVer": "4.4",
|
|
86
|
+
* "uniVer": "√",
|
|
87
|
+
* "unixVer": "3.99"
|
|
88
|
+
* },
|
|
89
|
+
* "ios": {
|
|
90
|
+
* "osVer": "9.0",
|
|
91
|
+
* "uniVer": "√",
|
|
92
|
+
* "unixVer": "x"
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
*/
|
|
97
|
+
isPreLoginResultValid() : boolean
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 预登录参数
|
|
102
|
+
*/
|
|
103
|
+
export type PreLoginOptions = {
|
|
104
|
+
success ?: PreLoginSuccessCallback,
|
|
105
|
+
fail ?: PreLoginFailCallback,
|
|
106
|
+
complete ?: PreLoginCompleteCallback
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 登录参数
|
|
111
|
+
*/
|
|
112
|
+
export type LoginOptions = {
|
|
113
|
+
univerifyStyle ?: UniverifyStyle,
|
|
114
|
+
success ?: LoginSuccessCallback,
|
|
115
|
+
fail ?: LoginFailCallback,
|
|
116
|
+
complete ?: LoginCompleteCallback
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 登录页样式
|
|
121
|
+
*/
|
|
122
|
+
export type UniverifyStyle = {
|
|
123
|
+
/**
|
|
124
|
+
* 是否全屏
|
|
125
|
+
*/
|
|
126
|
+
fullScreen ?: boolean,
|
|
127
|
+
/**
|
|
128
|
+
* logo路径
|
|
129
|
+
*/
|
|
130
|
+
logoPath ?: string,
|
|
131
|
+
/**
|
|
132
|
+
* 登录页背景色
|
|
133
|
+
*/
|
|
134
|
+
backgroundColor ?: string,
|
|
135
|
+
/**
|
|
136
|
+
* 登录按钮文字
|
|
137
|
+
*/
|
|
138
|
+
loginBtnText ?: string
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type PreLoginSuccessCallback = () => void
|
|
142
|
+
export interface PreLoginFail extends IUniError {
|
|
143
|
+
errCode : UniverifyErrorCode
|
|
144
|
+
}
|
|
145
|
+
export type PreLoginFailCallback = (err : PreLoginFail) => void
|
|
146
|
+
export type PreLoginComplete = any;
|
|
147
|
+
export type PreLoginCompleteCallback = (res : PreLoginComplete) => void
|
|
148
|
+
|
|
149
|
+
export type LoginSuccess = {
|
|
150
|
+
/**
|
|
151
|
+
* 登录授权唯一标识
|
|
152
|
+
*/
|
|
153
|
+
openid : string,
|
|
154
|
+
/**
|
|
155
|
+
* token
|
|
156
|
+
*/
|
|
157
|
+
accessToken : string
|
|
158
|
+
}
|
|
159
|
+
export type LoginSuccessCallback = (res : LoginSuccess) => void
|
|
160
|
+
export interface LoginFail extends IUniError {
|
|
161
|
+
errCode : UniverifyErrorCode
|
|
162
|
+
}
|
|
163
|
+
export type LoginFailCallback = (err : LoginFail) => void
|
|
164
|
+
export type LoginComplete = any;
|
|
165
|
+
export type LoginCompleteCallback = (res : LoginComplete) => void
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 30002 其他登录方式
|
|
169
|
+
* 30003 登录界面关闭
|
|
170
|
+
* 30004 其他错误
|
|
171
|
+
* 30005 预登录失败
|
|
172
|
+
* 30006 一键登录失败
|
|
173
|
+
*/
|
|
174
|
+
// export type UniverifyErrorCode = 30002 | 30003 | 30004 | 30005 | 30006;
|
|
175
|
+
export type UniverifyErrorCode = 30004 | 30005 | 30006;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* SDK响应数据结构
|
|
179
|
+
*/
|
|
180
|
+
export type InternalResponse = {
|
|
181
|
+
/**
|
|
182
|
+
* 个验用户唯一标识
|
|
183
|
+
*/
|
|
184
|
+
gyuid : string,
|
|
185
|
+
/**
|
|
186
|
+
* code 返回结果,30000为成功
|
|
187
|
+
*/
|
|
188
|
+
code : number,
|
|
189
|
+
/**
|
|
190
|
+
* msg 返回结果详情,为json格式,包含errorCode、errorDesc、metadata、及其他业务自定义的字段
|
|
191
|
+
*/
|
|
192
|
+
msg : string,
|
|
193
|
+
/**
|
|
194
|
+
* 请求的运营商,CM 移动、CT 电信、CU 联通
|
|
195
|
+
*/
|
|
196
|
+
operator : string,
|
|
197
|
+
/**
|
|
198
|
+
* 接口请求是否成功
|
|
199
|
+
*/
|
|
200
|
+
isSuccess : boolean
|
|
201
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
// 本文件为自动构建生成
|
|
1
2
|
import {
|
|
2
3
|
FacialRecognitionVerifyErrorCode as FacialRecognitionVerifyErrorCodeOrigin,
|
|
4
|
+
StartFacialRecognitionVerifyScreenOrientation as StartFacialRecognitionVerifyScreenOrientationOrigin,
|
|
3
5
|
IFacialRecognitionVerifyError as IFacialRecognitionVerifyErrorOrigin,
|
|
4
6
|
StartFacialRecognitionVerifySuccess as StartFacialRecognitionVerifySuccessOrigin,
|
|
5
7
|
StartFacialRecognitionVerifySuccessCallback as StartFacialRecognitionVerifySuccessCallbackOrigin,
|
|
@@ -13,6 +15,7 @@ import {
|
|
|
13
15
|
|
|
14
16
|
declare global {
|
|
15
17
|
type FacialRecognitionVerifyErrorCode = FacialRecognitionVerifyErrorCodeOrigin
|
|
18
|
+
type StartFacialRecognitionVerifyScreenOrientation = StartFacialRecognitionVerifyScreenOrientationOrigin
|
|
16
19
|
type IFacialRecognitionVerifyError = IFacialRecognitionVerifyErrorOrigin
|
|
17
20
|
type StartFacialRecognitionVerifySuccess = StartFacialRecognitionVerifySuccessOrigin
|
|
18
21
|
type StartFacialRecognitionVerifySuccessCallback = StartFacialRecognitionVerifySuccessCallbackOrigin
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export type FacialRecognitionVerifyErrorCode = 10010 | 10012 | 10011 | 10013 | 10020 | 10001;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 认证时屏幕方向
|
|
15
|
+
* - land 横屏
|
|
16
|
+
* - port 竖屏
|
|
17
|
+
*/
|
|
18
|
+
export type StartFacialRecognitionVerifyScreenOrientation = "land" | "port";
|
|
19
|
+
|
|
12
20
|
export interface IFacialRecognitionVerifyError extends IUniError {
|
|
13
21
|
errCode : FacialRecognitionVerifyErrorCode
|
|
14
22
|
};
|
|
@@ -46,9 +54,25 @@ export type StartFacialRecognitionVerifyOptions = {
|
|
|
46
54
|
*/
|
|
47
55
|
progressBarColor ?: string | null,
|
|
48
56
|
/**
|
|
49
|
-
* 认证界面UI
|
|
57
|
+
* 认证界面UI朝向。
|
|
58
|
+
* @type {StartFacialRecognitionVerifyScreenOrientation}
|
|
59
|
+
* @defaultValue "port"
|
|
60
|
+
* @uniPlatform {
|
|
61
|
+
* "app": {
|
|
62
|
+
* "android": {
|
|
63
|
+
* "osVer": "5.0",
|
|
64
|
+
* "uniVer": "√",
|
|
65
|
+
* "unixVer": "3.9+"
|
|
66
|
+
* },
|
|
67
|
+
* "ios": {
|
|
68
|
+
* "osVer": "x",
|
|
69
|
+
* "uniVer": "x",
|
|
70
|
+
* "unixVer": "x"
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
50
74
|
*/
|
|
51
|
-
screenOrientation ?:
|
|
75
|
+
screenOrientation ?: StartFacialRecognitionVerifyScreenOrientation | null,
|
|
52
76
|
/**
|
|
53
77
|
* 成功回调
|
|
54
78
|
*/
|
package/uts-plugin.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/// <reference path='./types/native/UniError.d.ts' />
|
|
2
|
-
/// <reference path='./types/native/SourceError.d.ts' />
|
|
3
|
-
/// <reference path='./types/native/UniAggregateError.d.ts' />
|
|
4
|
-
/// <reference path='./types/native/UTSAndroidHookProxy.d.ts' />
|
|
5
1
|
/// <reference path='./types/uni/base/index.d.ts' />
|
|
6
2
|
/// <reference path='./types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/index.d.ts' />
|
|
7
3
|
/// <reference path='./types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/index.d.ts' />
|
|
@@ -9,3 +5,20 @@
|
|
|
9
5
|
/// <reference path='./types/uni/uts-plugin-api/lib/uni-network/utssdk/index.d.ts' />
|
|
10
6
|
/// <reference path='./types/uni/uts-plugin-api/lib/uni-prompt/utssdk/index.d.ts' />
|
|
11
7
|
/// <reference path='./types/uni/uts-plugin-api/lib/uni-storage/utssdk/index.d.ts' />
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
UniError as UniErrorOrigin,
|
|
11
|
+
SourceError as SourceErrorOrigin,
|
|
12
|
+
UniAggregateError as UniAggregateErrorOrigin,
|
|
13
|
+
UTSAndroidHookProxy as UTSAndroidHookProxyOrigin,
|
|
14
|
+
} from './types/native'
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
const UniError: typeof UniErrorOrigin
|
|
18
|
+
type UniError = UniErrorOrigin
|
|
19
|
+
const SourceError: typeof SourceErrorOrigin
|
|
20
|
+
type SourceError = SourceErrorOrigin
|
|
21
|
+
const UniAggregateError: typeof UniAggregateErrorOrigin
|
|
22
|
+
type UniAggregateError = UniAggregateErrorOrigin
|
|
23
|
+
type UTSAndroidHookProxy = UTSAndroidHookProxyOrigin
|
|
24
|
+
}
|