wevu 7.2.0 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/package.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +2 -2
- package/dist/dev/api/vitest/setup.d.mts +0 -1
- package/dist/dev/api/vitest.d.mts +0 -1
- package/dist/dev/api.d.mts +0 -1
- package/dist/dev/compiler.d.mts +0 -1
- package/dist/dev/fetch.d.mts +0 -9
- package/dist/dev/index.d.mts +0 -72
- package/dist/dev/internal-reactivity.d.mts +0 -18
- package/dist/dev/internal-runtime.d.mts +0 -44
- package/dist/dev/internal-template.d.mts +0 -2
- package/dist/dev/jsxTypes.d.mts +0 -9
- package/dist/dev/macros/shared.d.mts +0 -83
- package/dist/dev/macros.d.mts +0 -71
- package/dist/dev/reactivity/asyncDerivation.d.mts +0 -41
- package/dist/dev/reactivity/computed.d.mts +0 -25
- package/dist/dev/reactivity/core.d.mts +0 -35
- package/dist/dev/reactivity/index.d.mts +0 -16
- package/dist/dev/reactivity/reactive/mutation.d.mts +0 -21
- package/dist/dev/reactivity/reactive/patch.d.mts +0 -18
- package/dist/dev/reactivity/reactive/shallow.d.mts +0 -22
- package/dist/dev/reactivity/reactive/shared.d.mts +0 -4
- package/dist/dev/reactivity/reactive.d.mts +0 -42
- package/dist/dev/reactivity/readonly.d.mts +0 -27
- package/dist/dev/reactivity/ref.d.mts +0 -27
- package/dist/dev/reactivity/shallowRef.d.mts +0 -19
- package/dist/dev/reactivity/toRefs.d.mts +0 -43
- package/dist/dev/reactivity/traverse.d.mts +0 -8
- package/dist/dev/reactivity/watch/types.d.mts +0 -43
- package/dist/dev/reactivity/watch.d.mts +0 -22
- package/dist/dev/router/auto-routes.d.mts +0 -8
- package/dist/dev/router/createRouter.d.mts +0 -9
- package/dist/dev/router/navigationCore.d.mts +0 -7
- package/dist/dev/router/resolve.d.mts +0 -7
- package/dist/dev/router/routeSync.d.mts +0 -2
- package/dist/dev/router/types.d.mts +0 -267
- package/dist/dev/router/useRoute.d.mts +0 -20
- package/dist/dev/router/useRouter.d.mts +0 -9
- package/dist/dev/router.d.mts +0 -26
- package/dist/dev/routerInternal/location.d.mts +0 -2
- package/dist/dev/routerInternal/matching.d.mts +0 -2
- package/dist/dev/routerInternal/params.d.mts +0 -2
- package/dist/dev/routerInternal/query.d.mts +0 -7
- package/dist/dev/routerInternal/records.d.mts +0 -2
- package/dist/dev/routerInternal/recordsWarnings.d.mts +0 -2
- package/dist/dev/routerInternal/shared.d.mts +0 -9
- package/dist/dev/routerInternal/snapshots.d.mts +0 -2
- package/dist/dev/routerInternal/types.d.mts +0 -9
- package/dist/dev/runtime/app/pending.d.mts +0 -10
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +0 -13
- package/dist/dev/runtime/app/setData/scheduler.d.mts +0 -51
- package/dist/dev/runtime/app.d.mts +0 -8
- package/dist/dev/runtime/capabilities.d.mts +0 -75
- package/dist/dev/runtime/css.d.mts +0 -14
- package/dist/dev/runtime/defaults.d.mts +0 -12
- package/dist/dev/runtime/define.d.mts +0 -118
- package/dist/dev/runtime/disposables.d.mts +0 -31
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +0 -26
- package/dist/dev/runtime/features/inlineEvents.d.mts +0 -7
- package/dist/dev/runtime/features/layout.d.mts +0 -7
- package/dist/dev/runtime/features/patchStrategy.d.mts +0 -7
- package/dist/dev/runtime/features/publicLayout.d.mts +0 -24
- package/dist/dev/runtime/features/scopedSlots.d.mts +0 -23
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +0 -7
- package/dist/dev/runtime/features/templateRefs.d.mts +0 -7
- package/dist/dev/runtime/hooks/base.d.mts +0 -27
- package/dist/dev/runtime/hooks/register.d.mts +0 -30
- package/dist/dev/runtime/hooks/vue.d.mts +0 -52
- package/dist/dev/runtime/hooks.d.mts +0 -4
- package/dist/dev/runtime/index.d.mts +0 -46
- package/dist/dev/runtime/intersectionObserver.d.mts +0 -14
- package/dist/dev/runtime/jsxIsland.d.mts +0 -37
- package/dist/dev/runtime/layoutBridge.d.mts +0 -55
- package/dist/dev/runtime/noSetData.d.mts +0 -5
- package/dist/dev/runtime/pageEnvironment.d.mts +0 -50
- package/dist/dev/runtime/pageLayout.d.mts +0 -25
- package/dist/dev/runtime/pageScroll.d.mts +0 -29
- package/dist/dev/runtime/provide.d.mts +0 -60
- package/dist/dev/runtime/provideStore.d.mts +0 -7
- package/dist/dev/runtime/publicRuntime.d.mts +0 -22
- package/dist/dev/runtime/pullDownRefresh.d.mts +0 -12
- package/dist/dev/runtime/register/app.d.mts +0 -14
- package/dist/dev/runtime/register/component.d.mts +0 -17
- package/dist/dev/runtime/register/inline.d.mts +0 -15
- package/dist/dev/runtime/register/runtimeInstance.d.mts +0 -26
- package/dist/dev/runtime/register/setup.d.mts +0 -11
- package/dist/dev/runtime/register/watch.d.mts +0 -12
- package/dist/dev/runtime/register.d.mts +0 -5
- package/dist/dev/runtime/selectorQuery.d.mts +0 -54
- package/dist/dev/runtime/template.d.mts +0 -6
- package/dist/dev/runtime/templateRefTypes.d.mts +0 -12
- package/dist/dev/runtime/types/core.d.mts +0 -35
- package/dist/dev/runtime/types/miniprogram.d.mts +0 -84
- package/dist/dev/runtime/types/miniprogramHost.d.mts +0 -45
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +0 -112
- package/dist/dev/runtime/types/options.d.mts +0 -138
- package/dist/dev/runtime/types/props/propTypes.d.mts +0 -79
- package/dist/dev/runtime/types/props/router.d.mts +0 -51
- package/dist/dev/runtime/types/props/setup.d.mts +0 -96
- package/dist/dev/runtime/types/props.d.mts +0 -4
- package/dist/dev/runtime/types/runtime.d.mts +0 -59
- package/dist/dev/runtime/types/setData.d.mts +0 -237
- package/dist/dev/runtime/types.d.mts +0 -29
- package/dist/dev/runtime/uniAppHost.d.mts +0 -8
- package/dist/dev/runtime/updatePerformance.d.mts +0 -13
- package/dist/dev/runtime/use.d.mts +0 -13
- package/dist/dev/runtime/vueCompat/context.d.mts +0 -8
- package/dist/dev/runtime/vueCompat/model.d.mts +0 -30
- package/dist/dev/runtime/vueCompat/router.d.mts +0 -29
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +0 -9
- package/dist/dev/runtime/vueCompat.d.mts +0 -5
- package/dist/dev/scheduler.d.mts +0 -4
- package/dist/dev/store/define.d.mts +0 -8
- package/dist/dev/store/manager.d.mts +0 -16
- package/dist/dev/store/storeToRefs.d.mts +0 -11
- package/dist/dev/store/types.d.mts +0 -106
- package/dist/dev/store.d.mts +0 -5
- package/dist/dev/version.d.mts +0 -4
- package/dist/dev/vue-augment.d.mts +0 -8
- package/dist/dev/vue-demi.d.mts +0 -87
- package/dist/dev/vue-types.d.mts +0 -19
- package/dist/dev/web-apis.d.mts +0 -3
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult } from "./miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/miniprogram.d.ts
|
|
3
|
-
export interface MiniProgramAdapter {
|
|
4
|
-
/**
|
|
5
|
-
* 下发视图数据。返回 `void` 表示同步完成;异步适配器必须返回在宿主提交后兑现的 Promise。
|
|
6
|
-
*/
|
|
7
|
-
setData?: (payload: Record<string, any>) => void | Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
type MpComponentOptions = HostMiniProgramComponentTrivialOption;
|
|
10
|
-
export type MiniProgramBehaviorIdentifier = HostMiniProgramBehaviorIdentifier | string;
|
|
11
|
-
export type MiniProgramComponentPropertyValue<TProperty extends HostMiniProgramComponentAllFullProperty> = HostMiniProgramComponentPropertyValue<TProperty>;
|
|
12
|
-
export type MiniProgramComponentInstance<D extends object, P extends HostMiniProgramComponentPropertyOption, M extends HostMiniProgramComponentMethodOption, B extends HostMiniProgramComponentEmptyArray = HostMiniProgramComponentEmptyArray> = HostMiniProgramComponentInstance<D, P, M, B>;
|
|
13
|
-
export interface MiniProgramComponentOptions {
|
|
14
|
-
/**
|
|
15
|
-
* 类似于 mixins/traits 的组件间代码复用机制(behaviors)。
|
|
16
|
-
*/
|
|
17
|
-
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
18
|
-
/**
|
|
19
|
-
* 组件接受的外部样式类。
|
|
20
|
-
*/
|
|
21
|
-
externalClasses?: MpComponentOptions['externalClasses'];
|
|
22
|
-
/**
|
|
23
|
-
* 组件间关系定义。
|
|
24
|
-
*/
|
|
25
|
-
relations?: MpComponentOptions['relations'];
|
|
26
|
-
/**
|
|
27
|
-
* 组件数据字段监听器,用于监听 properties 和 data 的变化。
|
|
28
|
-
*/
|
|
29
|
-
observers?: MpComponentOptions['observers'];
|
|
30
|
-
/**
|
|
31
|
-
* 组件生命周期声明对象:
|
|
32
|
-
* `created`/`attached`/`ready`/`moved`/`detached`/`error`。
|
|
33
|
-
*
|
|
34
|
-
* 注意:wevu 会在 `attached/ready/detached/moved/error` 阶段做桥接与包装。
|
|
35
|
-
* setup 默认在 `attached` 执行,可通过 `setupLifecycle = "created"` 切换回旧行为。
|
|
36
|
-
*/
|
|
37
|
-
lifetimes?: MpComponentOptions['lifetimes'];
|
|
38
|
-
/**
|
|
39
|
-
* 组件所在页面的生命周期声明对象:`show`/`hide`/`resize`/`routeDone`。
|
|
40
|
-
*/
|
|
41
|
-
pageLifetimes?: MpComponentOptions['pageLifetimes'];
|
|
42
|
-
/**
|
|
43
|
-
* 组件选项(multipleSlots/styleIsolation/pureDataPattern/virtualHost 等)。
|
|
44
|
-
*/
|
|
45
|
-
options?: MpComponentOptions['options'];
|
|
46
|
-
/**
|
|
47
|
-
* 定义段过滤器,用于自定义组件扩展。
|
|
48
|
-
*/
|
|
49
|
-
definitionFilter?: MpComponentOptions['definitionFilter'];
|
|
50
|
-
/**
|
|
51
|
-
* 组件自定义导出:当使用组件导出 behavior(例如微信中的 `wx://component-export`)时,
|
|
52
|
-
* 可用于指定组件被 selectComponent 调用时的返回值。
|
|
53
|
-
*
|
|
54
|
-
* wevu 默认会将 setup() 中通过 `expose()` 写入的内容作为 export() 返回值,
|
|
55
|
-
* 因此大多数情况下无需手动编写 export();若同时提供 export(),则会与 expose() 结果浅合并。
|
|
56
|
-
*/
|
|
57
|
-
export?: MpComponentOptions['export'];
|
|
58
|
-
/**
|
|
59
|
-
* 原生 properties(与 wevu 的 props 不同)。
|
|
60
|
-
*
|
|
61
|
-
* - 推荐:使用 wevu 的 `props` 选项,让运行时规范化为小程序 `properties`。
|
|
62
|
-
* - 兼容:也可以直接传入小程序 `properties`。
|
|
63
|
-
*/
|
|
64
|
-
properties?: MpComponentOptions['properties'];
|
|
65
|
-
/**
|
|
66
|
-
* 旧式生命周期(基础库 `2.2.3` 起推荐使用 `lifetimes` 字段)。
|
|
67
|
-
* 保留以增强类型提示与兼容性。
|
|
68
|
-
*/
|
|
69
|
-
created?: MpComponentOptions['created'];
|
|
70
|
-
attached?: MpComponentOptions['attached'];
|
|
71
|
-
ready?: MpComponentOptions['ready'];
|
|
72
|
-
moved?: MpComponentOptions['moved'];
|
|
73
|
-
detached?: MpComponentOptions['detached'];
|
|
74
|
-
error?: MpComponentOptions['error'];
|
|
75
|
-
}
|
|
76
|
-
export type MiniProgramAppOptions<T extends Record<string, any> = Record<string, any>> = HostMiniProgramAppOptions<T>;
|
|
77
|
-
export type MiniProgramInstance = HostMiniProgramComponentTrivialInstance | HostMiniProgramPageTrivialInstance | HostMiniProgramAppTrivialInstance;
|
|
78
|
-
export type MiniProgramPageLifetimes = Partial<HostMiniProgramPageLifetime>;
|
|
79
|
-
export type MiniProgramComponentRawOptions = Omit<HostMiniProgramComponentTrivialOption, 'behaviors'> & {
|
|
80
|
-
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
81
|
-
} & MiniProgramPageLifetimes & Record<string, any>;
|
|
82
|
-
//#endregion
|
|
83
|
-
export type { HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime as MiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter as MiniProgramRouter, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, HostMiniProgramTriggerEventOptions as TriggerEventOptions };
|
|
84
|
-
//# sourceMappingURL=miniprogram.d.mts.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./miniprogramHostSources.mjs";
|
|
2
|
-
//#region src/runtime/types/miniprogramHost.d.ts
|
|
3
|
-
export type HostMiniProgramComponentBehaviorOptions = MiniProgramHostNamespace.Component.ComponentOptions;
|
|
4
|
-
export type HostMiniProgramComponentTrivialOption = MiniProgramHostNamespace.Component.TrivialOption;
|
|
5
|
-
export type HostMiniProgramBehaviorIdentifier = MiniProgramHostNamespace.Behavior.Identifier;
|
|
6
|
-
export type HostMiniProgramLaunchOptions = MiniProgramHostNamespace.App.LaunchShowOption;
|
|
7
|
-
export type HostMiniProgramPageNotFoundOptions = MiniProgramHostNamespace.App.PageNotFoundOption;
|
|
8
|
-
export type HostMiniProgramUnhandledRejectionResult = MiniProgramHostNamespace.OnUnhandledRejectionListenerResult;
|
|
9
|
-
export type HostMiniProgramThemeChangeResult = MiniProgramHostNamespace.OnThemeChangeListenerResult;
|
|
10
|
-
export type HostMiniProgramMemoryWarningResult = MiniProgramHostNamespace.OnMemoryWarningListenerResult;
|
|
11
|
-
export type HostMiniProgramPageScrollOption = MiniProgramHostNamespace.Page.IPageScrollOption;
|
|
12
|
-
export type HostMiniProgramTabItemTapOption = MiniProgramHostNamespace.Page.ITabItemTapOption;
|
|
13
|
-
export type HostMiniProgramPageResizeOption = MiniProgramHostNamespace.Page.IResizeOption;
|
|
14
|
-
export type HostMiniProgramShareAppMessageOption = MiniProgramHostNamespace.Page.IShareAppMessageOption;
|
|
15
|
-
export type HostMiniProgramAddToFavoritesOption = MiniProgramHostNamespace.Page.IAddToFavoritesOption;
|
|
16
|
-
export type HostMiniProgramSaveExitState = MiniProgramHostNamespace.Page.ISaveExitState;
|
|
17
|
-
export type HostMiniProgramRouter = MiniProgramHostNamespace.Component.Router;
|
|
18
|
-
export type HostMiniProgramSwitchTabOption = MiniProgramHostNamespace.SwitchTabOption;
|
|
19
|
-
export type HostMiniProgramReLaunchOption = MiniProgramHostNamespace.ReLaunchOption;
|
|
20
|
-
export type HostMiniProgramRedirectToOption = MiniProgramHostNamespace.RedirectToOption;
|
|
21
|
-
export type HostMiniProgramNavigateToOption = MiniProgramHostNamespace.NavigateToOption;
|
|
22
|
-
export type HostMiniProgramPageLifetime = MiniProgramHostNamespace.Page.ILifetime;
|
|
23
|
-
export type HostMiniProgramNodesRef = MiniProgramHostNamespace.NodesRef;
|
|
24
|
-
export type HostMiniProgramNodesRefFields = Parameters<HostMiniProgramNodesRef['fields']>[0];
|
|
25
|
-
export type HostMiniProgramBoundingClientRectResult = MiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
26
|
-
export type HostMiniProgramScrollOffsetResult = MiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
27
|
-
export type HostMiniProgramSelectorQuery = MiniProgramHostNamespace.SelectorQuery;
|
|
28
|
-
export type HostMiniProgramIntersectionObserverOptions = MiniProgramHostNamespace.CreateIntersectionObserverOption;
|
|
29
|
-
export type HostMiniProgramIntersectionObserver = MiniProgramHostNamespace.IntersectionObserver;
|
|
30
|
-
export type HostMiniProgramComponentPropertyOption = MiniProgramHostNamespace.Component.PropertyOption;
|
|
31
|
-
export type HostMiniProgramComponentMethodOption = MiniProgramHostNamespace.Component.MethodOption;
|
|
32
|
-
export type HostMiniProgramComponentEmptyArray = MiniProgramHostNamespace.Component.IEmptyArray;
|
|
33
|
-
export type HostMiniProgramComponentAllProperty = MiniProgramHostNamespace.Component.AllProperty;
|
|
34
|
-
export type HostMiniProgramComponentAllFullProperty = MiniProgramHostNamespace.Component.AllFullProperty;
|
|
35
|
-
export type HostMiniProgramComponentShortProperty = MiniProgramHostNamespace.Component.ShortProperty;
|
|
36
|
-
export type HostMiniProgramComponentPropertyValue<TProperty extends HostMiniProgramComponentAllFullProperty> = MiniProgramHostNamespace.Component.PropertyToData<TProperty>;
|
|
37
|
-
export type HostMiniProgramComponentInstance<D extends object, P extends HostMiniProgramComponentPropertyOption, M extends HostMiniProgramComponentMethodOption, B extends HostMiniProgramComponentEmptyArray = HostMiniProgramComponentEmptyArray> = MiniProgramHostNamespace.Component.Instance<D, P, M, B>;
|
|
38
|
-
export type HostMiniProgramTriggerEventOptions = MiniProgramHostNamespace.Component.TriggerEventOption;
|
|
39
|
-
export type HostMiniProgramAppOptions<T extends Record<string, any>> = MiniProgramHostNamespace.App.Options<T>;
|
|
40
|
-
export type HostMiniProgramComponentTrivialInstance = MiniProgramHostNamespace.Component.TrivialInstance;
|
|
41
|
-
export type HostMiniProgramPageTrivialInstance = MiniProgramHostNamespace.Page.TrivialInstance;
|
|
42
|
-
export type HostMiniProgramAppTrivialInstance = MiniProgramHostNamespace.App.TrivialInstance;
|
|
43
|
-
//#endregion
|
|
44
|
-
export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract };
|
|
45
|
-
//# sourceMappingURL=miniprogramHost.d.mts.map
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/types/miniprogramHostSources.d.ts
|
|
2
|
-
export declare namespace WechatMiniProgramHostNamespace {
|
|
3
|
-
export import App = WechatMiniprogram.App;
|
|
4
|
-
export import Behavior = WechatMiniprogram.Behavior;
|
|
5
|
-
export import Component = WechatMiniprogram.Component;
|
|
6
|
-
export import Page = WechatMiniprogram.Page;
|
|
7
|
-
export import BoundingClientRectCallbackResult = WechatMiniprogram.BoundingClientRectCallbackResult;
|
|
8
|
-
export import ScrollOffsetCallbackResult = WechatMiniprogram.ScrollOffsetCallbackResult;
|
|
9
|
-
export import NodesRef = WechatMiniprogram.NodesRef;
|
|
10
|
-
export import SelectorQuery = WechatMiniprogram.SelectorQuery;
|
|
11
|
-
export import CreateIntersectionObserverOption = WechatMiniprogram.CreateIntersectionObserverOption;
|
|
12
|
-
export import IntersectionObserver = WechatMiniprogram.IntersectionObserver;
|
|
13
|
-
export import OnUnhandledRejectionListenerResult = WechatMiniprogram.OnUnhandledRejectionListenerResult;
|
|
14
|
-
export import OnThemeChangeListenerResult = WechatMiniprogram.OnThemeChangeListenerResult;
|
|
15
|
-
export import OnMemoryWarningListenerResult = WechatMiniprogram.OnMemoryWarningListenerResult;
|
|
16
|
-
export import SwitchTabOption = WechatMiniprogram.SwitchTabOption;
|
|
17
|
-
export import ReLaunchOption = WechatMiniprogram.ReLaunchOption;
|
|
18
|
-
export import RedirectToOption = WechatMiniprogram.RedirectToOption;
|
|
19
|
-
export import NavigateToOption = WechatMiniprogram.NavigateToOption;
|
|
20
|
-
}
|
|
21
|
-
export declare namespace AlipayMiniProgramHostNamespace {}
|
|
22
|
-
export declare namespace DouyinMiniProgramHostNamespace {}
|
|
23
|
-
export declare namespace TtMiniProgramHostNamespace {}
|
|
24
|
-
export declare namespace DefaultMiniProgramHostNamespace {
|
|
25
|
-
export import App = WechatMiniProgramHostNamespace.App;
|
|
26
|
-
export import Behavior = WechatMiniProgramHostNamespace.Behavior;
|
|
27
|
-
export import Component = WechatMiniProgramHostNamespace.Component;
|
|
28
|
-
export import Page = WechatMiniProgramHostNamespace.Page;
|
|
29
|
-
export import BoundingClientRectCallbackResult = WechatMiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
30
|
-
export import ScrollOffsetCallbackResult = WechatMiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
31
|
-
export import NodesRef = WechatMiniProgramHostNamespace.NodesRef;
|
|
32
|
-
export import SelectorQuery = WechatMiniProgramHostNamespace.SelectorQuery;
|
|
33
|
-
export import CreateIntersectionObserverOption = WechatMiniProgramHostNamespace.CreateIntersectionObserverOption;
|
|
34
|
-
export import IntersectionObserver = WechatMiniProgramHostNamespace.IntersectionObserver;
|
|
35
|
-
export import OnUnhandledRejectionListenerResult = WechatMiniProgramHostNamespace.OnUnhandledRejectionListenerResult;
|
|
36
|
-
export import OnThemeChangeListenerResult = WechatMiniProgramHostNamespace.OnThemeChangeListenerResult;
|
|
37
|
-
export import OnMemoryWarningListenerResult = WechatMiniProgramHostNamespace.OnMemoryWarningListenerResult;
|
|
38
|
-
export import SwitchTabOption = WechatMiniProgramHostNamespace.SwitchTabOption;
|
|
39
|
-
export import ReLaunchOption = WechatMiniProgramHostNamespace.ReLaunchOption;
|
|
40
|
-
export import RedirectToOption = WechatMiniProgramHostNamespace.RedirectToOption;
|
|
41
|
-
export import NavigateToOption = WechatMiniProgramHostNamespace.NavigateToOption;
|
|
42
|
-
}
|
|
43
|
-
export declare namespace MiniProgramHostNamespace {
|
|
44
|
-
export import App = DefaultMiniProgramHostNamespace.App;
|
|
45
|
-
export import Behavior = DefaultMiniProgramHostNamespace.Behavior;
|
|
46
|
-
export import Component = DefaultMiniProgramHostNamespace.Component;
|
|
47
|
-
export import Page = DefaultMiniProgramHostNamespace.Page;
|
|
48
|
-
export import BoundingClientRectCallbackResult = DefaultMiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
49
|
-
export import ScrollOffsetCallbackResult = DefaultMiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
50
|
-
export import NodesRef = DefaultMiniProgramHostNamespace.NodesRef;
|
|
51
|
-
export import SelectorQuery = DefaultMiniProgramHostNamespace.SelectorQuery;
|
|
52
|
-
export import CreateIntersectionObserverOption = DefaultMiniProgramHostNamespace.CreateIntersectionObserverOption;
|
|
53
|
-
export import IntersectionObserver = DefaultMiniProgramHostNamespace.IntersectionObserver;
|
|
54
|
-
export import OnUnhandledRejectionListenerResult = DefaultMiniProgramHostNamespace.OnUnhandledRejectionListenerResult;
|
|
55
|
-
export import OnThemeChangeListenerResult = DefaultMiniProgramHostNamespace.OnThemeChangeListenerResult;
|
|
56
|
-
export import OnMemoryWarningListenerResult = DefaultMiniProgramHostNamespace.OnMemoryWarningListenerResult;
|
|
57
|
-
export import SwitchTabOption = DefaultMiniProgramHostNamespace.SwitchTabOption;
|
|
58
|
-
export import ReLaunchOption = DefaultMiniProgramHostNamespace.ReLaunchOption;
|
|
59
|
-
export import RedirectToOption = DefaultMiniProgramHostNamespace.RedirectToOption;
|
|
60
|
-
export import NavigateToOption = DefaultMiniProgramHostNamespace.NavigateToOption;
|
|
61
|
-
}
|
|
62
|
-
export type MiniProgramPlatformHostSourceName = 'default' | 'wechat' | 'alipay' | 'douyin';
|
|
63
|
-
export type MiniProgramRuntimeHostSourceName = 'wx' | 'my' | 'tt';
|
|
64
|
-
export type MiniProgramHostSourceName = MiniProgramPlatformHostSourceName | MiniProgramRuntimeHostSourceName;
|
|
65
|
-
export interface DefaultMiniProgramHostSourceContract {
|
|
66
|
-
BoundingClientRectCallbackResult: DefaultMiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
67
|
-
ScrollOffsetCallbackResult: DefaultMiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
68
|
-
NodesRef: DefaultMiniProgramHostNamespace.NodesRef;
|
|
69
|
-
SelectorQuery: DefaultMiniProgramHostNamespace.SelectorQuery;
|
|
70
|
-
CreateIntersectionObserverOption: DefaultMiniProgramHostNamespace.CreateIntersectionObserverOption;
|
|
71
|
-
IntersectionObserver: DefaultMiniProgramHostNamespace.IntersectionObserver;
|
|
72
|
-
OnUnhandledRejectionListenerResult: DefaultMiniProgramHostNamespace.OnUnhandledRejectionListenerResult;
|
|
73
|
-
OnThemeChangeListenerResult: DefaultMiniProgramHostNamespace.OnThemeChangeListenerResult;
|
|
74
|
-
OnMemoryWarningListenerResult: DefaultMiniProgramHostNamespace.OnMemoryWarningListenerResult;
|
|
75
|
-
SwitchTabOption: DefaultMiniProgramHostNamespace.SwitchTabOption;
|
|
76
|
-
ReLaunchOption: DefaultMiniProgramHostNamespace.ReLaunchOption;
|
|
77
|
-
RedirectToOption: DefaultMiniProgramHostNamespace.RedirectToOption;
|
|
78
|
-
NavigateToOption: DefaultMiniProgramHostNamespace.NavigateToOption;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @description 微信平台命名兼容契约;当前默认宿主语义仍复用微信底座,但上层主链路应优先依赖 default。
|
|
82
|
-
*/
|
|
83
|
-
export interface WechatMiniProgramHostSourceContract extends DefaultMiniProgramHostSourceContract {}
|
|
84
|
-
/**
|
|
85
|
-
* @description 支付宝宿主类型契约占位;后续接入稳定 typings 时在此扩展。
|
|
86
|
-
*/
|
|
87
|
-
export interface AlipayMiniProgramHostSourceContract extends Record<never, never> {}
|
|
88
|
-
/**
|
|
89
|
-
* @description 抖音宿主类型契约占位;后续接入稳定 typings 时在此扩展。
|
|
90
|
-
*/
|
|
91
|
-
export interface DouyinMiniProgramHostSourceContract extends Record<never, never> {}
|
|
92
|
-
/**
|
|
93
|
-
* @description `tt` 命名兼容入口,保持与抖音宿主语义主名一致。
|
|
94
|
-
*/
|
|
95
|
-
export interface TtMiniProgramHostSourceContract extends DouyinMiniProgramHostSourceContract {}
|
|
96
|
-
export interface MiniProgramPlatformHostSourceRegistry {
|
|
97
|
-
default: DefaultMiniProgramHostSourceContract;
|
|
98
|
-
wechat: WechatMiniProgramHostSourceContract;
|
|
99
|
-
alipay: AlipayMiniProgramHostSourceContract;
|
|
100
|
-
douyin: DouyinMiniProgramHostSourceContract;
|
|
101
|
-
}
|
|
102
|
-
export interface MiniProgramRuntimeHostSourceRegistry {
|
|
103
|
-
wx: DefaultMiniProgramHostSourceContract;
|
|
104
|
-
my: AlipayMiniProgramHostSourceContract;
|
|
105
|
-
tt: TtMiniProgramHostSourceContract;
|
|
106
|
-
}
|
|
107
|
-
export interface MiniProgramHostSourceRegistry extends MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostSourceRegistry {}
|
|
108
|
-
export type MiniProgramPlatformHostNamespaceBySource<TSourceName extends MiniProgramPlatformHostSourceName = MiniProgramPlatformHostSourceName> = MiniProgramPlatformHostSourceRegistry[TSourceName];
|
|
109
|
-
export type MiniProgramRuntimeHostNamespaceBySource<TSourceName extends MiniProgramRuntimeHostSourceName = MiniProgramRuntimeHostSourceName> = MiniProgramRuntimeHostSourceRegistry[TSourceName];
|
|
110
|
-
export type MiniProgramHostNamespaceBySource<TSourceName extends MiniProgramHostSourceName = MiniProgramHostSourceName> = MiniProgramHostSourceRegistry[TSourceName];
|
|
111
|
-
//#endregion
|
|
112
|
-
//# sourceMappingURL=miniprogramHostSources.d.mts.map
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { MiniProgramAppOptions, MiniProgramComponentOptions, MiniProgramPageLifetimes } from "./miniprogram.mjs";
|
|
2
|
-
import { ComponentPropsOptions, InferProps } from "./props/propTypes.mjs";
|
|
3
|
-
import { ComponentPublicInstance, ComputedDefinitions, MethodDefinitions } from "./core.mjs";
|
|
4
|
-
import { SetupContext, SetupFunction } from "./props/setup.mjs";
|
|
5
|
-
import "./props.mjs";
|
|
6
|
-
import { ShallowUnwrapRef } from "../../vue-types.mjs";
|
|
7
|
-
import { SetDataSnapshotOptions } from "./setData.mjs";
|
|
8
|
-
//#region src/runtime/types/options.d.ts
|
|
9
|
-
export type DataOption<D extends object> = D | (() => D);
|
|
10
|
-
type SetupThis<S> = [Exclude<S, void>] extends [never] ? Record<never, never> : ShallowUnwrapRef<Exclude<S, void>>;
|
|
11
|
-
export interface DefineComponentOptions<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void> extends MiniProgramComponentOptions, MiniProgramPageLifetimes {
|
|
12
|
-
/**
|
|
13
|
-
* 页面特性开关(用于按需注入 Page 事件处理函数)。
|
|
14
|
-
*
|
|
15
|
-
* 说明:小程序的部分页面事件/菜单项具有“按需派发/按需展示”特性,
|
|
16
|
-
* 只有定义了对应的 `onXXX` 方法才会触发/展示(如 `onPageScroll`、`onShareTimeline`)。
|
|
17
|
-
* 因此 wevu 需要在注册阶段(Component())就决定是否注入这些 onXXX。
|
|
18
|
-
*
|
|
19
|
-
* - 若你在 options 中显式定义了原生 `onXXX`,wevu 会自动桥接对应 hook(无需 features)。
|
|
20
|
-
* - 若你只想在 `setup()` 里使用 wevu hook(不额外写原生 `onXXX`),则通过 `features` 显式开启注入。
|
|
21
|
-
*/
|
|
22
|
-
features?: PageFeatures;
|
|
23
|
-
/**
|
|
24
|
-
* 类 Vue 的 props 定义(会被规范化为小程序 `properties`)
|
|
25
|
-
*/
|
|
26
|
-
props?: P;
|
|
27
|
-
/**
|
|
28
|
-
* 兼容 Vue props 的 `undefined -> null` 传输,对可选、可空或联合类型使用无主类型约束的原生属性,避免提前转换。
|
|
29
|
-
*
|
|
30
|
-
* 默认关闭;显式原生 `properties` 始终原样传递,必填且不可空的单一类型仍保持原生类型约束。
|
|
31
|
-
*/
|
|
32
|
-
allowNullPropInput?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* 允许函数值作为组件 prop 通过小程序 data/properties 链路传递。
|
|
35
|
-
*
|
|
36
|
-
* - `auto` / undefined:默认由 SFC 编译器精确标记模板中的函数 prop 绑定。
|
|
37
|
-
* - `true`:手写组件或动态传参场景下全量允许函数进入快照。
|
|
38
|
-
* - `false`:关闭函数 prop 快照放行。
|
|
39
|
-
*/
|
|
40
|
-
allowFunctionProps?: boolean | 'auto';
|
|
41
|
-
watch?: Record<string, any>;
|
|
42
|
-
setup?: SetupFunction<P, D, C, M, S>;
|
|
43
|
-
/**
|
|
44
|
-
* setup 执行时机:
|
|
45
|
-
* - created:与旧行为一致(默认 defer setData 到 attached)
|
|
46
|
-
* - attached:更接近 Vue 3(props 在 attached 时已就绪)
|
|
47
|
-
*
|
|
48
|
-
* @default 'attached'
|
|
49
|
-
*/
|
|
50
|
-
setupLifecycle?: 'created' | 'attached';
|
|
51
|
-
/**
|
|
52
|
-
* 组件 data(建议使用函数返回初始值)。
|
|
53
|
-
*/
|
|
54
|
-
data?: DataOption<D>;
|
|
55
|
-
/**
|
|
56
|
-
* 组件 computed(会参与快照 diff)。
|
|
57
|
-
*/
|
|
58
|
-
computed?: C & ThisType<ComponentPublicInstance<D, C, M, InferProps<P>> & SetupThis<S>>;
|
|
59
|
-
/**
|
|
60
|
-
* setData 快照控制选项(用于优化性能与 payload)。
|
|
61
|
-
*/
|
|
62
|
-
setData?: SetDataSnapshotOptions;
|
|
63
|
-
/**
|
|
64
|
-
* 组件 methods(会绑定到 public instance 上)。
|
|
65
|
-
*/
|
|
66
|
-
methods?: M & ThisType<ComponentPublicInstance<D, C, M, InferProps<P>> & SetupThis<S>>;
|
|
67
|
-
/**
|
|
68
|
-
* 透传/扩展字段:允许携带其他小程序原生 Component 选项或自定义字段。
|
|
69
|
-
* 说明:为保持兼容性保留索引签名,但仍会对已知字段提供智能提示。
|
|
70
|
-
*/
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}
|
|
73
|
-
type AppSetupProps = {};
|
|
74
|
-
export interface DefineAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramAppOptions {
|
|
75
|
-
watch?: Record<string, any>;
|
|
76
|
-
setup?: (props: AppSetupProps, ctx: SetupContext<D, C, M, AppSetupProps>) => Record<string, any> | void;
|
|
77
|
-
[key: string]: any;
|
|
78
|
-
}
|
|
79
|
-
export interface CreateAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramAppOptions {
|
|
80
|
-
data?: DataOption<D>;
|
|
81
|
-
computed?: C;
|
|
82
|
-
methods?: M;
|
|
83
|
-
setData?: SetDataSnapshotOptions;
|
|
84
|
-
watch?: Record<string, any>;
|
|
85
|
-
setup?: (props: AppSetupProps, ctx: SetupContext<D, C, M, AppSetupProps>) => Record<string, any> | void;
|
|
86
|
-
[key: string]: any;
|
|
87
|
-
}
|
|
88
|
-
export interface PageFeatures {
|
|
89
|
-
/**
|
|
90
|
-
* 启用页面滚动事件(注入 `onPageScroll`)。
|
|
91
|
-
*/
|
|
92
|
-
enableOnPageScroll?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* 启用下拉刷新事件(注入 `onPullDownRefresh`;仍需在页面配置开启 enablePullDownRefresh)。
|
|
95
|
-
*/
|
|
96
|
-
enableOnPullDownRefresh?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* 启用触底事件(注入 `onReachBottom`)。
|
|
99
|
-
*/
|
|
100
|
-
enableOnReachBottom?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* 启用路由动画完成事件(注入 `onRouteDone`)。
|
|
103
|
-
*/
|
|
104
|
-
enableOnRouteDone?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* 启用 onReady 阶段的 routeDone 兜底补发。
|
|
107
|
-
*
|
|
108
|
-
* 默认关闭:保持与微信小程序平台事件更一致的行为。
|
|
109
|
-
* 仅当个别 IDE/基础库未派发 routeDone 且业务确实依赖该时机时再开启。
|
|
110
|
-
*/
|
|
111
|
-
enableOnRouteDoneFallback?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* 启用 Tab 点击事件(注入 `onTabItemTap`)。
|
|
114
|
-
*/
|
|
115
|
-
enableOnTabItemTap?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* 启用窗口尺寸变化事件(注入 `onResize`)。
|
|
118
|
-
*/
|
|
119
|
-
enableOnResize?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* 启用“转发/分享给朋友”(注入 `onShareAppMessage`,使右上角菜单显示“转发”)。
|
|
122
|
-
*/
|
|
123
|
-
enableOnShareAppMessage?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* 启用“分享到朋友圈”(注入 `onShareTimeline`,使右上角菜单显示“分享到朋友圈”)。
|
|
126
|
-
*/
|
|
127
|
-
enableOnShareTimeline?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* 启用“收藏”(注入 `onAddToFavorites`)。
|
|
130
|
-
*/
|
|
131
|
-
enableOnAddToFavorites?: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* 启用“退出状态保存”(注入 `onSaveExitState`)。
|
|
134
|
-
*/
|
|
135
|
-
enableOnSaveExitState?: boolean;
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//# sourceMappingURL=options.d.mts.map
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { HostMiniProgramComponentAllProperty, HostMiniProgramComponentShortProperty } from "../miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/props/propTypes.d.ts
|
|
3
|
-
type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
|
|
4
|
-
new (): TConstructor;
|
|
5
|
-
(): T;
|
|
6
|
-
readonly prototype: TConstructor;
|
|
7
|
-
} : never;
|
|
8
|
-
export type PropConstructor<T = any> = {
|
|
9
|
-
new (...args: any[]): T & {};
|
|
10
|
-
} | {
|
|
11
|
-
(): T;
|
|
12
|
-
} | PropMethod<T>;
|
|
13
|
-
export type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
|
14
|
-
type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
15
|
-
export type ComponentPropsOptions = Record<string, PropOptions<any> | PropType<any> | null>;
|
|
16
|
-
export interface NativeTypeHint<T = any> {
|
|
17
|
-
readonly __wevuNativeType?: T;
|
|
18
|
-
}
|
|
19
|
-
export type NativePropsOptions = Record<string, HostMiniProgramComponentAllProperty | NativeTypeHint<any>>;
|
|
20
|
-
export type NativePropType<T = any, C extends HostMiniProgramComponentShortProperty = StringConstructor> = C & NativeTypeHint<T>;
|
|
21
|
-
export type NativeTypedProperty<T = any, P extends HostMiniProgramComponentAllProperty = HostMiniProgramComponentAllProperty> = P & NativeTypeHint<T>;
|
|
22
|
-
export interface PropOptions<T = any, D = T> {
|
|
23
|
-
type?: PropType<T> | true | null;
|
|
24
|
-
optionalTypes?: Array<HostMiniProgramComponentShortProperty | PropConstructor<any>>;
|
|
25
|
-
/**
|
|
26
|
-
* 默认值(对齐 Vue 的 `default`;会被赋给小程序 property 的 `value`)
|
|
27
|
-
*/
|
|
28
|
-
default?: D | (() => D);
|
|
29
|
-
/**
|
|
30
|
-
* 小程序 `value` 的别名
|
|
31
|
-
*/
|
|
32
|
-
value?: D | (() => D);
|
|
33
|
-
observer?: string | ((newVal: T, oldVal: T, changedPath: Array<string | number>) => void);
|
|
34
|
-
required?: boolean;
|
|
35
|
-
}
|
|
36
|
-
type HasDefault<T> = T extends {
|
|
37
|
-
default: infer D;
|
|
38
|
-
} ? D extends (() => undefined) | undefined ? false : true : T extends {
|
|
39
|
-
value: infer V;
|
|
40
|
-
} ? V extends (() => undefined) | undefined ? false : true : false;
|
|
41
|
-
type IsBooleanProp<T> = T extends {
|
|
42
|
-
type?: infer U;
|
|
43
|
-
} ? IsBooleanProp<U> : T extends readonly any[] ? true extends IsBooleanProp<T[number]> ? true : false : T extends BooleanConstructor ? true : false;
|
|
44
|
-
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
45
|
-
required: true;
|
|
46
|
-
} ? K : HasDefault<T[K]> extends true ? K : IsBooleanProp<T[K]> extends true ? K : never; }[keyof T];
|
|
47
|
-
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
48
|
-
type DefaultKeys<T> = { [K in keyof T]: HasDefault<T[K]> extends true ? K : IsBooleanProp<T[K]> extends true ? K : never; }[keyof T];
|
|
49
|
-
type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
|
|
50
|
-
export type InferPropType<O, NullAsAny = true> = [O] extends [null] ? NullAsAny extends true ? any : null : [O] extends [{
|
|
51
|
-
type: null | true;
|
|
52
|
-
}] ? any : [O] extends [ObjectConstructor | {
|
|
53
|
-
type: ObjectConstructor;
|
|
54
|
-
}] ? Record<string, any> : [O] extends [BooleanConstructor | {
|
|
55
|
-
type: BooleanConstructor;
|
|
56
|
-
}] ? boolean : [O] extends [DateConstructor | {
|
|
57
|
-
type: DateConstructor;
|
|
58
|
-
}] ? Date : [O] extends [(infer U)[] | {
|
|
59
|
-
type: (infer U)[];
|
|
60
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [O] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : O;
|
|
61
|
-
type IsUnion<T, U = T> = T extends any ? ([U] extends [T] ? false : true) : never;
|
|
62
|
-
type WidenLiteral<T> = T extends string ? string extends T ? string : IsUnion<T> extends true ? T : string : T extends number ? number extends T ? number : IsUnion<T> extends true ? T : number : T extends boolean ? boolean extends T ? boolean : IsUnion<T> extends true ? T : boolean : T;
|
|
63
|
-
type NativeInferByCtor<C> = C extends readonly any[] ? NativeInferByCtor<C[number]> : C extends StringConstructor ? string : C extends NumberConstructor ? number : C extends BooleanConstructor ? boolean : C extends DateConstructor ? Date : C extends ArrayConstructor ? any[] : C extends ObjectConstructor ? Record<string, any> : C extends null ? any : C extends PropConstructor<infer V> ? V : any;
|
|
64
|
-
type MergeNativeType<Base, V> = Base extends string ? Exclude<Extract<WidenLiteral<V>, string>, never> | (Extract<WidenLiteral<V>, string> extends never ? string : never) : Base extends number ? Exclude<Extract<WidenLiteral<V>, number>, never> | (Extract<WidenLiteral<V>, number> extends never ? number : never) : Base extends boolean ? Exclude<Extract<WidenLiteral<V>, boolean>, never> | (Extract<WidenLiteral<V>, boolean> extends never ? boolean : never) : Base;
|
|
65
|
-
type InferNativeByOption<O extends {
|
|
66
|
-
type?: any;
|
|
67
|
-
}> = O['type'] extends NativeTypeHint<infer THint> ? THint : O extends {
|
|
68
|
-
value: infer V;
|
|
69
|
-
} ? MergeNativeType<NativeInferByCtor<O['type']>, V> : NativeInferByCtor<O['type']>;
|
|
70
|
-
export type InferNativePropType<O> = O extends NativeTypeHint<infer T> ? T : O extends {
|
|
71
|
-
type?: any;
|
|
72
|
-
} ? InferNativeByOption<O> : NativeInferByCtor<O>;
|
|
73
|
-
export type InferNativeProps<P extends NativePropsOptions = NativePropsOptions> = { readonly [K in keyof P]?: InferNativePropType<P[K]>; };
|
|
74
|
-
export type InferProps<P extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P, RequiredKeys<P>>]: HasDefault<P[K]> extends true ? Exclude<InferPropType<P[K]>, undefined> : InferPropType<P[K]>; } & { [K in keyof Pick<P, OptionalKeys<P>>]?: InferPropType<P[K]>; };
|
|
75
|
-
export type ExtractPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
76
|
-
export type ExtractPublicPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
77
|
-
export type ExtractDefaultPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P, DefaultKeys<P>>]: InferPropType<P[K]>; };
|
|
78
|
-
//#endregion
|
|
79
|
-
//# sourceMappingURL=propTypes.d.mts.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { HostMiniProgramNavigateToOption, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSwitchTabOption } from "../miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/props/router.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Router 路由类型映射(供声明合并扩展)。
|
|
5
|
-
*
|
|
6
|
-
* 典型用法:在业务项目的类型声明中补充 `entries` 联合类型,
|
|
7
|
-
* 让 `useNativeRouter()/useNativePageRouter()` 的 `url` 参数获得字面量约束。
|
|
8
|
-
*/
|
|
9
|
-
export interface WevuTypedRouterRouteMap {}
|
|
10
|
-
type ResolveTypedRouterEntries = WevuTypedRouterRouteMap extends {
|
|
11
|
-
entries: infer Entries;
|
|
12
|
-
} ? Extract<Entries, string> : string;
|
|
13
|
-
type ResolveTypedRouterTabBarEntries = WevuTypedRouterRouteMap extends {
|
|
14
|
-
tabBarEntries: infer Entries;
|
|
15
|
-
} ? Extract<Entries, string> : ResolveTypedRouterEntries;
|
|
16
|
-
type RelativeRouterUrl = `./${string}` | `../${string}`;
|
|
17
|
-
type AbsoluteRouterPath<Path extends string> = Path | `/${Path}`;
|
|
18
|
-
type AbsoluteRouterUrl<Path extends string> = AbsoluteRouterPath<Path> | `${Path}?${string}` | `/${Path}?${string}`;
|
|
19
|
-
type RouterUrl<Path extends string> = string extends Path ? string : AbsoluteRouterUrl<Path> | RelativeRouterUrl;
|
|
20
|
-
type RouterPathUrl<Path extends string> = string extends Path ? string : AbsoluteRouterPath<Path>;
|
|
21
|
-
export type TypedRouterUrl = RouterUrl<ResolveTypedRouterEntries>;
|
|
22
|
-
export type TypedRouterTabBarUrl = RouterPathUrl<ResolveTypedRouterTabBarEntries>;
|
|
23
|
-
export type MiniProgramRouterSwitchTabOption = Omit<HostMiniProgramSwitchTabOption, 'url'> & {
|
|
24
|
-
url: TypedRouterTabBarUrl;
|
|
25
|
-
};
|
|
26
|
-
export type RouterSwitchTabOption = MiniProgramRouterSwitchTabOption;
|
|
27
|
-
export type MiniProgramRouterReLaunchOption = Omit<HostMiniProgramReLaunchOption, 'url'> & {
|
|
28
|
-
url: TypedRouterUrl;
|
|
29
|
-
};
|
|
30
|
-
export type RouterReLaunchOption = MiniProgramRouterReLaunchOption;
|
|
31
|
-
export type MiniProgramRouterRedirectToOption = Omit<HostMiniProgramRedirectToOption, 'url'> & {
|
|
32
|
-
url: TypedRouterUrl;
|
|
33
|
-
};
|
|
34
|
-
export type RouterRedirectToOption = MiniProgramRouterRedirectToOption;
|
|
35
|
-
export type MiniProgramRouterNavigateToOption = Omit<HostMiniProgramNavigateToOption, 'url'> & {
|
|
36
|
-
url: TypedRouterUrl;
|
|
37
|
-
};
|
|
38
|
-
export type RouterNavigateToOption = MiniProgramRouterNavigateToOption;
|
|
39
|
-
/**
|
|
40
|
-
* setup 场景下推荐使用的 Router 类型。
|
|
41
|
-
* 默认行为与原生 Router 一致;声明合并后可获得更精确的 `url` 类型提示。
|
|
42
|
-
*/
|
|
43
|
-
export interface SetupContextRouter {
|
|
44
|
-
switchTab: (option: MiniProgramRouterSwitchTabOption) => ReturnType<HostMiniProgramRouter['switchTab']>;
|
|
45
|
-
reLaunch: (option: MiniProgramRouterReLaunchOption) => ReturnType<HostMiniProgramRouter['reLaunch']>;
|
|
46
|
-
redirectTo: (option: MiniProgramRouterRedirectToOption) => ReturnType<HostMiniProgramRouter['redirectTo']>;
|
|
47
|
-
navigateTo: (option: MiniProgramRouterNavigateToOption) => ReturnType<HostMiniProgramRouter['navigateTo']>;
|
|
48
|
-
navigateBack: HostMiniProgramRouter['navigateBack'];
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//# sourceMappingURL=router.d.mts.map
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramSelectorQuery, HostMiniProgramTriggerEventOptions } from "../miniprogramHost.mjs";
|
|
2
|
-
import { ComponentPropsOptions, InferProps } from "./propTypes.mjs";
|
|
3
|
-
import { SetupContextRouter } from "./router.mjs";
|
|
4
|
-
import { ComputedDefinitions, MethodDefinitions } from "../core.mjs";
|
|
5
|
-
import { InternalRuntimeState, RuntimeInstance } from "../runtime.mjs";
|
|
6
|
-
//#region src/runtime/types/props/setup.d.ts
|
|
7
|
-
export type SetupContextSelectorQuery = HostMiniProgramSelectorQuery;
|
|
8
|
-
export type SetupContextIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
9
|
-
export type SetupContextIntersectionObserver = HostMiniProgramIntersectionObserver;
|
|
10
|
-
export type SetupFunction<P extends ComponentPropsOptions, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, R extends Record<string, any> | void = Record<string, any> | void> = (props: InferProps<P>, ctx: SetupContext<D, C, M, P>) => R;
|
|
11
|
-
export type SetupContextNativeInstance = InternalRuntimeState & {
|
|
12
|
-
/**
|
|
13
|
-
* 派发组件事件(页面/应用场景下不可用时会安全降级为 no-op)
|
|
14
|
-
*/
|
|
15
|
-
triggerEvent: (eventName: string, detail?: any, options?: HostMiniProgramTriggerEventOptions) => void;
|
|
16
|
-
/**
|
|
17
|
-
* 创建选择器查询对象(不可用时返回 undefined)
|
|
18
|
-
*/
|
|
19
|
-
createSelectorQuery: () => SetupContextSelectorQuery | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* 创建交叉观察器(不可用时返回 undefined)
|
|
22
|
-
*/
|
|
23
|
-
createIntersectionObserver: (options?: SetupContextIntersectionObserverOptions) => SetupContextIntersectionObserver | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* 提交视图层更新
|
|
26
|
-
*/
|
|
27
|
-
setData: (payload: Record<string, any>, callback?: () => void) => void | Promise<void> | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* 监听组件更新性能统计(不可用时返回 undefined)
|
|
30
|
-
*/
|
|
31
|
-
setUpdatePerformanceListener: (listener?: ((result: Record<string, any>) => void)) => void | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* 相对于当前组件路径的 Router(基础库 2.16.1+)。
|
|
34
|
-
* 低版本基础库可能不存在,建议优先使用 `useNativeRouter()` 获取带降级能力的路由对象。
|
|
35
|
-
*/
|
|
36
|
-
router?: SetupContextRouter;
|
|
37
|
-
/**
|
|
38
|
-
* 相对于当前页面路径的 Router(基础库 2.16.1+)。
|
|
39
|
-
* 低版本基础库可能不存在,建议优先使用 `useNativePageRouter()` 获取带降级能力的路由对象。
|
|
40
|
-
*/
|
|
41
|
-
pageRouter?: SetupContextRouter;
|
|
42
|
-
};
|
|
43
|
-
export interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P extends ComponentPropsOptions = ComponentPropsOptions> {
|
|
44
|
-
/**
|
|
45
|
-
* 组件 props(来自小程序 properties)
|
|
46
|
-
*/
|
|
47
|
-
props: InferProps<P>;
|
|
48
|
-
/**
|
|
49
|
-
* 运行时实例
|
|
50
|
-
*/
|
|
51
|
-
runtime: RuntimeInstance<D, C, M>;
|
|
52
|
-
/**
|
|
53
|
-
* 响应式状态
|
|
54
|
-
*/
|
|
55
|
-
state: D;
|
|
56
|
-
/**
|
|
57
|
-
* 公开实例代理
|
|
58
|
-
*/
|
|
59
|
-
proxy: RuntimeInstance<D, C, M>['proxy'];
|
|
60
|
-
/**
|
|
61
|
-
* 双向绑定辅助方法
|
|
62
|
-
*/
|
|
63
|
-
bindModel: RuntimeInstance<D, C, M>['bindModel'];
|
|
64
|
-
/**
|
|
65
|
-
* watch 辅助方法
|
|
66
|
-
*/
|
|
67
|
-
watch: RuntimeInstance<D, C, M>['watch'];
|
|
68
|
-
/**
|
|
69
|
-
* 小程序内部实例
|
|
70
|
-
*/
|
|
71
|
-
instance: SetupContextNativeInstance;
|
|
72
|
-
/**
|
|
73
|
-
* 通过小程序 `triggerEvent(eventName, detail?, options?)` 派发事件。
|
|
74
|
-
*
|
|
75
|
-
* 为兼容 Vue 3 的 `emit(event, ...args)`:
|
|
76
|
-
* - `emit(name)` -> `detail = undefined`
|
|
77
|
-
* - `emit(name, payload)` -> `detail = payload`
|
|
78
|
-
* - `emit(name, payload, options)`(当最后一个参数是事件选项)-> `detail = payload`
|
|
79
|
-
* - `emit(name, a, b, c)` -> `detail = [a, b, c]`
|
|
80
|
-
*/
|
|
81
|
-
emit: (event: string, ...args: any[]) => void;
|
|
82
|
-
/**
|
|
83
|
-
* Vue 3 对齐:expose 公共属性
|
|
84
|
-
*/
|
|
85
|
-
expose: (exposed: Record<string, any>) => void;
|
|
86
|
-
/**
|
|
87
|
-
* Vue 3 对齐:attrs(小程序场景为非 props 属性集合)
|
|
88
|
-
*/
|
|
89
|
-
attrs: Record<string, any>;
|
|
90
|
-
/**
|
|
91
|
-
* Vue 3 对齐:slots(由编译期传入的 slot 名元数据驱动)
|
|
92
|
-
*/
|
|
93
|
-
slots: Record<string, any>;
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//# sourceMappingURL=setup.d.mts.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./props/propTypes.mjs";
|
|
2
|
-
import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, RouterNavigateToOption, RouterReLaunchOption, RouterRedirectToOption, RouterSwitchTabOption, SetupContextRouter, TypedRouterTabBarUrl, TypedRouterUrl, WevuTypedRouterRouteMap } from "./props/router.mjs";
|
|
3
|
-
import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextSelectorQuery, SetupFunction } from "./props/setup.mjs";
|
|
4
|
-
export type { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType, RouterNavigateToOption, RouterReLaunchOption, RouterRedirectToOption, RouterSwitchTabOption, SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextRouter, SetupContextSelectorQuery, SetupFunction, TypedRouterTabBarUrl, TypedRouterUrl, WevuTypedRouterRouteMap };
|