wevu 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/dist/compiler.cjs +17 -0
- package/dist/compiler.d.cts +17 -0
- package/dist/compiler.d.mts +17 -0
- package/dist/compiler.mjs +16 -0
- package/dist/index.cjs +175 -41
- package/dist/index.d.cts +187 -47
- package/dist/index.d.mts +187 -47
- package/dist/index.mjs +170 -42
- package/dist/{store-D0GD8ulz.cjs → store-DTqmKv0w.cjs} +1 -2
- package/dist/{store-2q4qcdBi.mjs → store-YHZDsE3y.mjs} +1 -2
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +1 -1
- package/dist/store.d.mts +1 -1
- package/dist/store.mjs +1 -1
- package/package.json +15 -1
- /package/dist/{index-0dF4y5p6.d.mts → index-B63NgJPS.d.cts} +0 -0
- /package/dist/{index-DVEFI-Uo.d.cts → index-Bq83Mwxo.d.mts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DefineStoreOptions, c as SubscriptionCallback, d as ref, f as unref, i as ActionSubscriber, l as Ref, n as createStore, o as MutationType, r as defineStore, s as StoreManager, t as storeToRefs, u as isRef } from "./index-
|
|
1
|
+
import { a as DefineStoreOptions, c as SubscriptionCallback, d as ref, f as unref, i as ActionSubscriber, l as Ref, n as createStore, o as MutationType, r as defineStore, s as StoreManager, t as storeToRefs, u as isRef } from "./index-Bq83Mwxo.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/reactivity/computed.d.ts
|
|
4
4
|
type ComputedGetter<T$1> = () => T$1;
|
|
@@ -60,7 +60,6 @@ declare function reactive<T$1 extends object>(target: T$1): T$1;
|
|
|
60
60
|
declare function isReactive(value: unknown): boolean;
|
|
61
61
|
declare function toRaw<T$1>(observed: T$1): T$1;
|
|
62
62
|
/**
|
|
63
|
-
* Establish a dependency on the whole reactive object "version".
|
|
64
63
|
* 让 effect 订阅整个对象的“版本号”,无需深度遍历即可对任何字段变化做出响应。
|
|
65
64
|
*/
|
|
66
65
|
declare function touchReactive(target: object): void;
|
|
@@ -80,7 +79,7 @@ declare function touchReactive(target: object): void;
|
|
|
80
79
|
*/
|
|
81
80
|
declare function shallowReactive<T$1 extends object>(target: T$1): T$1;
|
|
82
81
|
/**
|
|
83
|
-
*
|
|
82
|
+
* 判断一个值是否为 shallowReactive 创建的浅层响应式对象
|
|
84
83
|
*/
|
|
85
84
|
declare function isShallowReactive(value: unknown): boolean;
|
|
86
85
|
/**
|
|
@@ -220,6 +219,72 @@ type ComponentPublicInstance<D extends object, C extends ComputedDefinitions, M
|
|
|
220
219
|
interface MiniProgramAdapter {
|
|
221
220
|
setData?: (payload: Record<string, any>) => void | Promise<void>;
|
|
222
221
|
}
|
|
222
|
+
type MiniProgramComponentBehaviorOptions = WechatMiniprogram.Component.ComponentOptions;
|
|
223
|
+
type MpComponentOptions = WechatMiniprogram.Component.TrivialOption;
|
|
224
|
+
type MiniProgramBehaviorIdentifier = WechatMiniprogram.Behavior.BehaviorIdentifier | string;
|
|
225
|
+
interface MiniProgramComponentOptions {
|
|
226
|
+
/**
|
|
227
|
+
* 类似于 mixins/traits 的组件间代码复用机制(behaviors)。
|
|
228
|
+
*/
|
|
229
|
+
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
230
|
+
/**
|
|
231
|
+
* 组件接受的外部样式类。
|
|
232
|
+
*/
|
|
233
|
+
externalClasses?: MpComponentOptions['externalClasses'];
|
|
234
|
+
/**
|
|
235
|
+
* 组件间关系定义。
|
|
236
|
+
*/
|
|
237
|
+
relations?: MpComponentOptions['relations'];
|
|
238
|
+
/**
|
|
239
|
+
* 组件数据字段监听器,用于监听 properties 和 data 的变化。
|
|
240
|
+
*/
|
|
241
|
+
observers?: MpComponentOptions['observers'];
|
|
242
|
+
/**
|
|
243
|
+
* 组件生命周期声明对象:
|
|
244
|
+
* `created`/`attached`/`ready`/`moved`/`detached`/`error`。
|
|
245
|
+
*
|
|
246
|
+
* 注意:wevu 会在 `attached/ready/detached/moved/error` 阶段做桥接与包装,
|
|
247
|
+
* 但 `created` 发生在 setup() 之前。
|
|
248
|
+
*/
|
|
249
|
+
lifetimes?: MpComponentOptions['lifetimes'];
|
|
250
|
+
/**
|
|
251
|
+
* 组件所在页面的生命周期声明对象:`show`/`hide`/`resize`/`routeDone`。
|
|
252
|
+
*/
|
|
253
|
+
pageLifetimes?: MpComponentOptions['pageLifetimes'];
|
|
254
|
+
/**
|
|
255
|
+
* 组件选项(multipleSlots/styleIsolation/pureDataPattern/virtualHost 等)。
|
|
256
|
+
*/
|
|
257
|
+
options?: MpComponentOptions['options'];
|
|
258
|
+
/**
|
|
259
|
+
* 定义段过滤器,用于自定义组件扩展。
|
|
260
|
+
*/
|
|
261
|
+
definitionFilter?: MpComponentOptions['definitionFilter'];
|
|
262
|
+
/**
|
|
263
|
+
* 组件自定义导出:当使用 `behavior: wx://component-export` 时,
|
|
264
|
+
* 可用于指定组件被 selectComponent 调用时的返回值。
|
|
265
|
+
*
|
|
266
|
+
* wevu 默认会将 setup() 中通过 `expose()` 写入的内容作为 export() 返回值,
|
|
267
|
+
* 因此大多数情况下无需手动编写 export();若同时提供 export(),则会与 expose() 结果浅合并。
|
|
268
|
+
*/
|
|
269
|
+
export?: MpComponentOptions['export'];
|
|
270
|
+
/**
|
|
271
|
+
* 原生 properties(与 wevu 的 props 不同)。
|
|
272
|
+
*
|
|
273
|
+
* - 推荐:使用 wevu 的 `props` 选项,让运行时规范化为小程序 `properties`。
|
|
274
|
+
* - 兼容:也可以直接传入小程序 `properties`。
|
|
275
|
+
*/
|
|
276
|
+
properties?: MpComponentOptions['properties'];
|
|
277
|
+
/**
|
|
278
|
+
* 旧式生命周期(基础库 `2.2.3` 起推荐使用 `lifetimes` 字段)。
|
|
279
|
+
* 保留以增强类型提示与兼容性。
|
|
280
|
+
*/
|
|
281
|
+
created?: MpComponentOptions['created'];
|
|
282
|
+
attached?: MpComponentOptions['attached'];
|
|
283
|
+
ready?: MpComponentOptions['ready'];
|
|
284
|
+
moved?: MpComponentOptions['moved'];
|
|
285
|
+
detached?: MpComponentOptions['detached'];
|
|
286
|
+
error?: MpComponentOptions['error'];
|
|
287
|
+
}
|
|
223
288
|
interface ModelBindingOptions<T$1 = any> {
|
|
224
289
|
event?: string;
|
|
225
290
|
valueProp?: string;
|
|
@@ -237,6 +302,7 @@ interface AppConfig {
|
|
|
237
302
|
type WevuPlugin = ((app: RuntimeApp<any, any, any>, ...options: any[]) => any) | {
|
|
238
303
|
install: (app: RuntimeApp<any, any, any>, ...options: any[]) => any;
|
|
239
304
|
};
|
|
305
|
+
type MiniProgramAppOptions<T$1 extends Record<string, any> = Record<string, any>> = WechatMiniprogram.App.Options<T$1>;
|
|
240
306
|
interface RuntimeApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
241
307
|
mount: (adapter?: MiniProgramAdapter) => RuntimeInstance<D, C, M>;
|
|
242
308
|
use: (plugin: WevuPlugin, ...options: any[]) => RuntimeApp<D, C, M>;
|
|
@@ -268,11 +334,11 @@ type ComponentPropsOptions = Record<string, PropOptions<any> | PropType<any> | n
|
|
|
268
334
|
interface PropOptions<T$1 = any> {
|
|
269
335
|
type?: PropType<T$1> | true | null;
|
|
270
336
|
/**
|
|
271
|
-
*
|
|
337
|
+
* 默认值(对齐 Vue 的 `default`;会被赋给小程序 property 的 `value`)
|
|
272
338
|
*/
|
|
273
339
|
default?: T$1 | (() => T$1);
|
|
274
340
|
/**
|
|
275
|
-
*
|
|
341
|
+
* 小程序 `value` 的别名
|
|
276
342
|
*/
|
|
277
343
|
value?: T$1 | (() => T$1);
|
|
278
344
|
required?: boolean;
|
|
@@ -297,73 +363,105 @@ type InferProps<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = { [
|
|
|
297
363
|
type SetupFunction<P$1 extends ComponentPropsOptions, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = (props: InferProps<P$1>, ctx: SetupContext<D, C, M, P$1>) => Record<string, any> | void;
|
|
298
364
|
interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P$1 extends ComponentPropsOptions = ComponentPropsOptions> {
|
|
299
365
|
/**
|
|
300
|
-
*
|
|
366
|
+
* 组件 props(来自小程序 properties)
|
|
301
367
|
*/
|
|
302
368
|
props: InferProps<P$1>;
|
|
303
369
|
/**
|
|
304
|
-
*
|
|
370
|
+
* 运行时实例
|
|
305
371
|
*/
|
|
306
372
|
runtime: RuntimeInstance<D, C, M>;
|
|
307
373
|
/**
|
|
308
|
-
*
|
|
374
|
+
* 响应式状态
|
|
309
375
|
*/
|
|
310
376
|
state: D;
|
|
311
377
|
/**
|
|
312
|
-
*
|
|
378
|
+
* 公开实例代理
|
|
313
379
|
*/
|
|
314
380
|
proxy: ComponentPublicInstance<D, C, M>;
|
|
315
381
|
/**
|
|
316
|
-
*
|
|
382
|
+
* 双向绑定辅助方法
|
|
317
383
|
*/
|
|
318
384
|
bindModel: RuntimeInstance<D, C, M>['bindModel'];
|
|
319
385
|
/**
|
|
320
|
-
*
|
|
386
|
+
* watch 辅助方法
|
|
321
387
|
*/
|
|
322
388
|
watch: RuntimeInstance<D, C, M>['watch'];
|
|
323
389
|
/**
|
|
324
|
-
*
|
|
390
|
+
* 小程序内部实例
|
|
325
391
|
*/
|
|
326
392
|
instance: InternalRuntimeState;
|
|
327
393
|
/**
|
|
328
|
-
*
|
|
394
|
+
* 通过小程序 `triggerEvent(eventName, detail?, options?)` 派发事件。
|
|
395
|
+
*
|
|
396
|
+
* 注意:不同于 Vue 3 的 `emit(event, ...args)`,小程序事件只携带一个 `detail` 载荷;
|
|
397
|
+
* `options` 用于控制事件传播行为(`bubbles`/`composed`/`capturePhase`)。
|
|
329
398
|
*/
|
|
330
|
-
emit: (event: string,
|
|
399
|
+
emit: (event: string, detail?: any, options?: TriggerEventOptions) => void;
|
|
331
400
|
/**
|
|
332
|
-
* Vue 3
|
|
401
|
+
* Vue 3 对齐:expose 公共属性
|
|
333
402
|
*/
|
|
334
|
-
expose
|
|
403
|
+
expose: (exposed: Record<string, any>) => void;
|
|
335
404
|
/**
|
|
336
|
-
* Vue 3
|
|
405
|
+
* Vue 3 对齐:attrs(小程序场景兜底为空对象)
|
|
337
406
|
*/
|
|
338
|
-
attrs
|
|
407
|
+
attrs: Record<string, any>;
|
|
339
408
|
}
|
|
340
|
-
|
|
409
|
+
type TriggerEventOptions = WechatMiniprogram.Component.TriggerEventOption;
|
|
410
|
+
interface InternalRuntimeStateFields {
|
|
341
411
|
__wevu?: RuntimeInstance<any, any, any>;
|
|
342
412
|
__wevuWatchStops?: WatchStopHandle[];
|
|
343
413
|
$wevu?: RuntimeInstance<any, any, any>;
|
|
344
414
|
__wevuHooks?: Record<string, any>;
|
|
345
415
|
__wevuExposed?: Record<string, any>;
|
|
346
416
|
}
|
|
347
|
-
|
|
417
|
+
type MiniProgramInstance = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.App.TrivialInstance;
|
|
418
|
+
type InternalRuntimeState = InternalRuntimeStateFields & Partial<MiniProgramInstance>;
|
|
419
|
+
type MiniProgramPageLifetimes = Partial<WechatMiniprogram.Page.ILifetime>;
|
|
420
|
+
type MiniProgramComponentRawOptions = Omit<WechatMiniprogram.Component.TrivialOption, 'behaviors'> & {
|
|
421
|
+
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
422
|
+
} & MiniProgramPageLifetimes & Record<string, any>;
|
|
423
|
+
interface DefineComponentOptions<P$1 extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramComponentOptions, MiniProgramPageLifetimes {
|
|
348
424
|
/**
|
|
349
|
-
* Page
|
|
350
|
-
*
|
|
425
|
+
* 页面特性开关(用于按需注入 Page 事件处理函数)。
|
|
426
|
+
*
|
|
427
|
+
* 说明:小程序的部分页面事件/菜单项具有“按需派发/按需展示”特性,
|
|
428
|
+
* 只有定义了对应的 `onXXX` 方法才会触发/展示(如 `onPageScroll`、`onShareTimeline`)。
|
|
429
|
+
* 因此 wevu 需要在注册阶段(Component())就决定是否注入这些 onXXX。
|
|
430
|
+
*
|
|
431
|
+
* - 若你在 options 中显式定义了原生 `onXXX`,wevu 会自动桥接对应 hook(无需 features)。
|
|
432
|
+
* - 若你只想在 `setup()` 里使用 wevu hook(不额外写原生 `onXXX`),则通过 `features` 显式开启注入。
|
|
351
433
|
*/
|
|
352
434
|
features?: PageFeatures;
|
|
353
435
|
/**
|
|
354
|
-
* Vue
|
|
436
|
+
* 类 Vue 的 props 定义(会被规范化为小程序 `properties`)
|
|
355
437
|
*/
|
|
356
438
|
props?: P$1;
|
|
357
439
|
watch?: Record<string, any>;
|
|
358
440
|
setup?: SetupFunction<P$1, D, C, M>;
|
|
441
|
+
/**
|
|
442
|
+
* 组件 data(建议使用函数返回初始值)。
|
|
443
|
+
*/
|
|
444
|
+
data?: () => D;
|
|
445
|
+
/**
|
|
446
|
+
* 组件 computed(会参与快照 diff)。
|
|
447
|
+
*/
|
|
448
|
+
computed?: C;
|
|
449
|
+
/**
|
|
450
|
+
* 组件 methods(会绑定到 public instance 上)。
|
|
451
|
+
*/
|
|
452
|
+
methods?: M;
|
|
453
|
+
/**
|
|
454
|
+
* 透传/扩展字段:允许携带其他小程序原生 Component 选项或自定义字段。
|
|
455
|
+
* 说明:为保持兼容性保留 index signature,但仍会对已知字段提供智能提示。
|
|
456
|
+
*/
|
|
359
457
|
[key: string]: any;
|
|
360
458
|
}
|
|
361
|
-
interface DefineAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> {
|
|
459
|
+
interface DefineAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramAppOptions {
|
|
362
460
|
watch?: Record<string, any>;
|
|
363
461
|
setup?: (ctx: SetupContext<D, C, M>) => Record<string, any> | void;
|
|
364
462
|
[key: string]: any;
|
|
365
463
|
}
|
|
366
|
-
interface CreateAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> {
|
|
464
|
+
interface CreateAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramAppOptions {
|
|
367
465
|
data?: () => D;
|
|
368
466
|
computed?: C;
|
|
369
467
|
methods?: M;
|
|
@@ -372,10 +470,46 @@ interface CreateAppOptions<D extends object = Record<string, any>, C extends Com
|
|
|
372
470
|
[key: string]: any;
|
|
373
471
|
}
|
|
374
472
|
interface PageFeatures {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
473
|
+
/**
|
|
474
|
+
* 启用页面滚动事件(注入 `onPageScroll`)。
|
|
475
|
+
*/
|
|
476
|
+
enableOnPageScroll?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* 启用下拉刷新事件(注入 `onPullDownRefresh`;仍需在页面配置开启 enablePullDownRefresh)。
|
|
479
|
+
*/
|
|
480
|
+
enableOnPullDownRefresh?: boolean;
|
|
481
|
+
/**
|
|
482
|
+
* 启用触底事件(注入 `onReachBottom`)。
|
|
483
|
+
*/
|
|
484
|
+
enableOnReachBottom?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* 启用路由动画完成事件(注入 `onRouteDone`)。
|
|
487
|
+
*/
|
|
488
|
+
enableOnRouteDone?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* 启用 Tab 点击事件(注入 `onTabItemTap`)。
|
|
491
|
+
*/
|
|
492
|
+
enableOnTabItemTap?: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* 启用窗口尺寸变化事件(注入 `onResize`)。
|
|
495
|
+
*/
|
|
496
|
+
enableOnResize?: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* 启用“转发/分享给朋友”(注入 `onShareAppMessage`,使右上角菜单显示“转发”)。
|
|
499
|
+
*/
|
|
500
|
+
enableOnShareAppMessage?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* 启用“分享到朋友圈”(注入 `onShareTimeline`,使右上角菜单显示“分享到朋友圈”)。
|
|
503
|
+
*/
|
|
504
|
+
enableOnShareTimeline?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* 启用“收藏”(注入 `onAddToFavorites`)。
|
|
507
|
+
*/
|
|
508
|
+
enableOnAddToFavorites?: boolean;
|
|
509
|
+
/**
|
|
510
|
+
* 启用“退出状态保存”(注入 `onSaveExitState`)。
|
|
511
|
+
*/
|
|
512
|
+
enableOnSaveExitState?: boolean;
|
|
379
513
|
}
|
|
380
514
|
//#endregion
|
|
381
515
|
//#region src/runtime/app.d.ts
|
|
@@ -401,8 +535,7 @@ interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M
|
|
|
401
535
|
methods: M;
|
|
402
536
|
watch: Record<string, any> | undefined;
|
|
403
537
|
setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'];
|
|
404
|
-
mpOptions:
|
|
405
|
-
features?: DefineComponentOptions<ComponentPropsOptions, D, C, M>['features'];
|
|
538
|
+
mpOptions: MiniProgramComponentRawOptions;
|
|
406
539
|
};
|
|
407
540
|
}
|
|
408
541
|
/**
|
|
@@ -426,7 +559,6 @@ interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M
|
|
|
426
559
|
* @example
|
|
427
560
|
* ```ts
|
|
428
561
|
* defineComponent({
|
|
429
|
-
* features: { listenPageScroll: true },
|
|
430
562
|
* setup() {
|
|
431
563
|
* onPageScroll(() => {})
|
|
432
564
|
* }
|
|
@@ -440,28 +572,34 @@ declare function defineComponent<P$1 extends ComponentPropsOptions = ComponentPr
|
|
|
440
572
|
* @param options 组件选项,可能包含小程序特有的 properties
|
|
441
573
|
*/
|
|
442
574
|
declare function createWevuComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: DefineComponentOptions<ComponentPropsOptions, D, C, M> & {
|
|
443
|
-
properties?:
|
|
575
|
+
properties?: WechatMiniprogram.Component.PropertyOption;
|
|
444
576
|
}): void;
|
|
445
577
|
//#endregion
|
|
446
578
|
//#region src/runtime/hooks.d.ts
|
|
447
|
-
declare function getCurrentInstance():
|
|
579
|
+
declare function getCurrentInstance<T$1 extends InternalRuntimeState = InternalRuntimeState>(): T$1 | undefined;
|
|
448
580
|
declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
449
581
|
declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
450
582
|
declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
451
|
-
declare function onAppShow(handler: () => void): void;
|
|
583
|
+
declare function onAppShow(handler: (options: WechatMiniprogram.App.LaunchShowOption) => void): void;
|
|
452
584
|
declare function onAppHide(handler: () => void): void;
|
|
453
|
-
declare function onAppError(handler: (
|
|
585
|
+
declare function onAppError(handler: (error: string) => void): void;
|
|
454
586
|
declare function onShow(handler: () => void): void;
|
|
587
|
+
declare function onLoad(handler: WechatMiniprogram.Page.ILifetime['onLoad']): void;
|
|
455
588
|
declare function onHide(handler: () => void): void;
|
|
456
589
|
declare function onUnload(handler: () => void): void;
|
|
457
590
|
declare function onReady(handler: () => void): void;
|
|
458
|
-
declare function
|
|
459
|
-
declare function
|
|
460
|
-
declare function
|
|
461
|
-
declare function
|
|
462
|
-
declare function
|
|
463
|
-
declare function
|
|
464
|
-
declare function
|
|
591
|
+
declare function onPullDownRefresh(handler: WechatMiniprogram.Page.ILifetime['onPullDownRefresh']): void;
|
|
592
|
+
declare function onReachBottom(handler: WechatMiniprogram.Page.ILifetime['onReachBottom']): void;
|
|
593
|
+
declare function onPageScroll(handler: (opt: WechatMiniprogram.Page.IPageScrollOption) => void): void;
|
|
594
|
+
declare function onRouteDone(handler: WechatMiniprogram.Page.ILifetime['onRouteDone'] | ((opt?: unknown) => void)): void;
|
|
595
|
+
declare function onTabItemTap(handler: (opt: WechatMiniprogram.Page.ITabItemTapOption) => void): void;
|
|
596
|
+
declare function onResize(handler: (opt: WechatMiniprogram.Page.IResizeOption) => void): void;
|
|
597
|
+
declare function onMoved(handler: () => void): void;
|
|
598
|
+
declare function onError(handler: (err: any) => void): void;
|
|
599
|
+
declare function onSaveExitState(handler: () => WechatMiniprogram.Page.ISaveExitState): void;
|
|
600
|
+
declare function onShareAppMessage(handler: WechatMiniprogram.Page.ILifetime['onShareAppMessage']): void;
|
|
601
|
+
declare function onShareTimeline(handler: WechatMiniprogram.Page.ILifetime['onShareTimeline']): void;
|
|
602
|
+
declare function onAddToFavorites(handler: WechatMiniprogram.Page.ILifetime['onAddToFavorites']): void;
|
|
465
603
|
/**
|
|
466
604
|
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
467
605
|
*/
|
|
@@ -560,9 +698,11 @@ type WatchDescriptor = WatchHandler | string | {
|
|
|
560
698
|
};
|
|
561
699
|
type WatchMap = Record<string, WatchDescriptor>;
|
|
562
700
|
declare function runSetupFunction(setup: ((...args: any[]) => any) | undefined, props: Record<string, any>, context: any): any;
|
|
563
|
-
declare function mountRuntimeInstance<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(target: InternalRuntimeState, runtimeApp: RuntimeApp<D, C, M>, watchMap: WatchMap | undefined, setup?: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup']
|
|
701
|
+
declare function mountRuntimeInstance<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(target: InternalRuntimeState, runtimeApp: RuntimeApp<D, C, M>, watchMap: WatchMap | undefined, setup?: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], options?: {
|
|
702
|
+
deferSetData?: boolean;
|
|
703
|
+
}): RuntimeInstance<D, C, M>;
|
|
564
704
|
declare function teardownRuntimeInstance(target: InternalRuntimeState): void;
|
|
565
|
-
declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions:
|
|
566
|
-
declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions:
|
|
705
|
+
declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
706
|
+
declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions): void;
|
|
567
707
|
//#endregion
|
|
568
|
-
export { ActionSubscriber, AppConfig, ComponentDefinition, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, CreateAppOptions, DefineAppOptions, DefineComponentOptions, DefineStoreOptions, EffectScope, ExtractComputed, ExtractMethods, InferPropType, InferProps, InternalRuntimeState, MethodDefinitions, MiniProgramAdapter, ModelBinding, ModelBindingOptions, MutationType, PageFeatures, PropConstructor, PropOptions, PropType, Ref, RuntimeApp, RuntimeInstance, SetupContext, SetupFunction, StoreManager, SubscriptionCallback, ToRefs, WatchOptions, WatchStopHandle, WevuPlugin, WritableComputedOptions, WritableComputedRef, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getDeepWatchStrategy, inject, injectGlobal, isRaw, isReactive, isRef, isShallowReactive, isShallowRef, markRaw, mountRuntimeInstance, nextTick, onActivated, onAddToFavorites, onAppError, onAppHide, onAppShow, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onHide, onMounted, onPageScroll, onReady, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onUnload, onUnmounted, onUpdated, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, runSetupFunction, setCurrentInstance, setDeepWatchStrategy, shallowReactive, shallowRef, startBatch, stop, storeToRefs, teardownRuntimeInstance, toRaw, toRef, toRefs, touchReactive, traverse, triggerRef, unref, watch, watchEffect };
|
|
708
|
+
export { ActionSubscriber, AppConfig, ComponentDefinition, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, CreateAppOptions, DefineAppOptions, DefineComponentOptions, DefineStoreOptions, EffectScope, ExtractComputed, ExtractMethods, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, MethodDefinitions, MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentBehaviorOptions, MiniProgramComponentOptions, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes, ModelBinding, ModelBindingOptions, MutationType, PageFeatures, PropConstructor, PropOptions, PropType, Ref, RuntimeApp, RuntimeInstance, SetupContext, SetupFunction, StoreManager, SubscriptionCallback, ToRefs, TriggerEventOptions, WatchOptions, WatchStopHandle, WevuPlugin, WritableComputedOptions, WritableComputedRef, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getDeepWatchStrategy, inject, injectGlobal, isRaw, isReactive, isRef, isShallowReactive, isShallowRef, markRaw, mountRuntimeInstance, nextTick, onActivated, onAddToFavorites, onAppError, onAppHide, onAppShow, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onError, onErrorCaptured, onHide, onLoad, onMounted, onMoved, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onUnload, onUnmounted, onUpdated, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, runSetupFunction, setCurrentInstance, setDeepWatchStrategy, shallowReactive, shallowRef, startBatch, stop, storeToRefs, teardownRuntimeInstance, toRaw, toRef, toRefs, touchReactive, traverse, triggerRef, unref, watch, watchEffect };
|