@weapp-core/types 1.2.1 → 1.2.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.
|
@@ -292,7 +292,18 @@ declare namespace WechatMiniprogram.Page {
|
|
|
292
292
|
type VoidReturnType<TData extends DataOption, TCustom extends CustomOption> = void & Component.TypeSignature<TData, Record<never, never>, { [K in keyof TCustom as TCustom[K] extends Function ? K : never]: TCustom[K]; }>;
|
|
293
293
|
type Instance<TData extends DataOption, TCustom extends CustomOption> = OptionalInterface<ILifetime> & InstanceProperties & InstanceMethods<TData> & Data<TData> & TCustom;
|
|
294
294
|
type Options<TData extends DataOption, TCustom extends CustomOption> = (TCustom & Partial<Data<TData>> & Partial<ILifetime> & {
|
|
295
|
+
/**
|
|
296
|
+
* 页面的组件选项,同 `Component` 构造器的 `options`
|
|
297
|
+
*
|
|
298
|
+
* 最低基础库版本:[`2.10.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
299
|
+
*/
|
|
295
300
|
options?: Component.ComponentOptions;
|
|
301
|
+
/**
|
|
302
|
+
* 同 `Component` 构造器的 `behaviors` ,参见 [behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/behaviors.html)
|
|
303
|
+
*
|
|
304
|
+
* 最低基础库版本:[`2.9.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
305
|
+
*/
|
|
306
|
+
behaviors?: Component.BehaviorOption;
|
|
296
307
|
}) & ThisType<Instance<TData, TCustom>>;
|
|
297
308
|
type TrivialInstance = Instance<IAnyObject, IAnyObject>;
|
|
298
309
|
interface Constructor {
|
|
@@ -332,6 +343,8 @@ declare namespace WechatMiniprogram.Page {
|
|
|
332
343
|
/** 生命周期回调—监听路由动画完成
|
|
333
344
|
*
|
|
334
345
|
* 路由动画完成时触发。如 wx.navigateTo 页面完全推入后 或 wx.navigateBack 页面完全恢复时。
|
|
346
|
+
*
|
|
347
|
+
* 最低基础库版本:[`2.31.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
335
348
|
*/
|
|
336
349
|
onRouteDone(): void | Promise<void>;
|
|
337
350
|
/** 监听用户下拉动作
|
|
@@ -361,13 +374,15 @@ declare namespace WechatMiniprogram.Page {
|
|
|
361
374
|
/** 分享发起来源参数 */
|
|
362
375
|
options: IShareAppMessageOption): ICustomShareContent | IAsyncCustomShareContent | Promise<ICustomShareContent> | void | Promise<void>;
|
|
363
376
|
/**
|
|
364
|
-
*
|
|
377
|
+
* 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义分享内容。
|
|
365
378
|
*
|
|
366
|
-
*
|
|
379
|
+
* 支持平台:Android、iOS(微信 8.0.24 及以上版本)。基础库 2.11.3 开始支持,低版本需做兼容处理。
|
|
367
380
|
*
|
|
368
|
-
*
|
|
381
|
+
* **注意:只有定义了此事件处理函数,右上角菜单才会显示“分享到朋友圈”按钮**
|
|
382
|
+
*
|
|
383
|
+
* 详见 [分享到朋友圈](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html)
|
|
369
384
|
*/
|
|
370
|
-
onShareTimeline(): ICustomTimelineContent | void;
|
|
385
|
+
onShareTimeline(): ICustomTimelineContent | IAsyncCustomTimelineContent | void;
|
|
371
386
|
/** 页面滚动触发事件的处理函数
|
|
372
387
|
*
|
|
373
388
|
* 监听用户滑动页面事件。
|
|
@@ -375,20 +390,28 @@ declare namespace WechatMiniprogram.Page {
|
|
|
375
390
|
onPageScroll(
|
|
376
391
|
/** 页面滚动参数 */
|
|
377
392
|
options: IPageScrollOption): void | Promise<void>;
|
|
378
|
-
/** 当前是 tab 页时,点击 tab
|
|
393
|
+
/** 当前是 tab 页时,点击 tab 时触发
|
|
394
|
+
*
|
|
395
|
+
* 最低基础库版本:[`1.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
396
|
+
*/
|
|
379
397
|
onTabItemTap(
|
|
380
398
|
/** tab 点击参数 */
|
|
381
399
|
options: ITabItemTapOption): void | Promise<void>;
|
|
382
|
-
/**
|
|
400
|
+
/** 窗口尺寸改变时触发
|
|
401
|
+
*
|
|
402
|
+
* 最低基础库版本:[`2.4.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
403
|
+
*/
|
|
383
404
|
onResize(
|
|
384
405
|
/** 窗口尺寸参数 */
|
|
385
406
|
options: IResizeOption): void | Promise<void>;
|
|
386
407
|
/**
|
|
387
|
-
*
|
|
388
|
-
* 基础库 2.10.3,安卓 7.0.15 版本起支持,iOS 暂不支持
|
|
408
|
+
* 监听右上角菜单“收藏”按钮的行为,并自定义收藏内容。
|
|
389
409
|
*/
|
|
390
410
|
onAddToFavorites(options: IAddToFavoritesOption): IAddToFavoritesContent;
|
|
391
|
-
/**
|
|
411
|
+
/** 每当小程序可能被销毁之前会被调用,可以进行退出状态的保存
|
|
412
|
+
*
|
|
413
|
+
* 最低基础库版本:[`2.7.4`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
414
|
+
*/
|
|
392
415
|
onSaveExitState(): ISaveExitState;
|
|
393
416
|
}
|
|
394
417
|
interface InstanceProperties {
|
|
@@ -400,9 +423,17 @@ declare namespace WechatMiniprogram.Page {
|
|
|
400
423
|
options: Record<string, string | undefined>;
|
|
401
424
|
/** 上一次退出前 onSaveExitState 保存的数据 */
|
|
402
425
|
exitState: any;
|
|
403
|
-
/**
|
|
426
|
+
/**
|
|
427
|
+
* 相对于当前页面的 Router 对象。在页面中 `router` 与 `pageRouter` 为同一个对象,参见 [Router](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Router.html)
|
|
428
|
+
*
|
|
429
|
+
* 最低基础库版本:[`2.16.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
430
|
+
*/
|
|
404
431
|
router: Component.Router;
|
|
405
|
-
/**
|
|
432
|
+
/**
|
|
433
|
+
* 相对于当前页面的 Router 对象。在页面中 `router` 与 `pageRouter` 为同一个对象,参见 [Router](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Router.html)
|
|
434
|
+
*
|
|
435
|
+
* 最低基础库版本:[`2.16.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
436
|
+
*/
|
|
406
437
|
pageRouter: Component.Router;
|
|
407
438
|
/** 渲染当前页面的渲染后端 */
|
|
408
439
|
renderer: 'webview' | 'skyline';
|
|
@@ -440,6 +471,13 @@ declare namespace WechatMiniprogram.Page {
|
|
|
440
471
|
/** 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持 PNG 及 JPG。显示图片长宽比是 1:1。默认值:默认使用小程序 Logo*/
|
|
441
472
|
imageUrl?: string;
|
|
442
473
|
}
|
|
474
|
+
interface IAsyncCustomTimelineContent extends ICustomTimelineContent {
|
|
475
|
+
/** 如果该参数存在,则以 resolve 结果为准,如果三秒内不 resolve,分享会使用上面传入的默认参数
|
|
476
|
+
*
|
|
477
|
+
* 最低基础库版本:[`3.12.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
478
|
+
*/
|
|
479
|
+
promise: Promise<ICustomTimelineContent>;
|
|
480
|
+
}
|
|
443
481
|
interface IPageScrollOption {
|
|
444
482
|
/** 页面在垂直方向已滚动的距离(单位px) */
|
|
445
483
|
scrollTop: number;
|
|
@@ -465,11 +503,20 @@ declare namespace WechatMiniprogram.Page {
|
|
|
465
503
|
webViewUrl?: string;
|
|
466
504
|
}
|
|
467
505
|
interface ITabItemTapOption {
|
|
468
|
-
/** 被点击tabItem的序号,从
|
|
469
|
-
|
|
470
|
-
|
|
506
|
+
/** 被点击 tabItem 的序号,从 0 开始
|
|
507
|
+
*
|
|
508
|
+
* 最低基础库版本:[`1.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
509
|
+
*/
|
|
510
|
+
index: number;
|
|
511
|
+
/** 被点击 tabItem 的页面路径
|
|
512
|
+
*
|
|
513
|
+
* 最低基础库版本:[`1.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
514
|
+
*/
|
|
471
515
|
pagePath: string;
|
|
472
|
-
/** 被点击tabItem
|
|
516
|
+
/** 被点击 tabItem 的按钮文字
|
|
517
|
+
*
|
|
518
|
+
* 最低基础库版本:[`1.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
519
|
+
*/
|
|
473
520
|
text: string;
|
|
474
521
|
}
|
|
475
522
|
interface IResizeOption {
|
|
@@ -481,8 +528,8 @@ declare namespace WechatMiniprogram.Page {
|
|
|
481
528
|
};
|
|
482
529
|
}
|
|
483
530
|
interface IAddToFavoritesOption {
|
|
484
|
-
/** 页面中包含web-view组件时,返回当前web-view的url */
|
|
485
|
-
|
|
531
|
+
/** 页面中包含 web-view 组件时,返回当前 web-view 的 url。仅 Android 平台会传入该参数 */
|
|
532
|
+
webViewUrl?: string;
|
|
486
533
|
}
|
|
487
534
|
interface IAddToFavoritesContent {
|
|
488
535
|
/** 自定义标题,默认值:页面标题或账号名称 */
|
|
@@ -1025,7 +1072,7 @@ declare namespace WechatMiniprogram {
|
|
|
1025
1072
|
/** 事件说明 */
|
|
1026
1073
|
description?: string;
|
|
1027
1074
|
/** 结束时间的 unix 时间戳,默认与开始时间相同 */
|
|
1028
|
-
endTime?:
|
|
1075
|
+
endTime?: number;
|
|
1029
1076
|
/** 接口调用失败的回调函数 */
|
|
1030
1077
|
fail?: AddPhoneCalendarFailCallback;
|
|
1031
1078
|
/** 事件位置 */
|
|
@@ -1129,7 +1176,7 @@ declare namespace WechatMiniprogram {
|
|
|
1129
1176
|
/** 事件说明 */
|
|
1130
1177
|
description?: string;
|
|
1131
1178
|
/** 结束时间的 unix 时间戳,默认与开始时间相同 */
|
|
1132
|
-
endTime?:
|
|
1179
|
+
endTime?: number;
|
|
1133
1180
|
/** 接口调用失败的回调函数 */
|
|
1134
1181
|
fail?: AddPhoneRepeatCalendarFailCallback;
|
|
1135
1182
|
/** 事件位置 */
|
|
@@ -5187,6 +5234,25 @@ ctx.draw()
|
|
|
5187
5234
|
/** 接口调用成功的回调函数 */
|
|
5188
5235
|
success?: CopyFileSuccessCallback;
|
|
5189
5236
|
}
|
|
5237
|
+
interface CopyRealnameFailCallbackErr {
|
|
5238
|
+
/** 错误信息 */
|
|
5239
|
+
errMsg: string;
|
|
5240
|
+
}
|
|
5241
|
+
interface CopyRealnameOption {
|
|
5242
|
+
/** 透传给目标小程序的商户数据(必填) */
|
|
5243
|
+
extraData: IAnyObject;
|
|
5244
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
5245
|
+
complete?: CopyRealnameCompleteCallback;
|
|
5246
|
+
/** 接口调用失败的回调函数 */
|
|
5247
|
+
fail?: CopyRealnameFailCallback;
|
|
5248
|
+
/** 接口调用成功的回调函数 */
|
|
5249
|
+
success?: CopyRealnameSuccessCallback;
|
|
5250
|
+
}
|
|
5251
|
+
interface CopyRealnameSuccessCallbackResult {
|
|
5252
|
+
/** 商户回传数据 */
|
|
5253
|
+
extraData: IAnyObject;
|
|
5254
|
+
errMsg: string;
|
|
5255
|
+
}
|
|
5190
5256
|
interface CreateBLEConnectionOption {
|
|
5191
5257
|
/** 蓝牙设备 id */
|
|
5192
5258
|
deviceId: string;
|
|
@@ -5310,7 +5376,7 @@ ctx.draw()
|
|
|
5310
5376
|
interface CreateRewardedVideoAdOption {
|
|
5311
5377
|
/** 广告单元 id */
|
|
5312
5378
|
adUnitId: string;
|
|
5313
|
-
/** 需要基础库: `3.7.
|
|
5379
|
+
/** 需要基础库: `3.7.1`
|
|
5314
5380
|
*
|
|
5315
5381
|
* 是否禁用分享页,默认为false */
|
|
5316
5382
|
disableFallbackSharePage?: boolean;
|
|
@@ -7236,6 +7302,23 @@ ctx.draw()
|
|
|
7236
7302
|
data: T;
|
|
7237
7303
|
errMsg: string;
|
|
7238
7304
|
}
|
|
7305
|
+
interface GetStoreTraceIdOption {
|
|
7306
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
7307
|
+
complete?: GetStoreTraceIdCompleteCallback;
|
|
7308
|
+
/** 接口调用失败的回调函数 */
|
|
7309
|
+
fail?: GetStoreTraceIdFailCallback;
|
|
7310
|
+
/** 接口调用成功的回调函数 */
|
|
7311
|
+
success?: GetStoreTraceIdSuccessCallback;
|
|
7312
|
+
}
|
|
7313
|
+
interface GetStoreTraceIdSuccessCallbackResult {
|
|
7314
|
+
/** 是否需要同步订单 */
|
|
7315
|
+
requireOrder: number;
|
|
7316
|
+
/** requireOrder=1时有效,0:非二级商户号订单(内测版),1:二级商户号订单(正式版),2:两种方式皆可(过渡阶段才有,最终只会存在1) */
|
|
7317
|
+
requiredFundType: number;
|
|
7318
|
+
/** 跟踪ID,有效期十分钟,会影响归因等,需创建订单前调用,调用生成订单api时需传入该参数 */
|
|
7319
|
+
traceId: string;
|
|
7320
|
+
errMsg: string;
|
|
7321
|
+
}
|
|
7239
7322
|
interface GetSystemInfoAsyncOption {
|
|
7240
7323
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
7241
7324
|
complete?: GetSystemInfoAsyncCompleteCallback;
|
|
@@ -8273,6 +8356,29 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函
|
|
|
8273
8356
|
/** 接口调用成功的回调函数 */
|
|
8274
8357
|
success?: IsConnectedSuccessCallback;
|
|
8275
8358
|
}
|
|
8359
|
+
interface IsoDepTransceiveOption {
|
|
8360
|
+
/** 需要传递的二进制数据 */
|
|
8361
|
+
data: ArrayBuffer;
|
|
8362
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
8363
|
+
complete?: TransceiveCompleteCallback;
|
|
8364
|
+
/** 接口调用失败的回调函数 */
|
|
8365
|
+
fail?: TransceiveFailCallback;
|
|
8366
|
+
/** 接口调用成功的回调函数 */
|
|
8367
|
+
success?: IsoDepTransceiveSuccessCallback;
|
|
8368
|
+
}
|
|
8369
|
+
interface IsoDepTransceiveSuccessCallbackResult {
|
|
8370
|
+
/** 返回的二进制数据。安卓为 R-data + SW1 + SW2 的裸字节流,iOS 仅为 R-data */
|
|
8371
|
+
data: ArrayBuffer;
|
|
8372
|
+
/** 需要基础库: `3.17.5`
|
|
8373
|
+
*
|
|
8374
|
+
* 仅 iOS 返回,状态字 SW1 */
|
|
8375
|
+
sw1?: number;
|
|
8376
|
+
/** 需要基础库: `3.17.5`
|
|
8377
|
+
*
|
|
8378
|
+
* 仅 iOS 返回,状态字 SW2 */
|
|
8379
|
+
sw2?: number;
|
|
8380
|
+
errMsg: string;
|
|
8381
|
+
}
|
|
8276
8382
|
interface IssueTransitCardOption {
|
|
8277
8383
|
/** 交通卡卡种标识 */
|
|
8278
8384
|
issuerID: string;
|
|
@@ -8866,7 +8972,11 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函
|
|
|
8866
8972
|
/** 接口调用成功的回调函数 */
|
|
8867
8973
|
success?: MuteSuccessCallback;
|
|
8868
8974
|
}
|
|
8869
|
-
/** 需要基础库: `2.11.2`
|
|
8975
|
+
/** 需要基础库: `2.11.2`
|
|
8976
|
+
*
|
|
8977
|
+
* ****
|
|
8978
|
+
*
|
|
8979
|
+
* iOS 自 [3.17.5](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持,仅支持 ISO-DEP 标签,设备要求 iPhone 7 及以上、iOS 13 及以上,读写超时固定 60 秒。 */
|
|
8870
8980
|
interface NFCAdapter {
|
|
8871
8981
|
/** 标签类型枚举 */
|
|
8872
8982
|
tech: TechType;
|
|
@@ -8895,7 +9005,11 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
8895
9005
|
*
|
|
8896
9006
|
* 在插件中使用:支持
|
|
8897
9007
|
*
|
|
8898
|
-
* 监听 NFC Tag
|
|
9008
|
+
* 监听 NFC Tag
|
|
9009
|
+
*
|
|
9010
|
+
* ****
|
|
9011
|
+
*
|
|
9012
|
+
* iOS 仅在发现 ISO-DEP 标签时触发回调。 */
|
|
8899
9013
|
onDiscovered(
|
|
8900
9014
|
/** 的监听函数 */
|
|
8901
9015
|
listener: OnDiscoveredCallback): void;
|
|
@@ -9068,6 +9182,20 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
9068
9182
|
/** 接口调用成功的回调函数 */
|
|
9069
9183
|
success?: ConnectSuccessCallback;
|
|
9070
9184
|
}
|
|
9185
|
+
interface NfcATransceiveOption {
|
|
9186
|
+
/** 需要传递的二进制数据 */
|
|
9187
|
+
data: ArrayBuffer;
|
|
9188
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
9189
|
+
complete?: TransceiveCompleteCallback;
|
|
9190
|
+
/** 接口调用失败的回调函数 */
|
|
9191
|
+
fail?: TransceiveFailCallback;
|
|
9192
|
+
/** 接口调用成功的回调函数 */
|
|
9193
|
+
success?: NfcATransceiveSuccessCallback;
|
|
9194
|
+
}
|
|
9195
|
+
interface NfcATransceiveSuccessCallbackResult {
|
|
9196
|
+
data: ArrayBuffer;
|
|
9197
|
+
errMsg: string;
|
|
9198
|
+
}
|
|
9071
9199
|
interface NodeCallbackResult {
|
|
9072
9200
|
/** 节点对应的 Node 实例 */
|
|
9073
9201
|
node: IAnyObject;
|
|
@@ -9594,12 +9722,6 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
9594
9722
|
/** 'subpackage' 失败类型 */
|
|
9595
9723
|
type: string;
|
|
9596
9724
|
}
|
|
9597
|
-
interface OnLoadListenerResult {
|
|
9598
|
-
/** 需要基础库: `3.7.7`
|
|
9599
|
-
*
|
|
9600
|
-
* 仅小游戏支持,本次展示使用激励广告分享页 */
|
|
9601
|
-
useFallbackSharePage: boolean;
|
|
9602
|
-
}
|
|
9603
9725
|
interface OnLocalServiceFoundListenerResult {
|
|
9604
9726
|
/** 服务的 ip 地址 */
|
|
9605
9727
|
ip: string;
|
|
@@ -10082,10 +10204,6 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
10082
10204
|
/** 接口调用成功的回调函数 */
|
|
10083
10205
|
success?: OpenHKOfflinePayViewSuccessCallback;
|
|
10084
10206
|
}
|
|
10085
|
-
interface OpenInquiriesTopicFailCallbackErr {
|
|
10086
|
-
/** 错误信息 */
|
|
10087
|
-
errMsg: string;
|
|
10088
|
-
}
|
|
10089
10207
|
interface OpenInquiriesTopicOption {
|
|
10090
10208
|
/** 落地页 id,需在指定页面点击右上角三个点的「复制 ID」按钮获取 */
|
|
10091
10209
|
pageId: string;
|
|
@@ -10143,6 +10261,10 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
10143
10261
|
interface OpenMethodPickerOption {
|
|
10144
10262
|
/** 交易金额对象 */
|
|
10145
10263
|
amount: AmountOption;
|
|
10264
|
+
/** 商户单号,用于区分不同交易订单 */
|
|
10265
|
+
outTradeNo?: string;
|
|
10266
|
+
/** 商户加价规则信息,按支付方式维度的数组;不使用加价策略则无需传入 */
|
|
10267
|
+
priceRules?: IAnyObject[];
|
|
10146
10268
|
}
|
|
10147
10269
|
interface OpenOfficialAccountArticleOption {
|
|
10148
10270
|
/** 需要打开的公众号地址 */
|
|
@@ -10207,6 +10329,23 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
10207
10329
|
/** 接口调用成功的回调函数 */
|
|
10208
10330
|
success?: OpenSuccessCallback;
|
|
10209
10331
|
}
|
|
10332
|
+
interface OpenPhotoTopicViewOption {
|
|
10333
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
10334
|
+
complete?: OpenPhotoTopicViewCompleteCallback;
|
|
10335
|
+
/** 传递给贴图话题发布页参数,halfscreen表示是否以半屏打开。 */
|
|
10336
|
+
extraData?: IAnyObject;
|
|
10337
|
+
/** 接口调用失败的回调函数 */
|
|
10338
|
+
fail?: OpenPhotoTopicViewFailCallback;
|
|
10339
|
+
/** 附加的查询字符串,必须是 key1=val1&key2=val2 的格式。 */
|
|
10340
|
+
queryString?: string;
|
|
10341
|
+
/** 接口调用成功的回调函数 */
|
|
10342
|
+
success?: OpenPhotoTopicViewSuccessCallback;
|
|
10343
|
+
}
|
|
10344
|
+
interface OpenPhotoTopicViewSuccessCallbackResult {
|
|
10345
|
+
/** 贴图话题发布页返回的业务数据(结构由微信官方业务约定) */
|
|
10346
|
+
extraData: IAnyObject;
|
|
10347
|
+
errMsg: string;
|
|
10348
|
+
}
|
|
10210
10349
|
interface OpenPrivacyContractOption {
|
|
10211
10350
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
10212
10351
|
complete?: OpenPrivacyContractCompleteCallback;
|
|
@@ -10746,10 +10885,18 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
10746
10885
|
current?: number;
|
|
10747
10886
|
/** 接口调用失败的回调函数 */
|
|
10748
10887
|
fail?: PreviewMediaFailCallback;
|
|
10888
|
+
/** 需要基础库: `3.17.6`
|
|
10889
|
+
*
|
|
10890
|
+
* 是否默认静音。`true`:视频默认静音,显示静音图标;`false`:保持现有逻辑,默认有声 */
|
|
10891
|
+
muted?: boolean;
|
|
10749
10892
|
/** 需要基础库: `2.13.0`
|
|
10750
10893
|
*
|
|
10751
10894
|
* `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */
|
|
10752
10895
|
referrerPolicy?: string;
|
|
10896
|
+
/** 需要基础库: `3.17.6`
|
|
10897
|
+
*
|
|
10898
|
+
* 是否展示底部操作栏。`true`:右下角展示操作图标,包含转发、下载、更多;`false`:隐藏操作菜单 */
|
|
10899
|
+
showBottomActionBar?: boolean;
|
|
10753
10900
|
/** 需要基础库: `2.13.0`
|
|
10754
10901
|
*
|
|
10755
10902
|
* 是否显示长按菜单。 */
|
|
@@ -11006,6 +11153,16 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
11006
11153
|
success?: ReconnectCastingSuccessCallback;
|
|
11007
11154
|
}
|
|
11008
11155
|
interface RecorderManagerStartOption {
|
|
11156
|
+
/** 需要基础库: `3.17.3`
|
|
11157
|
+
*
|
|
11158
|
+
* 录音场景模式,与 audioSource 解耦,描述录音场景意图。当 audioMode 与 audioSource 同时指定时,audioMode 生效
|
|
11159
|
+
*
|
|
11160
|
+
* 可选值:
|
|
11161
|
+
* - 'default': 默认模式,无特殊处理;
|
|
11162
|
+
* - 'voiceChat': 语音通话场景,启用回声消除(AEC)、噪声抑制(NS)和自动增益(AGC);
|
|
11163
|
+
* - 'voiceRecognition': 语音识别场景,启用噪声抑制和自动增益;
|
|
11164
|
+
* - 'recording': 高保真录音场景; */
|
|
11165
|
+
audioMode?: 'default' | 'voiceChat' | 'voiceRecognition' | 'recording';
|
|
11009
11166
|
/** 需要基础库: `2.1.0`
|
|
11010
11167
|
*
|
|
11011
11168
|
* 指定录音的音频输入源,可通过 [wx.getAvailableAudioSources()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.getAvailableAudioSources.html) 获取当前可用的音频源
|
|
@@ -11234,6 +11391,16 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
11234
11391
|
/** 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/virtual-payment.html) */
|
|
11235
11392
|
signature: string;
|
|
11236
11393
|
}
|
|
11394
|
+
interface RequestAutomaticRepaymentOption {
|
|
11395
|
+
/** 预签约生成的预签约码,用于跳转签约页面;有效期10分钟 */
|
|
11396
|
+
presignToken: string;
|
|
11397
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
11398
|
+
complete?: RequestAutomaticRepaymentCompleteCallback;
|
|
11399
|
+
/** 接口调用失败的回调函数 */
|
|
11400
|
+
fail?: RequestAutomaticRepaymentFailCallback;
|
|
11401
|
+
/** 接口调用成功的回调函数 */
|
|
11402
|
+
success?: RequestAutomaticRepaymentSuccessCallback;
|
|
11403
|
+
}
|
|
11237
11404
|
interface RequestCommonPaymentFailCallbackErr {
|
|
11238
11405
|
/** 错误信息 */
|
|
11239
11406
|
errMsg: string;
|
|
@@ -11433,7 +11600,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
11433
11600
|
httpDNSServiceId?: string;
|
|
11434
11601
|
/** 需要基础库: `3.8.9`
|
|
11435
11602
|
*
|
|
11436
|
-
* HttpDNS 超时时间。HttpDNS解析时间超过该值时不再走HttpDNS,本次请求将回退到localDNS。默认为
|
|
11603
|
+
* HttpDNS 超时时间。HttpDNS解析时间超过该值时不再走HttpDNS,本次请求将回退到localDNS。默认为 10000 毫秒。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */
|
|
11437
11604
|
httpDNSTimeout?: number;
|
|
11438
11605
|
/** HTTP 请求方法
|
|
11439
11606
|
*
|
|
@@ -11915,6 +12082,22 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
|
|
|
11915
12082
|
/** 接口调用成功的回调函数 */
|
|
11916
12083
|
success?: SaveImageToPhotosAlbumSuccessCallback;
|
|
11917
12084
|
}
|
|
12085
|
+
interface SaveMediaToPhotosAlbumOption {
|
|
12086
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
12087
|
+
complete?: SaveMediaToPhotosAlbumCompleteCallback;
|
|
12088
|
+
/** 接口调用失败的回调函数 */
|
|
12089
|
+
fail?: SaveMediaToPhotosAlbumFailCallback;
|
|
12090
|
+
/** 图片或视频的路径数组,可以是临时文件路径或本地路径 */
|
|
12091
|
+
filePaths?: string[];
|
|
12092
|
+
/** 指定保存的媒体类型数组,仅支持 'image' 和 'video'
|
|
12093
|
+
*
|
|
12094
|
+
* 可选值:
|
|
12095
|
+
* - 'image': 图片;
|
|
12096
|
+
* - 'video': 视频; */
|
|
12097
|
+
mediaTypes?: Array<'image' | 'video'>;
|
|
12098
|
+
/** 接口调用成功的回调函数 */
|
|
12099
|
+
success?: SaveMediaToPhotosAlbumSuccessCallback;
|
|
12100
|
+
}
|
|
11918
12101
|
interface SaveVideoToPhotosAlbumOption {
|
|
11919
12102
|
/** 视频文件路径,可以是临时文件路径也可以是永久文件路径 (本地路径) */
|
|
11920
12103
|
filePath: string;
|
|
@@ -13996,20 +14179,6 @@ session.run({
|
|
|
13996
14179
|
* 提供基础AR功能,输出相机旋转的3个自由度的位姿,利用手机陀螺仪传感器,实现快速稳定的AR定位能力,适用于简单AR场景。 */
|
|
13997
14180
|
threeDof?: boolean;
|
|
13998
14181
|
}
|
|
13999
|
-
interface TransceiveOption {
|
|
14000
|
-
/** 需要传递的二进制数据 */
|
|
14001
|
-
data: ArrayBuffer;
|
|
14002
|
-
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
14003
|
-
complete?: TransceiveCompleteCallback;
|
|
14004
|
-
/** 接口调用失败的回调函数 */
|
|
14005
|
-
fail?: TransceiveFailCallback;
|
|
14006
|
-
/** 接口调用成功的回调函数 */
|
|
14007
|
-
success?: TransceiveSuccessCallback;
|
|
14008
|
-
}
|
|
14009
|
-
interface TransceiveSuccessCallbackResult {
|
|
14010
|
-
data: ArrayBuffer;
|
|
14011
|
-
errMsg: string;
|
|
14012
|
-
}
|
|
14013
14182
|
interface TranslateMarkerOption {
|
|
14014
14183
|
/** 移动过程中是否自动旋转 marker */
|
|
14015
14184
|
autoRotate: boolean;
|
|
@@ -15021,6 +15190,16 @@ session.run({
|
|
|
15021
15190
|
/** 宽度 */
|
|
15022
15191
|
width: number;
|
|
15023
15192
|
}
|
|
15193
|
+
interface VerifyHKPaymentPasswordOption {
|
|
15194
|
+
/** JSON字符串,加密控件所需密码版本等信息 */
|
|
15195
|
+
package: string;
|
|
15196
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
15197
|
+
complete?: VerifyHKPaymentPasswordCompleteCallback;
|
|
15198
|
+
/** 接口调用失败的回调函数 */
|
|
15199
|
+
fail?: VerifyHKPaymentPasswordFailCallback;
|
|
15200
|
+
/** 接口调用成功的回调函数 */
|
|
15201
|
+
success?: VerifyHKPaymentPasswordSuccessCallback;
|
|
15202
|
+
}
|
|
15024
15203
|
interface VibrateLongOption {
|
|
15025
15204
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
15026
15205
|
complete?: VibrateLongCompleteCallback;
|
|
@@ -18751,7 +18930,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
18751
18930
|
``` */
|
|
18752
18931
|
offLoad(
|
|
18753
18932
|
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
18754
|
-
listener?:
|
|
18933
|
+
listener?: OffLoadCallback): void;
|
|
18755
18934
|
/** [InterstitialAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onClose.html)
|
|
18756
18935
|
*
|
|
18757
18936
|
* 在插件中使用:不支持
|
|
@@ -18791,7 +18970,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
18791
18970
|
* 监听插屏广告加载事件。 */
|
|
18792
18971
|
onLoad(
|
|
18793
18972
|
/** 插屏广告加载事件的监听函数 */
|
|
18794
|
-
listener:
|
|
18973
|
+
listener: OnLoadCallback): void;
|
|
18795
18974
|
/** [Promise InterstitialAd.load()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.load.html)
|
|
18796
18975
|
*
|
|
18797
18976
|
* 需要基础库: `2.8.0`
|
|
@@ -18876,8 +19055,12 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
18876
19055
|
*
|
|
18877
19056
|
* 在插件中使用:支持
|
|
18878
19057
|
*
|
|
18879
|
-
* 发送数据
|
|
18880
|
-
|
|
19058
|
+
* 发送数据
|
|
19059
|
+
*
|
|
19060
|
+
* ****
|
|
19061
|
+
*
|
|
19062
|
+
* iOS 与安卓的成功回调返回值不同:安卓返回 `data` 为 R-data + SW1 + SW2 拼接的裸字节流;iOS 返回 `data` 仅为 R-data,状态字通过 `sw1`、`sw2` 单独返回。 */
|
|
19063
|
+
transceive(option: IsoDepTransceiveOption): void;
|
|
18881
19064
|
}
|
|
18882
19065
|
interface Join1v1ChatError {
|
|
18883
19066
|
/** 错误信息
|
|
@@ -19837,7 +20020,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
19837
20020
|
* 在插件中使用:支持
|
|
19838
20021
|
*
|
|
19839
20022
|
* 发送数据 */
|
|
19840
|
-
transceive(option:
|
|
20023
|
+
transceive(option: NfcATransceiveOption): void;
|
|
19841
20024
|
}
|
|
19842
20025
|
interface MifareUltralight {
|
|
19843
20026
|
/** [MifareUltralight.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.close.html)
|
|
@@ -19889,7 +20072,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
19889
20072
|
* 在插件中使用:支持
|
|
19890
20073
|
*
|
|
19891
20074
|
* 发送数据 */
|
|
19892
|
-
transceive(option:
|
|
20075
|
+
transceive(option: NfcATransceiveOption): void;
|
|
19893
20076
|
}
|
|
19894
20077
|
interface NFCError {
|
|
19895
20078
|
/** 错误信息
|
|
@@ -20043,7 +20226,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
20043
20226
|
* 在插件中使用:支持
|
|
20044
20227
|
*
|
|
20045
20228
|
* 发送数据 */
|
|
20046
|
-
transceive(option:
|
|
20229
|
+
transceive(option: NfcATransceiveOption): void;
|
|
20047
20230
|
}
|
|
20048
20231
|
interface NfcB {
|
|
20049
20232
|
/** [NfcB.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.close.html)
|
|
@@ -20095,7 +20278,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
20095
20278
|
* 在插件中使用:支持
|
|
20096
20279
|
*
|
|
20097
20280
|
* 发送数据 */
|
|
20098
|
-
transceive(option:
|
|
20281
|
+
transceive(option: NfcATransceiveOption): void;
|
|
20099
20282
|
}
|
|
20100
20283
|
interface NfcF {
|
|
20101
20284
|
/** [NfcF.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.close.html)
|
|
@@ -20147,7 +20330,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
20147
20330
|
* 在插件中使用:支持
|
|
20148
20331
|
*
|
|
20149
20332
|
* 发送数据 */
|
|
20150
|
-
transceive(option:
|
|
20333
|
+
transceive(option: NfcATransceiveOption): void;
|
|
20151
20334
|
}
|
|
20152
20335
|
interface NfcV {
|
|
20153
20336
|
/** [NfcV.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.close.html)
|
|
@@ -20199,7 +20382,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
20199
20382
|
* 在插件中使用:支持
|
|
20200
20383
|
*
|
|
20201
20384
|
* 发送数据 */
|
|
20202
|
-
transceive(option:
|
|
20385
|
+
transceive(option: NfcATransceiveOption): void;
|
|
20203
20386
|
}
|
|
20204
20387
|
interface Nfcrwerror {
|
|
20205
20388
|
/** 错误信息
|
|
@@ -21066,7 +21249,7 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
21066
21249
|
``` */
|
|
21067
21250
|
offLoad(
|
|
21068
21251
|
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
21069
|
-
listener?:
|
|
21252
|
+
listener?: OffLoadCallback): void;
|
|
21070
21253
|
/** [RewardedVideoAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onClose.html)
|
|
21071
21254
|
*
|
|
21072
21255
|
* 在插件中使用:不支持
|
|
@@ -21106,7 +21289,7 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对
|
|
|
21106
21289
|
* 监听激励视频广告加载事件。 */
|
|
21107
21290
|
onLoad(
|
|
21108
21291
|
/** 激励视频广告加载事件的监听函数 */
|
|
21109
|
-
listener:
|
|
21292
|
+
listener: OnLoadCallback): void;
|
|
21110
21293
|
}
|
|
21111
21294
|
interface Router {
|
|
21112
21295
|
/** [router.addRouteBuilder(string routeType, function routeBuilder)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.addRouteBuilder.html)
|
|
@@ -24639,6 +24822,28 @@ wx.connectWifi({
|
|
|
24639
24822
|
* - Android / iOS 在系统已经连上目标 wifi 的情况下,小程序再次连接目标 wifi,此时无论输入的密码是否正确,系统都会默认此次连接成功,且没有 onWifiConnected 事件。
|
|
24640
24823
|
* - onWifiConnected 事件可能会返回空对象,此时代表 wifi 断开连接,开发者可忽略这种情况。 */
|
|
24641
24824
|
connectWifi<T extends ConnectWifiOption = ConnectWifiOption>(option: T): PromisifySuccessResult<T, ConnectWifiOption>;
|
|
24825
|
+
/** [wx.copyRealname(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.copyRealname.html)
|
|
24826
|
+
*
|
|
24827
|
+
* 需要基础库: `3.17.3`
|
|
24828
|
+
*
|
|
24829
|
+
* 在插件中使用:不支持
|
|
24830
|
+
*
|
|
24831
|
+
* 实名信息查询与复制。
|
|
24832
|
+
*
|
|
24833
|
+
* **示例代码**
|
|
24834
|
+
*
|
|
24835
|
+
* ```js
|
|
24836
|
+
wx.copyRealname({
|
|
24837
|
+
extraData: { mch_id: '1230000109' },
|
|
24838
|
+
success (res) {
|
|
24839
|
+
console.log(res.extraData)
|
|
24840
|
+
},
|
|
24841
|
+
fail (err) {
|
|
24842
|
+
console.error(err)
|
|
24843
|
+
},
|
|
24844
|
+
})
|
|
24845
|
+
``` */
|
|
24846
|
+
copyRealname(option: CopyRealnameOption): void;
|
|
24642
24847
|
/** [wx.createBLEConnection(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html)
|
|
24643
24848
|
*
|
|
24644
24849
|
* 需要基础库: `1.1.0`
|
|
@@ -25750,6 +25955,14 @@ try {
|
|
|
25750
25955
|
}
|
|
25751
25956
|
``` */
|
|
25752
25957
|
getStorageInfo<T extends GetStorageInfoOption = GetStorageInfoOption>(option?: T): PromisifySuccessResult<T, GetStorageInfoOption>;
|
|
25958
|
+
/** [wx.getStoreTraceId(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/store/wx.getStoreTraceId.html)
|
|
25959
|
+
*
|
|
25960
|
+
* 需要基础库: `3.17.3`
|
|
25961
|
+
*
|
|
25962
|
+
* 在插件中使用:不支持
|
|
25963
|
+
*
|
|
25964
|
+
* 获取微信小店跟踪ID,用于电商标准化下单场景。需在创建订单前调用,调用生成订单 api 时需传入该 traceId。traceId 有效期为十分钟。 */
|
|
25965
|
+
getStoreTraceId(option?: GetStoreTraceIdOption): void;
|
|
25753
25966
|
/** [wx.getSystemInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfo.html)
|
|
25754
25967
|
*
|
|
25755
25968
|
* 在插件中使用:需要基础库 `1.9.6`
|
|
@@ -27658,7 +27871,7 @@ wx.onAccelerometerChange(callback)
|
|
|
27658
27871
|
*
|
|
27659
27872
|
* ****
|
|
27660
27873
|
*
|
|
27661
|
-
* > 新旧版本小程序组件框架的说明详见:[glass-easel:新版微信小程序组件框架](
|
|
27874
|
+
* > 新旧版本小程序组件框架的说明详见:[glass-easel:新版微信小程序组件框架](#)
|
|
27662
27875
|
*
|
|
27663
27876
|
* **示例代码**
|
|
27664
27877
|
*
|
|
@@ -28071,7 +28284,7 @@ wx.offBeforeAppRoute(func)
|
|
|
28071
28284
|
*
|
|
28072
28285
|
* ****
|
|
28073
28286
|
*
|
|
28074
|
-
* > 新旧版本小程序组件框架的说明详见:[glass-easel:新版微信小程序组件框架](
|
|
28287
|
+
* > 新旧版本小程序组件框架的说明详见:[glass-easel:新版微信小程序组件框架](#)
|
|
28075
28288
|
*
|
|
28076
28289
|
* **示例代码**
|
|
28077
28290
|
*
|
|
@@ -29263,6 +29476,32 @@ wx.openInquiriesTopic({
|
|
|
29263
29476
|
*
|
|
29264
29477
|
* 1. 跳转的公众号需与小程序为同主体或关联主体 */
|
|
29265
29478
|
openOfficialAccountProfile(option: OpenOfficialAccountProfileOption): void;
|
|
29479
|
+
/** [wx.openPhotoTopicView(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.openPhotoTopicView.html)
|
|
29480
|
+
*
|
|
29481
|
+
* 需要基础库: `3.17.0`
|
|
29482
|
+
*
|
|
29483
|
+
* 在插件中使用:不支持
|
|
29484
|
+
*
|
|
29485
|
+
* 打开微信官方贴图话题发布页。
|
|
29486
|
+
*
|
|
29487
|
+
* **示例代码**
|
|
29488
|
+
*
|
|
29489
|
+
* ```js
|
|
29490
|
+
wx.openPhotoTopicView({
|
|
29491
|
+
queryString: 'topic=xxx', // 话题名称
|
|
29492
|
+
extraData: {
|
|
29493
|
+
// 由目标业务约定的字段
|
|
29494
|
+
halfscreen: true,
|
|
29495
|
+
},
|
|
29496
|
+
success(res) {
|
|
29497
|
+
console.log(res)
|
|
29498
|
+
},
|
|
29499
|
+
fail(err) {
|
|
29500
|
+
console.error(err)
|
|
29501
|
+
},
|
|
29502
|
+
})
|
|
29503
|
+
``` */
|
|
29504
|
+
openPhotoTopicView(option: OpenPhotoTopicViewOption): void;
|
|
29266
29505
|
/** [wx.openPrivacyContract(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.openPrivacyContract.html)
|
|
29267
29506
|
*
|
|
29268
29507
|
* 需要基础库: `2.32.3`
|
|
@@ -29905,6 +30144,28 @@ wx.reportPerformance(1101, 680, 'custom')
|
|
|
29905
30144
|
*
|
|
29906
30145
|
* 发起苹果订阅签约 */
|
|
29907
30146
|
requestAppleSubscribeSign(option: RequestAppleSubscribeSignOption): void;
|
|
30147
|
+
/** [wx.requestAutomaticRepayment(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.requestAutomaticRepayment.html)
|
|
30148
|
+
*
|
|
30149
|
+
* 需要基础库: `3.17.1`
|
|
30150
|
+
*
|
|
30151
|
+
* 在插件中使用:不支持
|
|
30152
|
+
*
|
|
30153
|
+
* 在微信客户端通过小程序拉起页面请求用户确认签约自动还款。调用前需在微信支付合作伙伴平台申请开通「服务商自动还款」。
|
|
30154
|
+
*
|
|
30155
|
+
* **示例代码**
|
|
30156
|
+
*
|
|
30157
|
+
* ```js
|
|
30158
|
+
wx.requestAutomaticRepayment({
|
|
30159
|
+
presignToken: 'xxxxx',
|
|
30160
|
+
success: res => {
|
|
30161
|
+
|
|
30162
|
+
},
|
|
30163
|
+
fail: res => {
|
|
30164
|
+
|
|
30165
|
+
}
|
|
30166
|
+
})
|
|
30167
|
+
``` */
|
|
30168
|
+
requestAutomaticRepayment(option: RequestAutomaticRepaymentOption): void;
|
|
29908
30169
|
/** [wx.requestCommonPayment(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestCommonPayment.html)
|
|
29909
30170
|
*
|
|
29910
30171
|
* 需要基础库: `2.19.2`
|
|
@@ -30026,13 +30287,19 @@ wx.requestFacialVerify({
|
|
|
30026
30287
|
*
|
|
30027
30288
|
* 在插件中使用:不支持
|
|
30028
30289
|
*
|
|
30029
|
-
*
|
|
30290
|
+
* 注册一个函数,将在空闲时期被调用。部分场景下回调可能同步执行,详见注意事项。
|
|
30030
30291
|
*
|
|
30031
|
-
*
|
|
30292
|
+
* **注意事项</title>
|
|
30293
|
+
* 1. 本接口不保证回调始终异步执行。小程序进入后台后,为避免后续任务因运行环境挂起而无法执行,回调可能在本次 `wx.requestIdleCallback` 调用返回前同步执行。
|
|
30294
|
+
* 2. 回调依赖的变量和状态应在调用本接口前完成初始化,调用方需兼容同步和异步两种执行时序。
|
|
30295
|
+
*
|
|
30296
|
+
* <title>示例代码**
|
|
30032
30297
|
*
|
|
30033
30298
|
* ```js
|
|
30299
|
+
// 回调依赖的变量应在注册前初始化。
|
|
30300
|
+
const message = 'idle'
|
|
30034
30301
|
const IdleCallbackId = wx.requestIdleCallback(() => {
|
|
30035
|
-
console.log(
|
|
30302
|
+
console.log(message)
|
|
30036
30303
|
}, {
|
|
30037
30304
|
timeout: 3000
|
|
30038
30305
|
})
|
|
@@ -30522,6 +30789,26 @@ wx.saveImageToPhotosAlbum({
|
|
|
30522
30789
|
})
|
|
30523
30790
|
``` */
|
|
30524
30791
|
saveImageToPhotosAlbum<T extends SaveImageToPhotosAlbumOption = SaveImageToPhotosAlbumOption>(option: T): PromisifySuccessResult<T, SaveImageToPhotosAlbumOption>;
|
|
30792
|
+
/** [wx.saveMediaToPhotosAlbum(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.saveMediaToPhotosAlbum.html)
|
|
30793
|
+
*
|
|
30794
|
+
* 需要基础库: `3.17.2`
|
|
30795
|
+
*
|
|
30796
|
+
* 在插件中使用:需要基础库 `3.17.2`
|
|
30797
|
+
*
|
|
30798
|
+
* 保存图片或视频到系统相册。支持同时保存图片或视频。其中视频支持 mp4 视频格式。
|
|
30799
|
+
*
|
|
30800
|
+
* **示例代码**
|
|
30801
|
+
*
|
|
30802
|
+
* ```js
|
|
30803
|
+
wx.saveMediaToPhotosAlbum({
|
|
30804
|
+
filePaths: ['wxfile://xxx'],
|
|
30805
|
+
mediaTypes: ['image', 'video'],
|
|
30806
|
+
success (res) {
|
|
30807
|
+
console.log(res.errMsg)
|
|
30808
|
+
}
|
|
30809
|
+
})
|
|
30810
|
+
``` */
|
|
30811
|
+
saveMediaToPhotosAlbum<T extends SaveMediaToPhotosAlbumOption = SaveMediaToPhotosAlbumOption>(option: T): PromisifySuccessResult<T, SaveMediaToPhotosAlbumOption>;
|
|
30525
30812
|
/** [wx.saveVideoToPhotosAlbum(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.saveVideoToPhotosAlbum.html)
|
|
30526
30813
|
*
|
|
30527
30814
|
* 需要基础库: `1.2.0`
|
|
@@ -31907,6 +32194,38 @@ wx.updateShareMenu({
|
|
|
31907
32194
|
*
|
|
31908
32195
|
* 更新客户端版本。当判断用户小程序所在客户端版本过低时,可使用该接口跳转到更新微信页面。 */
|
|
31909
32196
|
updateWeChatApp<T extends UpdateWeChatAppOption = UpdateWeChatAppOption>(option?: T): PromisifySuccessResult<T, UpdateWeChatAppOption>;
|
|
32197
|
+
/** [wx.verifyHKPaymentPassword(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.verifyHKPaymentPassword.html)
|
|
32198
|
+
*
|
|
32199
|
+
* 需要基础库: `3.17.4`
|
|
32200
|
+
*
|
|
32201
|
+
* 在插件中使用:不支持
|
|
32202
|
+
*
|
|
32203
|
+
* 拉起WeChat Pay HK密码验证组件。
|
|
32204
|
+
*
|
|
32205
|
+
* 接入步骤:
|
|
32206
|
+
* 1. 商户需已经开通微信港币钱包WeChat Pay HK的支付权限,
|
|
32207
|
+
* 2. 请用商户在微信支付入驻时预留的邮箱,发起邮件申请接入权限:
|
|
32208
|
+
* - 【收件人】hkpayment@wechat.com
|
|
32209
|
+
* - 【邮件主题】申请接入验证WeChat Pay HK密码验证+商户名称:***+商户号:***
|
|
32210
|
+
* - 【邮件内容】因XXX原因(原因请按实际情况填写,不合理的原因将被驳回),需申请拉起WeChat Pay HK密码验证组件,申请材料如下:
|
|
32211
|
+
* - 商户名称
|
|
32212
|
+
* - 商户号
|
|
32213
|
+
* - 申请调用的小程序名称
|
|
32214
|
+
* - 申请调用的小程序APPID
|
|
32215
|
+
* - 商户资质材料扫描件或照片(CI,BR任一),所有材料均需清晰,且有盖章
|
|
32216
|
+
* - 拉起WeChat Pay HK密码验证的场景说明:需有文字和示意图说明
|
|
32217
|
+
* - 商户联系方式:邮件***,联系电话***
|
|
32218
|
+
*
|
|
32219
|
+
* **示例代码**
|
|
32220
|
+
*
|
|
32221
|
+
* ```js
|
|
32222
|
+
wx.verifyHKPaymentPassword({
|
|
32223
|
+
package: '',
|
|
32224
|
+
success (res) { },
|
|
32225
|
+
fail (res) { }
|
|
32226
|
+
})
|
|
32227
|
+
``` */
|
|
32228
|
+
verifyHKPaymentPassword(option: VerifyHKPaymentPasswordOption): void;
|
|
31910
32229
|
/** [wx.vibrateLong(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateLong.html)
|
|
31911
32230
|
*
|
|
31912
32231
|
* 需要基础库: `1.2.0`
|
|
@@ -32400,6 +32719,12 @@ wx.writeBLECharacteristicValue({
|
|
|
32400
32719
|
/** 接口调用成功的回调函数 */
|
|
32401
32720
|
type CopyFileSuccessCallback = (res: FileError) => void;
|
|
32402
32721
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
32722
|
+
type CopyRealnameCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
32723
|
+
/** 接口调用失败的回调函数 */
|
|
32724
|
+
type CopyRealnameFailCallback = (err: CopyRealnameFailCallbackErr) => void;
|
|
32725
|
+
/** 接口调用成功的回调函数 */
|
|
32726
|
+
type CopyRealnameSuccessCallback = (result: CopyRealnameSuccessCallbackResult) => void;
|
|
32727
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
32403
32728
|
type CreateBLEConnectionCompleteCallback = (res: BluetoothError) => void;
|
|
32404
32729
|
/** 接口调用失败的回调函数 */
|
|
32405
32730
|
type CreateBLEConnectionFailCallback = (res: BluetoothError) => void;
|
|
@@ -32930,6 +33255,12 @@ wx.writeBLECharacteristicValue({
|
|
|
32930
33255
|
/** 接口调用成功的回调函数 */
|
|
32931
33256
|
type GetStorageSuccessCallback<T = any> = (result: GetStorageSuccessCallbackResult<T>) => void;
|
|
32932
33257
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33258
|
+
type GetStoreTraceIdCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
33259
|
+
/** 接口调用失败的回调函数 */
|
|
33260
|
+
type GetStoreTraceIdFailCallback = (res: GeneralCallbackResult) => void;
|
|
33261
|
+
/** 接口调用成功的回调函数 */
|
|
33262
|
+
type GetStoreTraceIdSuccessCallback = (result: GetStoreTraceIdSuccessCallbackResult) => void;
|
|
33263
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
32933
33264
|
type GetSystemInfoAsyncCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
32934
33265
|
/** 接口调用失败的回调函数 */
|
|
32935
33266
|
type GetSystemInfoAsyncFailCallback = (res: GeneralCallbackResult) => void;
|
|
@@ -33089,12 +33420,8 @@ wx.writeBLECharacteristicValue({
|
|
|
33089
33420
|
type IntersectionObserverObserveCallback = (result: IntersectionObserverObserveCallbackResult) => void;
|
|
33090
33421
|
/** onError 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
33091
33422
|
type InterstitialAdOffErrorCallback = (result: InterstitialAdOnErrorListenerResult) => void;
|
|
33092
|
-
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
33093
|
-
type InterstitialAdOffLoadCallback = (res: GeneralCallbackResult) => void;
|
|
33094
33423
|
/** 插屏错误事件的监听函数 */
|
|
33095
33424
|
type InterstitialAdOnErrorCallback = (result: InterstitialAdOnErrorListenerResult) => void;
|
|
33096
|
-
/** 插屏广告加载事件的监听函数 */
|
|
33097
|
-
type InterstitialAdOnLoadCallback = (res: GeneralCallbackResult) => void;
|
|
33098
33425
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33099
33426
|
type IsBluetoothDevicePairedCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
33100
33427
|
/** 接口调用失败的回调函数 */
|
|
@@ -33107,6 +33434,8 @@ wx.writeBLECharacteristicValue({
|
|
|
33107
33434
|
type IsConnectedFailCallback = (res: Nfcrwerror) => void;
|
|
33108
33435
|
/** 接口调用成功的回调函数 */
|
|
33109
33436
|
type IsConnectedSuccessCallback = (res: Nfcrwerror) => void;
|
|
33437
|
+
/** 接口调用成功的回调函数 */
|
|
33438
|
+
type IsoDepTransceiveSuccessCallback = (result: IsoDepTransceiveSuccessCallbackResult) => void;
|
|
33110
33439
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33111
33440
|
type IssueTransitCardCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
33112
33441
|
/** 接口调用失败的回调函数 */
|
|
@@ -33223,6 +33552,8 @@ wx.writeBLECharacteristicValue({
|
|
|
33223
33552
|
type NdefCloseFailCallback = (res: Nfcrwerror) => void;
|
|
33224
33553
|
/** 接口调用成功的回调函数 */
|
|
33225
33554
|
type NdefCloseSuccessCallback = (res: Nfcrwerror) => void;
|
|
33555
|
+
/** 接口调用成功的回调函数 */
|
|
33556
|
+
type NfcATransceiveSuccessCallback = (result: NfcATransceiveSuccessCallbackResult) => void;
|
|
33226
33557
|
/** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */
|
|
33227
33558
|
type NodeCallback = (result: NodeCallbackResult) => void;
|
|
33228
33559
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -33313,6 +33644,8 @@ wx.writeBLECharacteristicValue({
|
|
|
33313
33644
|
type OffLazyLoadErrorCallback = (result: OnLazyLoadErrorListenerResult) => void;
|
|
33314
33645
|
/** onListening 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
33315
33646
|
type OffListeningCallback = (res: GeneralCallbackResult) => void;
|
|
33647
|
+
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
33648
|
+
type OffLoadCallback = (res: GeneralCallbackResult) => void;
|
|
33316
33649
|
/** onLocalServiceDiscoveryStop 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
33317
33650
|
type OffLocalServiceDiscoveryStopCallback = (res: GeneralCallbackResult) => void;
|
|
33318
33651
|
/** onLocalServiceFound 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
@@ -33487,6 +33820,7 @@ wx.writeBLECharacteristicValue({
|
|
|
33487
33820
|
type OnLazyLoadErrorCallback = (result: OnLazyLoadErrorListenerResult) => void;
|
|
33488
33821
|
/** 开始监听数据包消息的事件的监听函数 */
|
|
33489
33822
|
type OnListeningCallback = (res: GeneralCallbackResult) => void;
|
|
33823
|
+
type OnLoadCallback = (res: GeneralCallbackResult) => void;
|
|
33490
33824
|
/** mDNS 服务停止搜索的事件的监听函数 */
|
|
33491
33825
|
type OnLocalServiceDiscoveryStopCallback = (res: GeneralCallbackResult) => void;
|
|
33492
33826
|
/** mDNS 服务发现的事件的监听函数 */
|
|
@@ -33661,7 +33995,7 @@ wx.writeBLECharacteristicValue({
|
|
|
33661
33995
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33662
33996
|
type OpenInquiriesTopicCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
33663
33997
|
/** 接口调用失败的回调函数 */
|
|
33664
|
-
type OpenInquiriesTopicFailCallback = (err:
|
|
33998
|
+
type OpenInquiriesTopicFailCallback = (err: CopyRealnameFailCallbackErr) => void;
|
|
33665
33999
|
/** 接口调用成功的回调函数 */
|
|
33666
34000
|
type OpenInquiriesTopicSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
33667
34001
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -33695,6 +34029,12 @@ wx.writeBLECharacteristicValue({
|
|
|
33695
34029
|
/** 接口调用成功的回调函数 */
|
|
33696
34030
|
type OpenOfficialAccountProfileSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
33697
34031
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34032
|
+
type OpenPhotoTopicViewCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34033
|
+
/** 接口调用失败的回调函数 */
|
|
34034
|
+
type OpenPhotoTopicViewFailCallback = (err: CopyRealnameFailCallbackErr) => void;
|
|
34035
|
+
/** 接口调用成功的回调函数 */
|
|
34036
|
+
type OpenPhotoTopicViewSuccessCallback = (result: OpenPhotoTopicViewSuccessCallbackResult) => void;
|
|
34037
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33698
34038
|
type OpenPrivacyContractCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
33699
34039
|
/** 接口调用失败的回调函数 */
|
|
33700
34040
|
type OpenPrivacyContractFailCallback = (res: GeneralCallbackResult) => void;
|
|
@@ -33997,6 +34337,12 @@ wx.writeBLECharacteristicValue({
|
|
|
33997
34337
|
/** 接口调用成功的回调函数 */
|
|
33998
34338
|
type RenameSuccessCallback = (res: FileError) => void;
|
|
33999
34339
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34340
|
+
type RequestAutomaticRepaymentCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34341
|
+
/** 接口调用失败的回调函数 */
|
|
34342
|
+
type RequestAutomaticRepaymentFailCallback = (err: CopyRealnameFailCallbackErr) => void;
|
|
34343
|
+
/** 接口调用成功的回调函数 */
|
|
34344
|
+
type RequestAutomaticRepaymentSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
34345
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34000
34346
|
type RequestCommonPaymentCompleteCallback = (res: CommonPaymentError) => void;
|
|
34001
34347
|
/** 接口调用失败的回调函数 */
|
|
34002
34348
|
type RequestCommonPaymentFailCallback = (err: RequestCommonPaymentFailCallbackErr) => void;
|
|
@@ -34112,14 +34458,10 @@ wx.writeBLECharacteristicValue({
|
|
|
34112
34458
|
type RewardedVideoAdOffCloseCallback = (result: RewardedVideoAdOnCloseListenerResult) => void;
|
|
34113
34459
|
/** onError 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
34114
34460
|
type RewardedVideoAdOffErrorCallback = (result: RewardedVideoAdOnErrorListenerResult) => void;
|
|
34115
|
-
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
|
|
34116
|
-
type RewardedVideoAdOffLoadCallback = (result: OnLoadListenerResult) => void;
|
|
34117
34461
|
/** 用户点击 `关闭广告` 按钮的事件的监听函数 */
|
|
34118
34462
|
type RewardedVideoAdOnCloseCallback = (result: RewardedVideoAdOnCloseListenerResult) => void;
|
|
34119
34463
|
/** 激励视频错误事件的监听函数 */
|
|
34120
34464
|
type RewardedVideoAdOnErrorCallback = (result: RewardedVideoAdOnErrorListenerResult) => void;
|
|
34121
|
-
/** 激励视频广告加载事件的监听函数 */
|
|
34122
|
-
type RewardedVideoAdOnLoadCallback = (result: OnLoadListenerResult) => void;
|
|
34123
34465
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34124
34466
|
type RewriteRouteCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34125
34467
|
/** 接口调用失败的回调函数 */
|
|
@@ -34151,6 +34493,12 @@ wx.writeBLECharacteristicValue({
|
|
|
34151
34493
|
/** 接口调用成功的回调函数 */
|
|
34152
34494
|
type SaveImageToPhotosAlbumSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
34153
34495
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34496
|
+
type SaveMediaToPhotosAlbumCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34497
|
+
/** 接口调用失败的回调函数 */
|
|
34498
|
+
type SaveMediaToPhotosAlbumFailCallback = (res: GeneralCallbackResult) => void;
|
|
34499
|
+
/** 接口调用成功的回调函数 */
|
|
34500
|
+
type SaveMediaToPhotosAlbumSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
34501
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34154
34502
|
type SaveVideoToPhotosAlbumCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34155
34503
|
/** 接口调用失败的回调函数 */
|
|
34156
34504
|
type SaveVideoToPhotosAlbumFailCallback = (res: GeneralCallbackResult) => void;
|
|
@@ -34800,8 +35148,6 @@ wx.writeBLECharacteristicValue({
|
|
|
34800
35148
|
type TransceiveCompleteCallback = (res: Nfcrwerror) => void;
|
|
34801
35149
|
/** 接口调用失败的回调函数 */
|
|
34802
35150
|
type TransceiveFailCallback = (res: Nfcrwerror) => void;
|
|
34803
|
-
/** 接口调用成功的回调函数 */
|
|
34804
|
-
type TransceiveSuccessCallback = (result: TransceiveSuccessCallbackResult) => void;
|
|
34805
35151
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34806
35152
|
type TranslateMarkerCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34807
35153
|
/** 接口调用失败的回调函数 */
|
|
@@ -34900,6 +35246,12 @@ wx.writeBLECharacteristicValue({
|
|
|
34900
35246
|
* - 2003002: 未开启小程序相机权限; */
|
|
34901
35247
|
status: 0 | 104 | 112 | 1025 | 1026 | 2000001 | 2003000 | 2000000 | 2000002 | 2000003 | 2000004 | 2003001 | 2003002) => void;
|
|
34902
35248
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
35249
|
+
type VerifyHKPaymentPasswordCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
35250
|
+
/** 接口调用失败的回调函数 */
|
|
35251
|
+
type VerifyHKPaymentPasswordFailCallback = (res: GeneralCallbackResult) => void;
|
|
35252
|
+
/** 接口调用成功的回调函数 */
|
|
35253
|
+
type VerifyHKPaymentPasswordSuccessCallback = (res: GeneralCallbackResult) => void;
|
|
35254
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
34903
35255
|
type VibrateLongCompleteCallback = (res: GeneralCallbackResult) => void;
|
|
34904
35256
|
/** 接口调用失败的回调函数 */
|
|
34905
35257
|
type VibrateLongFailCallback = (res: GeneralCallbackResult) => void;
|
|
@@ -37283,7 +37635,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37283
37635
|
}
|
|
37284
37636
|
type TypeSignature<TData extends DataOption, TProperty extends PropertyOption, TMethod extends MethodOption> = globalThis.WechatMiniprogram.Component.Constructor extends ((...args: any[]) => any) ? globalThis.WechatMiniprogram.Component.TypeSignature<TData, TProperty, TMethod> : ScopedTypeSignature<TData, TProperty, TMethod>;
|
|
37285
37637
|
interface Behavior<B extends BehaviorOption> {
|
|
37286
|
-
/** 类似于mixins和traits的组件间代码复用机制,参见 [behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
37638
|
+
/** 类似于 mixins 和 traits 的组件间代码复用机制,参见 [使用 behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/behaviors.html#使用-behaviors) */
|
|
37287
37639
|
behaviors?: B;
|
|
37288
37640
|
}
|
|
37289
37641
|
interface Data<D extends DataOption> {
|
|
@@ -37295,25 +37647,29 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37295
37647
|
properties: P;
|
|
37296
37648
|
}
|
|
37297
37649
|
interface Method<M extends MethodOption, TIsPage extends boolean = false> {
|
|
37298
|
-
/** 组件的方法,包括事件响应函数和任意的自定义方法,关于事件响应函数的使用,参见 [
|
|
37650
|
+
/** 组件的方法,包括事件响应函数和任意的自定义方法,关于事件响应函数的使用,参见 [触发与监听事件](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/event-system.html#监听事件) */
|
|
37299
37651
|
methods: M & (TIsPage extends true ? Partial<Page.ILifetime> : {});
|
|
37300
37652
|
}
|
|
37301
37653
|
type Satisfy<T, V> = V extends T ? V : T;
|
|
37302
|
-
type PropertyType = StringConstructor | NumberConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | null;
|
|
37303
|
-
type ValueType<T extends PropertyType> = T extends null ? any : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? any[] : T extends ObjectConstructor ? IAnyObject : never;
|
|
37654
|
+
type PropertyType = StringConstructor | NumberConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | FunctionConstructor | null;
|
|
37655
|
+
type ValueType<T extends PropertyType> = T extends null ? any : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? any[] : T extends ObjectConstructor ? IAnyObject : T extends FunctionConstructor ? (...args: any[]) => any : never;
|
|
37304
37656
|
type SimpleValueType<T extends PropertyType, V> = T extends null ? V : T extends StringConstructor ? Satisfy<string, V> : T extends NumberConstructor ? Satisfy<number, V> : T extends BooleanConstructor ? Satisfy<boolean, V> : T extends ArrayConstructor ? Satisfy<any[], V> : T extends ObjectConstructor ? Satisfy<Record<string, any> | null, V> : T extends FunctionConstructor ? Satisfy<(...args: any[]) => any, V> : never;
|
|
37305
37657
|
type FullProperty<T extends PropertyType, V extends ValueType<T>> = {
|
|
37306
37658
|
/** 属性类型 */
|
|
37307
37659
|
type: T;
|
|
37308
37660
|
/** 属性初始值 */
|
|
37309
37661
|
value?: V;
|
|
37310
|
-
/**
|
|
37311
|
-
|
|
37662
|
+
/** 属性默认值,属性未被指定或收到非法值时用于代替,与 `value` 互斥。仅 glass-easel 组件框架支持,参见 [初始值和默认值](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/properties.html#初始值和默认值) */
|
|
37663
|
+
default?: () => V;
|
|
37664
|
+
/** 属性值比较函数,返回真表示属性值变化了、组件需要更新。仅 glass-easel 组件框架支持,参见 [属性值比较器](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/properties.html#属性值比较器) */
|
|
37665
|
+
comparer?: (newValue: ValueType<T>, oldValue: ValueType<T>) => boolean;
|
|
37666
|
+
/** 属性值被更改时的响应函数。`changedPath` 仅经典组件框架(exparser)提供,参见 [属性值变化监听器](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/properties.html#属性值变化监听器) */
|
|
37667
|
+
observer?: string | ((newVal: ValueType<T>, oldVal: ValueType<T>, changedPath?: Array<string | number>) => void);
|
|
37312
37668
|
/** 属性的类型(可以指定多个) */
|
|
37313
37669
|
optionalTypes?: ShortProperty[];
|
|
37314
37670
|
};
|
|
37315
|
-
type AllFullProperty = FullProperty<StringConstructor, any> | FullProperty<NumberConstructor, any> | FullProperty<BooleanConstructor, any> | FullProperty<ArrayConstructor, any> | FullProperty<ObjectConstructor, any> | FullProperty<null, any>;
|
|
37316
|
-
type ShortProperty = StringConstructor | NumberConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | null;
|
|
37671
|
+
type AllFullProperty = FullProperty<StringConstructor, any> | FullProperty<NumberConstructor, any> | FullProperty<BooleanConstructor, any> | FullProperty<ArrayConstructor, any> | FullProperty<ObjectConstructor, any> | FullProperty<FunctionConstructor, any> | FullProperty<null, any>;
|
|
37672
|
+
type ShortProperty = StringConstructor | NumberConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | FunctionConstructor | null;
|
|
37317
37673
|
type AllProperty = AllFullProperty | ShortProperty;
|
|
37318
37674
|
type PropertyToData<T extends AllProperty> = T extends ShortProperty ? ValueType<T> : FullPropertyToData<Exclude<T, ShortProperty>>;
|
|
37319
37675
|
type FullPropertyToData<T> = T extends FullProperty<infer T, infer V> ? unknown extends V ? ValueType<T> : ((a: T) => void) extends ((a: PropertyType) => void) ? V : V extends ValueType<T> ? SimpleValueType<T, V> : never : never;
|
|
@@ -37342,15 +37698,17 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37342
37698
|
renderer: 'webview' | 'skyline';
|
|
37343
37699
|
}
|
|
37344
37700
|
interface InstanceMethods<D extends DataOption> {
|
|
37345
|
-
/** `setData`
|
|
37346
|
-
|
|
37701
|
+
/** `setData` 函数用于将数据从逻辑层发送到视图层,同时改变对应的 `this.data` 的值。
|
|
37702
|
+
*
|
|
37703
|
+
* 对 WXML 模板的更新是同步的(在数据监听器内被调用时除外,此时相当于 `updateData`)。
|
|
37347
37704
|
*
|
|
37348
37705
|
* **注意:**
|
|
37349
37706
|
*
|
|
37350
37707
|
* 1. **直接修改 this.data 而不调用 this.setData 是无法改变页面的状态的,还会造成数据不一致**。
|
|
37351
37708
|
* 1. 仅支持设置可 JSON 化的数据。
|
|
37352
|
-
* 1. 单次设置的数据不能超过1024kB,请尽量避免一次设置过多的数据。
|
|
37353
37709
|
* 1. 请不要把 data 中任何一项的 value 设为 `undefined` ,否则这一项将不被设置并可能遗留一些潜在问题。
|
|
37710
|
+
*
|
|
37711
|
+
* 参见 [使用 setData 更新数据](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-updates.html#使用-setData-更新数据)
|
|
37354
37712
|
*/
|
|
37355
37713
|
setData(
|
|
37356
37714
|
/** 这次要改变的数据
|
|
@@ -37360,10 +37718,19 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37360
37718
|
* 其中 `key` 可以以数据路径的形式给出,支持改变数组中的某一项或对象的某个属性,如 `array[2].message`,`a.b.c.d`,并且不需要在 this.data 中预先定义。
|
|
37361
37719
|
*/
|
|
37362
37720
|
data: Partial<D> & IAnyObject,
|
|
37363
|
-
/** setData
|
|
37721
|
+
/** setData 引起的界面更新完成后回调,这个回调时机偏晚,滥用可能影响性能,请谨慎使用
|
|
37722
|
+
*
|
|
37723
|
+
* 最低基础库版本:[`1.5.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37724
|
+
*/
|
|
37364
37725
|
callback?: () => void): void;
|
|
37365
|
-
/**
|
|
37366
|
-
|
|
37726
|
+
/**
|
|
37727
|
+
* 在指定数据路径上更新数据,需再调用 `applyDataUpdates` 才会应用到 WXML 模板,参见 [高级路径更新](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-updates.html#高级路径更新)
|
|
37728
|
+
*/
|
|
37729
|
+
replaceDataOnPath(path: Array<string | number>, data: any): void;
|
|
37730
|
+
/** 将 `replaceDataOnPath` 产生的更新应用到 WXML 模板,参见 [高级路径更新](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-updates.html#高级路径更新) */
|
|
37731
|
+
applyDataUpdates(): void;
|
|
37732
|
+
/** 检查组件是否具有 `behavior` (检查时会递归检查被直接或间接引入的所有 behavior) */
|
|
37733
|
+
hasBehavior(behavior: Behavior.Identifier): boolean;
|
|
37367
37734
|
/** 触发事件,参见组件事件 */
|
|
37368
37735
|
triggerEvent<DetailType = any>(name: string, detail?: DetailType, options?: TriggerEventOption): void;
|
|
37369
37736
|
/** 创建一个 SelectorQuery 对象,选择器选取范围为这个组件实例内 */
|
|
@@ -37372,30 +37739,36 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37372
37739
|
createIntersectionObserver(options: CreateIntersectionObserverOption): IntersectionObserver;
|
|
37373
37740
|
/** 创建一个 MediaQueryObserver 对象 */
|
|
37374
37741
|
createMediaQueryObserver(): MediaQueryObserver;
|
|
37375
|
-
/**
|
|
37376
|
-
selectComponent(selector: string): TrivialInstance;
|
|
37377
|
-
/**
|
|
37742
|
+
/** 使用选择器选择组件实例节点,返回匹配到的第一个组件实例对象,未匹配到时返回 `null` ,参见 [获取子组件实例](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/component-tree-visit.html#获取子组件实例) */
|
|
37743
|
+
selectComponent(selector: string): TrivialInstance | null;
|
|
37744
|
+
/** 使用选择器选择组件实例节点,返回匹配到的全部组件实例对象组成的数组,参见 [获取子组件实例](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/component-tree-visit.html#获取子组件实例) */
|
|
37378
37745
|
selectAllComponents(selector: string): TrivialInstance[];
|
|
37379
37746
|
/**
|
|
37380
|
-
*
|
|
37747
|
+
* 选取当前组件节点所在的组件实例(即组件的引用者),返回它的组件实例对象,对于页面根组件将返回 `null` ,参见 [获取父组件实例](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/component-tree-visit.html#获取父组件实例)
|
|
37381
37748
|
*
|
|
37382
37749
|
* 最低基础库版本:[`2.8.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37383
37750
|
**/
|
|
37384
|
-
selectOwnerComponent(): TrivialInstance;
|
|
37385
|
-
/** 获取这个关系所对应的所有关联节点,参见 组件间关系 */
|
|
37751
|
+
selectOwnerComponent(): TrivialInstance | null;
|
|
37752
|
+
/** 获取这个关系所对应的所有关联节点,参见 [组件间关系](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/relations.html) */
|
|
37386
37753
|
getRelationNodes(relationKey: string): TrivialInstance[];
|
|
37387
37754
|
/**
|
|
37388
|
-
*
|
|
37755
|
+
* 将 callback 中的多个 `setData` 组合起来,避免展示界面中间状态,参见 [使用 groupSetData 连续更新](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-updates.html#使用-groupSetData-连续更新)
|
|
37389
37756
|
*
|
|
37390
37757
|
* 最低基础库版本:[`2.4.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37391
37758
|
**/
|
|
37392
37759
|
groupSetData(callback?: () => void): void;
|
|
37393
37760
|
/**
|
|
37394
|
-
* 返回当前页面的 custom-tab-bar
|
|
37761
|
+
* 返回当前页面的 custom-tab-bar 的组件实例。
|
|
37762
|
+
*
|
|
37763
|
+
* 调用时实例已创建就返回该实例,否则返回 `null`(不论是否传入 `callback`)。
|
|
37764
|
+
*
|
|
37765
|
+
* 当传入 `callback` 时,若已有实例则同步回调;若未创建实例,exparser 下会等到实例创建完成后异步回调;glass-easel 下不会回调。
|
|
37766
|
+
*
|
|
37767
|
+
* 参见 [getTabBar 回调函数](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html#_2-getTabBar-回调函数)
|
|
37395
37768
|
*
|
|
37396
37769
|
* 最低基础库版本:[`2.6.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37397
37770
|
**/
|
|
37398
|
-
getTabBar(): TrivialInstance;
|
|
37771
|
+
getTabBar(callback?: (tabBar: TrivialInstance) => void): TrivialInstance | null;
|
|
37399
37772
|
/**
|
|
37400
37773
|
* 返回页面标识符(一个字符串),可以用来判断几个自定义组件实例是不是在同一个页面内
|
|
37401
37774
|
*
|
|
@@ -37419,7 +37792,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37419
37792
|
*
|
|
37420
37793
|
* 最低基础库版本:[`2.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37421
37794
|
**/
|
|
37422
|
-
clearAnimation(selector: string, callback
|
|
37795
|
+
clearAnimation(selector: string, callback?: () => void): void;
|
|
37423
37796
|
/**
|
|
37424
37797
|
* 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html)
|
|
37425
37798
|
*
|
|
@@ -37427,7 +37800,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37427
37800
|
**/
|
|
37428
37801
|
clearAnimation(selector: string, options?: ClearAnimationOptions, callback?: () => void): void;
|
|
37429
37802
|
/**
|
|
37430
|
-
*
|
|
37803
|
+
* 当从另一页面跳转到该页面时,获得与来源页面实例通信的事件通道,参见 [wx.navigateTo](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html)
|
|
37431
37804
|
*
|
|
37432
37805
|
* 最低基础库版本:[`2.7.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37433
37806
|
*/
|
|
@@ -37438,8 +37811,8 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37438
37811
|
* 最低基础库版本:[`2.29.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37439
37812
|
*/
|
|
37440
37813
|
applyAnimatedStyle(selector: string, updater: () => Record<string, string>, userConfig?: {
|
|
37441
|
-
immediate
|
|
37442
|
-
flush
|
|
37814
|
+
immediate?: boolean;
|
|
37815
|
+
flush?: 'sync' | 'async';
|
|
37443
37816
|
}, callback?: (res: {
|
|
37444
37817
|
styleId: number;
|
|
37445
37818
|
}) => void): void;
|
|
@@ -37450,20 +37823,20 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37450
37823
|
*/
|
|
37451
37824
|
clearAnimatedStyle(selector: string, styleIds: number[], callback?: () => void): void;
|
|
37452
37825
|
/**
|
|
37453
|
-
* 获取更新性能统计信息,详见 [获取更新性能统计信息](
|
|
37826
|
+
* 获取更新性能统计信息,详见 [获取更新性能统计信息](https://developers.weixin.qq.com/miniprogram/dev/framework/update-perf-stat.html)
|
|
37454
37827
|
*
|
|
37455
37828
|
*
|
|
37456
37829
|
* 最低基础库版本:[`2.12.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37457
37830
|
*/
|
|
37458
37831
|
setUpdatePerformanceListener<WithDataPath extends boolean = false>(options: SetUpdatePerformanceListenerOption<WithDataPath>, callback?: UpdatePerformanceListener<WithDataPath>): void;
|
|
37459
37832
|
/**
|
|
37460
|
-
* 在运行时获取页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent](
|
|
37833
|
+
* 在运行时获取页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#enablePassiveEvent)
|
|
37461
37834
|
*
|
|
37462
37835
|
* 最低基础库版本:[`2.25.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37463
37836
|
*/
|
|
37464
37837
|
getPassiveEvent(callback: (config: PassiveConfig) => void): void;
|
|
37465
37838
|
/**
|
|
37466
|
-
* 在运行时切换页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent](
|
|
37839
|
+
* 在运行时切换页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#enablePassiveEvent)
|
|
37467
37840
|
*
|
|
37468
37841
|
* 最低基础库版本:[`2.25.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37469
37842
|
*/
|
|
@@ -37473,7 +37846,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37473
37846
|
*
|
|
37474
37847
|
* 最低基础库版本:[`2.11.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37475
37848
|
*/
|
|
37476
|
-
setInitialRenderingCache(dynamicData
|
|
37849
|
+
setInitialRenderingCache(dynamicData?: IAnyObject | null): void;
|
|
37477
37850
|
/**
|
|
37478
37851
|
* 返回当前页面的 appBar 组件实例
|
|
37479
37852
|
*
|
|
@@ -37483,24 +37856,47 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37483
37856
|
}
|
|
37484
37857
|
interface ComponentOptions {
|
|
37485
37858
|
/**
|
|
37486
|
-
* [启用多slot支持](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
37859
|
+
* [启用多 slot 支持](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/slot.html#多-slot)
|
|
37487
37860
|
*/
|
|
37488
37861
|
multipleSlots?: boolean;
|
|
37489
37862
|
/**
|
|
37490
|
-
* [
|
|
37863
|
+
* [启用动态 slot 支持](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/slot.html#动态-slot),仅 glass-easel 组件框架支持
|
|
37864
|
+
*/
|
|
37865
|
+
dynamicSlots?: boolean;
|
|
37866
|
+
/**
|
|
37867
|
+
* 参见 [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/style.html#组件样式隔离)
|
|
37868
|
+
*
|
|
37869
|
+
* @deprecated 使用 `styleIsolation: 'apply-shared'`
|
|
37491
37870
|
*/
|
|
37492
37871
|
addGlobalClass?: boolean;
|
|
37493
37872
|
/**
|
|
37494
|
-
* [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
37873
|
+
* [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/style.html#组件样式隔离),推荐在自定义组件 JSON 中配置。
|
|
37874
|
+
*
|
|
37875
|
+
* `page-` 开头的三个选项可用在页面根组件上,表示在 `isolated` `apply-shared` `shared` 的基础上,在页面中禁用 `app.wxss` 。
|
|
37876
|
+
*
|
|
37877
|
+
* 最低基础库版本:[`2.10.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37495
37878
|
*/
|
|
37496
37879
|
styleIsolation?: 'isolated' | 'apply-shared' | 'shared' | 'page-isolated' | 'page-apply-shared' | 'page-shared';
|
|
37497
37880
|
/**
|
|
37498
|
-
* [纯数据字段](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
37881
|
+
* [纯数据字段](https://developers.weixin.qq.com/miniprogram/dev/framework/pure-data.html#组件数据中的纯数据字段) 是一些不用于界面渲染的 data 字段,可用于提升页面更新性能。从小程序基础库版本 2.8.2 开始支持。
|
|
37499
37882
|
*/
|
|
37500
37883
|
pureDataPattern?: RegExp;
|
|
37501
37884
|
/**
|
|
37502
|
-
* [
|
|
37885
|
+
* [虚拟组件节点](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/virtual-host.html#启用组件节点虚拟化) 使自定义组件自身的节点成为虚拟节点,组件内部的第一层节点直接参与外层布局。从小程序基础库版本 [`2.11.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持。
|
|
37886
|
+
*/
|
|
37503
37887
|
virtualHost?: boolean;
|
|
37888
|
+
/**
|
|
37889
|
+
* [数据深拷贝](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-deep-copy.html#所有可用的深拷贝策略) 仅 glass-easel 组件框架支持
|
|
37890
|
+
*/
|
|
37891
|
+
dataDeepCopy?: 'simple' | 'simple-recursion' | 'none';
|
|
37892
|
+
/**
|
|
37893
|
+
* [属性传递深拷贝](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-deep-copy.html#属性传递深拷贝) 仅 glass-easel 组件框架支持
|
|
37894
|
+
*/
|
|
37895
|
+
propertyPassingDeepCopy?: 'simple' | 'simple-recursion' | 'none';
|
|
37896
|
+
/**
|
|
37897
|
+
* 以组件属性值来初始化,性能更好。仅 glass-easel 组件框架支持,参见 [组件初始化策略](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/init-strategy.html)
|
|
37898
|
+
*/
|
|
37899
|
+
propertyEarlyInit?: boolean;
|
|
37504
37900
|
}
|
|
37505
37901
|
interface TriggerEventOption {
|
|
37506
37902
|
/** 事件是否冒泡
|
|
@@ -37508,7 +37904,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37508
37904
|
* 默认值: `false`
|
|
37509
37905
|
*/
|
|
37510
37906
|
bubbles?: boolean;
|
|
37511
|
-
/** 事件是否可以穿越组件边界,为false
|
|
37907
|
+
/** 事件是否可以穿越组件边界,为 false 时,事件将只能在引用组件自身的 Shadow 树上触发,不进入其他任何组件内部
|
|
37512
37908
|
*
|
|
37513
37909
|
* 默认值: `false`
|
|
37514
37910
|
*/
|
|
@@ -37528,6 +37924,8 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37528
37924
|
linkChanged?(target: TrivialInstance): void;
|
|
37529
37925
|
/** 关系生命周期函数,当关系脱离页面节点树时触发,触发时机在组件detached生命周期之后 */
|
|
37530
37926
|
unlinked?(target: TrivialInstance): void;
|
|
37927
|
+
/** 关系生命周期函数,当父子关系中的儿子未能找到对应的父亲、祖先-后代关系中的后代未能找到对应的祖先时触发,无回调参数,参见 [relations 定义选项](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/relations.html#relations-定义选项) */
|
|
37928
|
+
linkFailed?(): void;
|
|
37531
37929
|
/** 如果这一项被设置,则它表示关联的目标节点所应具有的behavior,所有拥有这一behavior的组件节点都会被关联 */
|
|
37532
37930
|
target?: string;
|
|
37533
37931
|
}
|
|
@@ -37535,21 +37933,29 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37535
37933
|
/** 页面生命周期回调—监听页面显示
|
|
37536
37934
|
*
|
|
37537
37935
|
* 页面显示/切入前台时触发。
|
|
37936
|
+
*
|
|
37937
|
+
* 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37538
37938
|
*/
|
|
37539
37939
|
show(): void;
|
|
37540
37940
|
/** 页面生命周期回调—监听页面隐藏
|
|
37541
37941
|
*
|
|
37542
37942
|
* 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,小程序切入后台等。
|
|
37943
|
+
*
|
|
37944
|
+
* 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37543
37945
|
*/
|
|
37544
37946
|
hide(): void;
|
|
37545
37947
|
/** 页面生命周期回调—监听页面尺寸变化
|
|
37546
37948
|
*
|
|
37547
37949
|
* 所在页面尺寸变化时执行
|
|
37950
|
+
*
|
|
37951
|
+
* 最低基础库版本: [`2.4.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37548
37952
|
*/
|
|
37549
37953
|
resize(size: Page.IResizeOption): void;
|
|
37550
37954
|
/** 页面生命周期回调—监听页面路由动画完成
|
|
37551
37955
|
*
|
|
37552
37956
|
* 所在页面路由动画完成时执行
|
|
37957
|
+
*
|
|
37958
|
+
* 最低基础库版本: [`2.31.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37553
37959
|
*/
|
|
37554
37960
|
routeDone(): void;
|
|
37555
37961
|
}
|
|
@@ -37559,12 +37965,13 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37559
37965
|
/** 该 behavior 所使用的 behavior 的 definitionFilter 函数列表 */
|
|
37560
37966
|
definitionFilterArr?: DefinitionFilter[]) => void;
|
|
37561
37967
|
interface Lifetimes {
|
|
37562
|
-
/** 组件生命周期声明对象,组件的生命周期:`created`、`attached`、`ready`、`moved`、`detached` 将收归到 `lifetimes` 字段内进行声明,原有声明方式仍旧有效,如同时存在两种声明方式,则 `lifetimes` 字段内声明方式优先级最高
|
|
37968
|
+
/** 组件生命周期声明对象,组件的生命周期:`created`、`attached`、`ready`、`moved`、`beforeDetach`、`detached` 将收归到 `lifetimes` 字段内进行声明,原有声明方式仍旧有效,如同时存在两种声明方式,则 `lifetimes` 字段内声明方式优先级最高
|
|
37563
37969
|
*
|
|
37564
|
-
*
|
|
37970
|
+
* 最低基础库版本:[`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37971
|
+
*/
|
|
37565
37972
|
lifetimes: Partial<{
|
|
37566
37973
|
/**
|
|
37567
|
-
*
|
|
37974
|
+
* 组件实例刚刚被创建完时触发。此时组件还未添加到页面节点树中
|
|
37568
37975
|
*
|
|
37569
37976
|
* 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37570
37977
|
*/
|
|
@@ -37594,11 +38001,15 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37594
38001
|
*/
|
|
37595
38002
|
detached(): void;
|
|
37596
38003
|
/**
|
|
37597
|
-
*
|
|
38004
|
+
* 在组件实例将被从页面内移除前执行,此时不应再操作节点或更新数据
|
|
38005
|
+
*/
|
|
38006
|
+
beforeDetach(): void;
|
|
38007
|
+
/**
|
|
38008
|
+
* 当组件内的生命周期回调或事件回调抛出异常时执行,可用于组件级别的错误捕获
|
|
37598
38009
|
*
|
|
37599
38010
|
* 最低基础库版本:[`2.4.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37600
38011
|
*/
|
|
37601
|
-
error(err:
|
|
38012
|
+
error(err: unknown): void;
|
|
37602
38013
|
}>;
|
|
37603
38014
|
/**
|
|
37604
38015
|
* @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义
|
|
@@ -37643,26 +38054,34 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37643
38054
|
/**
|
|
37644
38055
|
* @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义
|
|
37645
38056
|
*
|
|
37646
|
-
*
|
|
38057
|
+
* 在组件实例将被从页面内移除前执行,此时不应再操作节点或更新数据
|
|
38058
|
+
*/
|
|
38059
|
+
beforeDetach(): void;
|
|
38060
|
+
/**
|
|
38061
|
+
* @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义
|
|
38062
|
+
*
|
|
38063
|
+
* 当组件内的生命周期回调或事件回调抛出异常时执行,可用于组件级别的错误捕获
|
|
37647
38064
|
*
|
|
37648
38065
|
* 最低基础库版本:[`2.4.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37649
38066
|
*/
|
|
37650
|
-
error(err:
|
|
38067
|
+
error(err: unknown): void;
|
|
37651
38068
|
}
|
|
37652
38069
|
interface OtherOption {
|
|
37653
38070
|
/**
|
|
37654
|
-
* 组件数据字段监听器,用于监听 properties 和 data 的变化,参见 [数据监听器](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
38071
|
+
* 组件数据字段监听器,用于监听 properties 和 data 的变化,参见 [数据监听器](https://developers.weixin.qq.com/miniprogram/dev/framework/observer.html)
|
|
37655
38072
|
*
|
|
37656
38073
|
* 最低基础库版本:[`2.6.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
37657
38074
|
*/
|
|
37658
38075
|
observers: Record<string, (...args: any[]) => any>;
|
|
37659
|
-
/** 组件间关系定义,参见 [
|
|
38076
|
+
/** 组件间关系定义,参见 [relations 定义选项](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/relations.html#relations-定义选项) */
|
|
37660
38077
|
relations: {
|
|
37661
38078
|
[componentName: string]: RelationOption;
|
|
37662
38079
|
};
|
|
37663
|
-
/** 组件接受的外部样式类,参见 [外部样式类](https://developers.weixin.qq.com/miniprogram/dev/framework/
|
|
38080
|
+
/** 组件接受的外部样式类,参见 [外部样式类](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/external-classes.html#外部样式类)
|
|
38081
|
+
*
|
|
38082
|
+
* 最低基础库版本: [`1.9.90`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */
|
|
37664
38083
|
externalClasses?: string[];
|
|
37665
|
-
/** 组件所在页面的生命周期声明对象,参见 [
|
|
38084
|
+
/** 组件所在页面的生命周期声明对象,参见 [组件所在页面的生命周期](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/lifetimes.html#组件所在页面的生命周期)
|
|
37666
38085
|
*
|
|
37667
38086
|
* 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */
|
|
37668
38087
|
pageLifetimes?: Partial<PageLifetimes>;
|
|
@@ -37673,7 +38092,7 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37673
38092
|
* 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */
|
|
37674
38093
|
definitionFilter?: DefinitionFilter;
|
|
37675
38094
|
/**
|
|
37676
|
-
*
|
|
38095
|
+
* 组件自定义导出,当在 `behaviors` 中引入 `wx://component-export` 时,这个定义段可以用于指定组件被 `selectComponent` 调用时的返回值,参见 [自定义的组件实例获取结果](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/component-tree-visit.html#自定义的组件实例获取结果)
|
|
37677
38096
|
* 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */
|
|
37678
38097
|
export: () => IAnyObject;
|
|
37679
38098
|
}
|
|
@@ -37810,8 +38229,8 @@ declare namespace WechatMiniprogram.Component {
|
|
|
37810
38229
|
interface ScrollTimelineOption {
|
|
37811
38230
|
/** 指定滚动元素的选择器(只支持 scroll-view),该元素滚动时会驱动动画的进度 */
|
|
37812
38231
|
scrollSource: string;
|
|
37813
|
-
/** 指定滚动的方向。有效值为 horizontal 或 vertical */
|
|
37814
|
-
orientation?:
|
|
38232
|
+
/** 指定滚动的方向。有效值为 `horizontal` 或 `vertical` ,默认值: `vertical` */
|
|
38233
|
+
orientation?: 'horizontal' | 'vertical';
|
|
37815
38234
|
/** 指定开始驱动动画进度的滚动偏移量,单位 px */
|
|
37816
38235
|
startScrollOffset: number;
|
|
37817
38236
|
/** 指定停止驱动动画进度的滚动偏移量,单位 px */
|
|
@@ -37866,12 +38285,19 @@ declare let Component: WechatMiniprogram.Component.Constructor;
|
|
|
37866
38285
|
declare namespace WechatMiniprogram.GlassEasel.Component {
|
|
37867
38286
|
type ExportType<UData extends TypeUtils.DataList, UProperty extends TypeUtils.PropertyList, UMethod extends TypeUtils.MethodList, UComponentExport, UExtraThisFields extends TypeUtils.DataList> = [UComponentExport] extends [never] ? Instance<UData, UProperty, UMethod, UComponentExport, UExtraThisFields> : UComponentExport;
|
|
37868
38287
|
type DefinitionOptions = {
|
|
38288
|
+
/** [启用多 slot 支持](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/slot.html#多-slot) */
|
|
37869
38289
|
multipleSlots?: boolean;
|
|
38290
|
+
/** [启用动态 slot 支持](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/slot.html#动态-slot) */
|
|
37870
38291
|
dynamicSlots?: boolean;
|
|
38292
|
+
/** [纯数据字段](https://developers.weixin.qq.com/miniprogram/dev/framework/pure-data.html) 前缀正则,匹配到的 data 字段不用于 WXML 模板渲染 */
|
|
37871
38293
|
pureDataPattern?: RegExp;
|
|
38294
|
+
/** [启用组件节点虚拟化](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/virtual-host.html#启用组件节点虚拟化) */
|
|
37872
38295
|
virtualHost?: boolean;
|
|
38296
|
+
/** [数据深拷贝](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-deep-copy.html#所有可用的深拷贝策略) 策略 */
|
|
37873
38297
|
dataDeepCopy?: 'none' | 'simple' | 'simple-recursion';
|
|
38298
|
+
/** [属性传递深拷贝](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/data-deep-copy.html#属性传递深拷贝) 策略 */
|
|
37874
38299
|
propertyPassingDeepCopy?: 'none' | 'simple' | 'simple-recursion';
|
|
38300
|
+
/** 以组件属性值来初始化,性能更好,参见 [组件初始化策略](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/init-strategy.html) */
|
|
37875
38301
|
propertyEarlyInit?: boolean;
|
|
37876
38302
|
/** @deprecated prefer static config */
|
|
37877
38303
|
addGlobalClass?: boolean;
|
|
@@ -37990,7 +38416,9 @@ declare namespace WechatMiniprogram.GlassEasel.Component {
|
|
|
37990
38416
|
}): void;
|
|
37991
38417
|
/** Create a selector query for searching element inside the component */
|
|
37992
38418
|
createSelectorQuery(): SelectorQuery;
|
|
37993
|
-
applyAnimatedStyle(selector: string, updater: Skyline.WorkletFunction<Skyline.AnimatedStyle>, userConfig?: Skyline.AnimatedStyleConfig, callback?: (
|
|
38419
|
+
applyAnimatedStyle(selector: string, updater: Skyline.WorkletFunction<Skyline.AnimatedStyle>, userConfig?: Skyline.AnimatedStyleConfig, callback?: (res: {
|
|
38420
|
+
styleId: number;
|
|
38421
|
+
}) => void): void;
|
|
37994
38422
|
clearAnimatedStyle(selector: string, styleIds: number[], callback?: () => void): void;
|
|
37995
38423
|
/** Create an intersection observer */
|
|
37996
38424
|
createIntersectionObserver(options?: {
|
|
@@ -38027,18 +38455,19 @@ declare namespace WechatMiniprogram.GlassEasel.Component {
|
|
|
38027
38455
|
selectOwnerComponent<UData extends TypeUtils.DataList, UProperty extends TypeUtils.PropertyList, UMethod extends TypeUtils.MethodList, UComponentExport, UExtraThisFields extends TypeUtils.DataList = TypeUtils.Empty>(componentType: ComponentType<UData, UProperty, UMethod, UComponentExport, UExtraThisFields>): ExportType<UData, UProperty, UMethod, UComponentExport, UExtraThisFields> | null;
|
|
38028
38456
|
getRelationNodes(relationKey: string): TrivialInstance[];
|
|
38029
38457
|
applyAnimation(selector: string, options: WechatMiniprogram.Component.KeyFrame, _animeJS: boolean, callback?: () => void): void;
|
|
38458
|
+
clearAnimation(selector: string, callback?: () => void): void;
|
|
38030
38459
|
clearAnimation(selector: string, options: { [K in keyof WechatMiniprogram.Component.KeyFrame]?: boolean; } | undefined | null, callback?: () => void): void;
|
|
38031
38460
|
animate(selector: string, keyframes: WechatMiniprogram.Component.KeyFrame[], duration: number, callback?: () => void): void;
|
|
38032
38461
|
animate(selector: string, keyframes: WechatMiniprogram.Component.KeyFrame[], duration: number, scrollTimeline: WechatMiniprogram.Component.ScrollTimelineOption): void;
|
|
38033
|
-
getTabBar(cb?: (tabBar: TrivialInstance) => void): TrivialInstance;
|
|
38034
|
-
getAppBar(): TrivialInstance;
|
|
38035
|
-
/** The `
|
|
38462
|
+
getTabBar(cb?: (tabBar: TrivialInstance) => void): TrivialInstance | null;
|
|
38463
|
+
getAppBar(): TrivialInstance | null;
|
|
38464
|
+
/** The data saved by `onSaveExitState` before the last exit */
|
|
38036
38465
|
get exitState(): any;
|
|
38037
38466
|
set exitState(value: any);
|
|
38038
|
-
setInitialRenderingCache(): void;
|
|
38039
|
-
setUpdatePerformanceListener<WithDataPath extends boolean = false>(config: WechatMiniprogram.Component.SetUpdatePerformanceListenerOption<WithDataPath>, listener: WechatMiniprogram.Component.UpdatePerformanceListener<WithDataPath>): void;
|
|
38040
|
-
getPassiveEvent(
|
|
38041
|
-
setPassiveEvent(config:
|
|
38467
|
+
setInitialRenderingCache(dynamicData?: IAnyObject | null): void;
|
|
38468
|
+
setUpdatePerformanceListener<WithDataPath extends boolean = false>(config: WechatMiniprogram.Component.SetUpdatePerformanceListenerOption<WithDataPath>, listener: WechatMiniprogram.Component.UpdatePerformanceListener<WithDataPath> | null): void;
|
|
38469
|
+
getPassiveEvent(callback: (config: WechatMiniprogram.Component.PassiveConfig) => void): void;
|
|
38470
|
+
setPassiveEvent(config: WechatMiniprogram.Component.PassiveConfig): void;
|
|
38042
38471
|
/**
|
|
38043
38472
|
* Cast the component into the specified type
|
|
38044
38473
|
*
|
|
@@ -38101,13 +38530,15 @@ declare namespace WechatMiniprogram.GlassEasel.Component {
|
|
|
38101
38530
|
* which can be imported by other behaviors.
|
|
38102
38531
|
*/
|
|
38103
38532
|
init<TExport extends Record<string, TypeUtils.TaggedMethod<(...args: any[]) => any>> | void>(func: (this: Instance<TData, TProperty, TMethod, TComponentExport, TExtraThisFields>, builderContext: TypeUtils.BuilderContext<TPrevData, TProperty, Instance<TData, TProperty, TMethod, TComponentExport, TExtraThisFields>>) => TExport): Behavior.ResolveBehaviorBuilder<Builder<TPrevData, TData, TProperty, TMethod & (TExport extends void ? TypeUtils.Empty : { [K in keyof TExport]: TypeUtils.UnTaggedMethod<TExport[K]>; }), TChainingFilter, TPendingChainingFilter, TComponentExport, TExtraThisFields>, TChainingFilter>;
|
|
38104
|
-
/**
|
|
38533
|
+
/**
|
|
38534
|
+
* 应用一个经典 Definition 形式的定义对象,参见 [Chaining 形式的逻辑拆分与形式混用](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/scripting.html#Chaining-形式的逻辑拆分与形式混用)
|
|
38535
|
+
*/
|
|
38105
38536
|
definition<TNewData extends TypeUtils.DataList = TypeUtils.Empty, TNewProperty extends TypeUtils.PropertyList = TypeUtils.Empty, TNewMethod extends TypeUtils.MethodList = TypeUtils.Empty, TNewComponentExport = never>(def: Definition<TNewData, TNewProperty, TNewMethod, TNewComponentExport> & ThisType<Instance<TData & TNewData, TProperty & TNewProperty, TMethod & TNewMethod, TNewComponentExport, TExtraThisFields>>): Behavior.ResolveBehaviorBuilder<Builder<TPrevData, TData & TNewData, TProperty & TNewProperty, TMethod & TNewMethod, TChainingFilter, TPendingChainingFilter, TNewComponentExport, TExtraThisFields>, TChainingFilter>;
|
|
38106
38537
|
pageDefinition<TNewData extends TypeUtils.DataList, TNewExtraFields extends {
|
|
38107
38538
|
[k: PropertyKey]: any;
|
|
38108
38539
|
}>(def: PageDefinition<TNewData, TNewExtraFields> & ThisType<Instance<TData & TNewData, TProperty, TMethod & TNewExtraFields, undefined, TExtraThisFields>>): Behavior.ResolveBehaviorBuilder<Builder<TPrevData, TData & TNewData, TProperty, TMethod & TNewExtraFields, TChainingFilter, TPendingChainingFilter, TComponentExport, TExtraThisFields>, TChainingFilter>;
|
|
38109
38540
|
/**
|
|
38110
|
-
*
|
|
38541
|
+
* 完成组件定义,参见 [Component 构造器的 Chaining 形式](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/scripting.html#Component-构造器的-Chaining-形式)
|
|
38111
38542
|
*/
|
|
38112
38543
|
register(): ComponentType<TData, TProperty, TMethod, TComponentExport, TExtraThisFields>;
|
|
38113
38544
|
/**
|
|
@@ -38149,7 +38580,7 @@ declare namespace WechatMiniprogram.GlassEasel.Behavior {
|
|
|
38149
38580
|
export?: (source: Component.TrivialInstance | null) => TComponentExport;
|
|
38150
38581
|
};
|
|
38151
38582
|
interface BaseBuilder<TPrevData extends TypeUtils.DataList = TypeUtils.Empty, TData extends TypeUtils.DataList = TypeUtils.Empty, TProperty extends TypeUtils.PropertyList = TypeUtils.Empty, TMethod extends TypeUtils.MethodList = TypeUtils.Empty, TChainingFilter extends TypeUtils.ChainingFilterType = never, TPendingChainingFilter extends TypeUtils.ChainingFilterType = never, TComponentExport = never, TExtraThisFields extends TypeUtils.DataList = TypeUtils.Empty> {
|
|
38152
|
-
/**
|
|
38583
|
+
/** 实现一个 trait behavior,参见 [trait behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/trait-behaviors.html) */
|
|
38153
38584
|
implement<TIn extends {
|
|
38154
38585
|
[key: string]: any;
|
|
38155
38586
|
}>(traitBehavior: TraitBehavior.Instance<TIn, any>, impl: TIn): ResolveBehaviorBuilder<this, TChainingFilter>;
|
|
@@ -38184,7 +38615,7 @@ declare namespace WechatMiniprogram.GlassEasel.Behavior {
|
|
|
38184
38615
|
type Instance<TData extends TypeUtils.DataList, TProperty extends TypeUtils.PropertyList, TMethod extends TypeUtils.MethodList, TChainingFilter extends TypeUtils.ChainingFilterType, TComponentExport, TExtraThisFields extends TypeUtils.DataList = TypeUtils.Empty> = TypeSignature<TData, TProperty, TMethod>;
|
|
38185
38616
|
type TrivialInstance = Instance< /* TData */ IAnyObject, /* TProperty */ IAnyObject, /* TMethod */ IAnyObject, /* TChainingFilter */ any, /* TComponentExport */ any, /* TExtraThisFields */ IAnyObject>;
|
|
38186
38617
|
interface Builder<TPrevData extends TypeUtils.DataList = TypeUtils.Empty, TData extends TypeUtils.DataList = TypeUtils.Empty, TProperty extends TypeUtils.PropertyList = TypeUtils.Empty, TMethod extends TypeUtils.MethodList = TypeUtils.Empty, TChainingFilter extends TypeUtils.ChainingFilterType = never, TPendingChainingFilter extends TypeUtils.ChainingFilterType = never, TComponentExport = never, TExtraThisFields extends TypeUtils.DataList = TypeUtils.Empty> extends BaseBuilder<TPrevData, TData, TProperty, TMethod, TChainingFilter, TPendingChainingFilter, TComponentExport, TExtraThisFields> {
|
|
38187
|
-
/**
|
|
38618
|
+
/** 定义一个 chaining filter,参见 [Chaining 形式扩展](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/extend.html#Chaining-形式扩展) */
|
|
38188
38619
|
chainingFilter<TAddedFields extends {
|
|
38189
38620
|
[key: string]: any;
|
|
38190
38621
|
}, TRemovedFields extends string = never>(func: TypeUtils.ChainingFilterFunc<TAddedFields, TRemovedFields>): ResolveBehaviorBuilder<Builder<TPrevData, TData, TProperty, TMethod, TChainingFilter, {
|
|
@@ -38227,10 +38658,12 @@ declare namespace WechatMiniprogram.GlassEasel.Behavior {
|
|
|
38227
38658
|
* The return value is used as the "export" value of the behavior.
|
|
38228
38659
|
*/
|
|
38229
38660
|
init<TExport extends Record<string, TypeUtils.TaggedMethod<(...args: any[]) => any>> | void>(func: (this: Component.Instance<TData, TProperty, TMethod, TComponentExport, TExtraThisFields>, builderContext: TypeUtils.BuilderContext<TPrevData, TProperty, Component.Instance<TData, TProperty, TMethod, TComponentExport, TExtraThisFields>>) => TExport): ResolveBehaviorBuilder<Builder<TPrevData, TData, TProperty, TMethod & (TExport extends void ? TypeUtils.Empty : { [K in keyof TExport]: TypeUtils.UnTaggedMethod<TExport[K]>; }), TChainingFilter, TPendingChainingFilter, TComponentExport, TExtraThisFields>, TChainingFilter>;
|
|
38230
|
-
/**
|
|
38661
|
+
/**
|
|
38662
|
+
* 应用一个经典 Definition 形式的定义对象,参见 [Chaining 形式的逻辑拆分与形式混用](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/scripting.html#Chaining-形式的逻辑拆分与形式混用)
|
|
38663
|
+
*/
|
|
38231
38664
|
definition<TNewData extends TypeUtils.DataList = TypeUtils.Empty, TNewProperty extends TypeUtils.PropertyList = TypeUtils.Empty, TNewMethod extends TypeUtils.MethodList = TypeUtils.Empty, TNewComponentExport = never>(def: Definition<TNewData, TNewProperty, TNewMethod, TNewComponentExport> & ThisType<Component.Instance<TData & TNewData, TProperty & TNewProperty, TMethod & TNewMethod, TNewComponentExport, TExtraThisFields>>): ResolveBehaviorBuilder<Builder<TPrevData, TData & TNewData, TProperty & TNewProperty, TMethod & TNewMethod, TChainingFilter, TPendingChainingFilter, TNewComponentExport, TExtraThisFields>, TChainingFilter>;
|
|
38232
38665
|
/**
|
|
38233
|
-
*
|
|
38666
|
+
* 完成 behavior 定义,参见 [Component 构造器的 Chaining 形式](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/scripting.html#Component-构造器的-Chaining-形式)
|
|
38234
38667
|
*/
|
|
38235
38668
|
register(): Instance<TData, TProperty, TMethod, TPendingChainingFilter, TComponentExport, TExtraThisFields>;
|
|
38236
38669
|
/**
|
|
@@ -38245,6 +38678,7 @@ declare namespace WechatMiniprogram.GlassEasel.TraitBehavior {
|
|
|
38245
38678
|
}, TOut extends {
|
|
38246
38679
|
[key: string]: any;
|
|
38247
38680
|
} = TIn> = {};
|
|
38681
|
+
/** trait behaviors 用于向其他组件暴露 JS 接口,参见 [trait behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/component-framework/trait-behaviors.html) */
|
|
38248
38682
|
interface Constructor {
|
|
38249
38683
|
<TIn extends Record<string, any>>(): Instance<TIn, TIn>;
|
|
38250
38684
|
<TIn extends Record<string, any>, TOut extends Record<string, any>>(trans: (impl: TIn) => TOut): Instance<TIn, TOut>;
|
|
@@ -38421,8 +38855,12 @@ declare namespace WechatMiniprogram.GlassEasel.TypeUtils {
|
|
|
38421
38855
|
created: () => void;
|
|
38422
38856
|
attached: () => void;
|
|
38423
38857
|
moved: () => void;
|
|
38858
|
+
/** 组件实例将被从页面内移除前触发 */
|
|
38859
|
+
beforeDetach: () => void;
|
|
38424
38860
|
detached: () => void;
|
|
38425
38861
|
ready: () => void;
|
|
38862
|
+
/** 组件内的生命周期回调或事件回调抛出异常时触发,回调参数为 `(err: unknown)` */
|
|
38863
|
+
error: (err: unknown) => void;
|
|
38426
38864
|
};
|
|
38427
38865
|
interface BuilderContext<TPrevData extends DataList, TProperty extends PropertyList, TMethodCaller> extends ThisType<TMethodCaller> {
|
|
38428
38866
|
self: TMethodCaller;
|
|
@@ -39550,8 +39988,10 @@ declare namespace WechatMiniprogram.Skyline {
|
|
|
39550
39988
|
type AnimatedStyle = Record<string, any>;
|
|
39551
39989
|
type FlushOption = 'async' | 'sync';
|
|
39552
39990
|
interface AnimatedStyleConfig {
|
|
39553
|
-
|
|
39554
|
-
|
|
39991
|
+
/** 是否立即执行一次 updater 函数,默认值: `true` */
|
|
39992
|
+
immediate?: boolean;
|
|
39993
|
+
/** 刷新时机,默认值: `async` */
|
|
39994
|
+
flush?: FlushOption;
|
|
39555
39995
|
}
|
|
39556
39996
|
}
|
|
39557
39997
|
/*! *****************************************************************************
|