wevu 7.0.2 → 7.0.4
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/dev/router/initialNavigation.mjs +6 -3
- package/dist/dev/router/initialNavigation.mjs.map +1 -1
- package/dist/dev/router/routeSync.mjs +8 -2
- package/dist/dev/router/routeSync.mjs.map +1 -1
- package/dist/dev/router/useRoute.mjs +14 -7
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +3 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/emit.mjs +1 -1
- package/dist/dev/runtime/emit.mjs.map +1 -1
- package/dist/dev/runtime/jsxIsland.mjs +5 -1
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs +3 -2
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +15 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/fetch.d.mts +4 -4
- package/dist/jsx-runtime.d.mts +4 -5
- package/dist/macros/shared.d.mts +14 -15
- package/dist/macros.d.mts +22 -22
- package/dist/package.mjs +1 -1
- package/dist/reactivity/computed.d.mts +8 -9
- package/dist/reactivity/core.d.mts +14 -15
- package/dist/reactivity/reactive/mutation.d.mts +6 -7
- package/dist/reactivity/reactive/patch.d.mts +4 -5
- package/dist/reactivity/reactive/shallow.d.mts +3 -4
- package/dist/reactivity/reactive/shared.d.mts +2 -3
- package/dist/reactivity/reactive.d.mts +6 -6
- package/dist/reactivity/readonly.d.mts +7 -8
- package/dist/reactivity/ref.d.mts +14 -15
- package/dist/reactivity/shallowRef.d.mts +5 -6
- package/dist/reactivity/toRefs.d.mts +5 -6
- package/dist/reactivity/traverse.d.mts +2 -3
- package/dist/reactivity/watch/types.d.mts +18 -19
- package/dist/reactivity/watch.d.mts +8 -8
- package/dist/router/createRouter.d.mts +2 -3
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/navigationCore.d.mts +3 -4
- package/dist/router/resolve.d.mts +2 -3
- package/dist/router/routeSync.mjs +1 -1
- package/dist/router/types.d.mts +38 -39
- package/dist/router/useRoute.d.mts +5 -6
- package/dist/router/useRoute.mjs +1 -1
- package/dist/router/useRouter.d.mts +2 -3
- package/dist/routerInternal/query.d.mts +3 -4
- package/dist/routerInternal/types.d.mts +2 -3
- package/dist/runtime/app/pending.d.mts +3 -4
- package/dist/runtime/app.d.mts +2 -3
- package/dist/runtime/css.d.mts +3 -4
- package/dist/runtime/defaults.d.mts +5 -6
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define.d.mts +15 -16
- package/dist/runtime/disposables.d.mts +6 -7
- package/dist/runtime/elementIntersectionObserver.d.mts +5 -6
- package/dist/runtime/emit.mjs +1 -1
- package/dist/runtime/hooks/base.d.mts +7 -8
- package/dist/runtime/hooks/register.d.mts +26 -27
- package/dist/runtime/hooks/vue.d.mts +12 -13
- package/dist/runtime/intersectionObserver.d.mts +4 -5
- package/dist/runtime/jsxIsland.d.mts +19 -20
- package/dist/runtime/jsxIsland.mjs +1 -1
- package/dist/runtime/layoutBridge.d.mts +12 -13
- package/dist/runtime/noSetData.d.mts +3 -4
- package/dist/runtime/pageEnvironment.d.mts +9 -10
- package/dist/runtime/pageLayout.d.mts +9 -10
- package/dist/runtime/pageScroll.d.mts +4 -5
- package/dist/runtime/provide.d.mts +7 -7
- package/dist/runtime/provideStore.d.mts +2 -3
- package/dist/runtime/pullDownRefresh.d.mts +4 -5
- package/dist/runtime/register/app.d.mts +2 -3
- package/dist/runtime/register/component/options.mjs +1 -1
- package/dist/runtime/register/component.d.mts +2 -3
- package/dist/runtime/register/inline.d.mts +3 -4
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.d.mts +4 -5
- package/dist/runtime/register/setup.d.mts +2 -3
- package/dist/runtime/register/watch.d.mts +3 -4
- package/dist/runtime/selectorQuery.d.mts +15 -16
- package/dist/runtime/template.d.mts +4 -5
- package/dist/runtime/templateRefTypes.d.mts +2 -1
- package/dist/runtime/templateRefs.d.mts +2 -3
- package/dist/runtime/types/core.d.mts +9 -10
- package/dist/runtime/types/miniprogram.d.mts +10 -10
- package/dist/runtime/types/miniprogramHost.d.mts +41 -41
- package/dist/runtime/types/miniprogramHostSources.d.mts +21 -22
- package/dist/runtime/types/options.d.mts +6 -7
- package/dist/runtime/types/props/propTypes.d.mts +16 -17
- package/dist/runtime/types/props/router.d.mts +13 -14
- package/dist/runtime/types/props/setup.d.mts +7 -8
- package/dist/runtime/types/runtime.d.mts +7 -8
- package/dist/runtime/types/setData.d.mts +3 -4
- package/dist/runtime/types.d.mts +8 -8
- package/dist/runtime/uniAppHost.d.mts +2 -3
- package/dist/runtime/updatePerformance.d.mts +5 -6
- package/dist/runtime/use.d.mts +3 -4
- package/dist/runtime/vueCompat/context.d.mts +4 -5
- package/dist/runtime/vueCompat/model.d.mts +9 -10
- package/dist/runtime/vueCompat/router.d.mts +3 -4
- package/dist/runtime/vueCompat/templateRef.d.mts +4 -5
- package/dist/scheduler.d.mts +2 -3
- package/dist/store/define.d.mts +3 -4
- package/dist/store/manager.d.mts +2 -3
- package/dist/store/storeToRefs.d.mts +3 -4
- package/dist/store/types.d.mts +10 -11
- package/dist/version.d.mts +2 -3
- package/dist/vue-augment.d.mts +2 -1
- package/dist/vue-demi.d.mts +5 -5
- package/dist/vue-types.d.mts +2 -2
- package/dist/weappIntrinsicElements/base.d.mts +12 -13
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/ad.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/audio.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/block.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/button.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/camera.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/editor.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/form.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/icon.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/image.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/import.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/include.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/input.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/label.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/map.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/picker.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/progress.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/radio.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/slider.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/slot.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/switch.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/template.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/text.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/video.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/view.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +2 -3
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +2 -3
- package/dist/weappIntrinsicElements.d.mts +5 -5
- package/package.json +4 -4
|
@@ -13,7 +13,7 @@ import { TemplateRefBinding } from "./templateRefs.mjs";
|
|
|
13
13
|
/**
|
|
14
14
|
* defineComponent 返回的组件定义描述,用于手动注册或高级用法。
|
|
15
15
|
*/
|
|
16
|
-
interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
16
|
+
export interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
17
17
|
/**
|
|
18
18
|
* 内部 runtime app(高级能力使用),不对外暴露正式 API。
|
|
19
19
|
* @internal
|
|
@@ -35,21 +35,21 @@ interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M
|
|
|
35
35
|
}
|
|
36
36
|
type SetupBindings<S> = Exclude<S, void> extends never ? Record<string, never> : Exclude<S, void>;
|
|
37
37
|
type ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P;
|
|
38
|
-
interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
38
|
+
export interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
39
39
|
new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>;
|
|
40
40
|
}
|
|
41
|
-
type WevuDefinedComponent<PropsOrPropOptions, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>;
|
|
42
|
-
interface SetupContextWithTypeProps<TypeProps> {
|
|
41
|
+
export type WevuDefinedComponent<PropsOrPropOptions, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>;
|
|
42
|
+
export interface SetupContextWithTypeProps<TypeProps> {
|
|
43
43
|
props: TypeProps;
|
|
44
44
|
[key: string]: any;
|
|
45
45
|
}
|
|
46
|
-
type SetupFunctionWithTypeProps<TypeProps> = (props: TypeProps, ctx: SetupContextWithTypeProps<TypeProps>) => Record<string, any> | void;
|
|
47
|
-
interface DefineComponentTypePropsOptions<TypeProps> {
|
|
46
|
+
export type SetupFunctionWithTypeProps<TypeProps> = (props: TypeProps, ctx: SetupContextWithTypeProps<TypeProps>) => Record<string, any> | void;
|
|
47
|
+
export interface DefineComponentTypePropsOptions<TypeProps> {
|
|
48
48
|
__typeProps: TypeProps;
|
|
49
49
|
setup?: SetupFunctionWithTypeProps<TypeProps>;
|
|
50
50
|
[key: string]: any;
|
|
51
51
|
}
|
|
52
|
-
interface DefineComponentWithTypeProps<TypeProps> {
|
|
52
|
+
export interface DefineComponentWithTypeProps<TypeProps> {
|
|
53
53
|
new (): {
|
|
54
54
|
$props: TypeProps;
|
|
55
55
|
} & Record<string, any>;
|
|
@@ -81,46 +81,45 @@ interface DefineComponentWithTypeProps<TypeProps> {
|
|
|
81
81
|
* })
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
|
|
85
|
-
declare function defineComponent<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>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
84
|
+
export declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
|
|
85
|
+
export declare function defineComponent<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>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
86
86
|
/**
|
|
87
87
|
* 创建不触发宿主全局注册的 Wevu 组件定义。
|
|
88
88
|
*
|
|
89
89
|
* @param options 组件选项
|
|
90
90
|
* @internal
|
|
91
91
|
*/
|
|
92
|
-
declare function createWevuComponentDefinition(options: DefineComponentOptions<any, any, any, any, any>): WevuComponentConstructor<InferProps<ComponentPropsOptions>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions> & ComponentDefinition<any, any, any>;
|
|
92
|
+
export declare function createWevuComponentDefinition(options: DefineComponentOptions<any, any, any, any, any>): WevuComponentConstructor<InferProps<ComponentPropsOptions>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions> & ComponentDefinition<any, any, any>;
|
|
93
93
|
/**
|
|
94
94
|
* 从现有组件定义派生拥有独立应用上下文的组件定义。
|
|
95
95
|
*
|
|
96
96
|
* @param definition 已解析的 Wevu 组件定义
|
|
97
97
|
* @internal
|
|
98
98
|
*/
|
|
99
|
-
declare function createIsolatedWevuComponentDefinition(definition: object): ComponentDefinition<any, any, any>;
|
|
99
|
+
export declare function createIsolatedWevuComponentDefinition(definition: object): ComponentDefinition<any, any, any>;
|
|
100
100
|
/**
|
|
101
101
|
* 获取组件定义对应的宿主生命周期定义。
|
|
102
102
|
*
|
|
103
103
|
* @param definition Wevu 组件定义
|
|
104
104
|
* @internal
|
|
105
105
|
*/
|
|
106
|
-
declare function getWevuComponentLifecycleDefinition(definition: object): Record<string, any> | undefined;
|
|
106
|
+
export declare function getWevuComponentLifecycleDefinition(definition: object): Record<string, any> | undefined;
|
|
107
107
|
/**
|
|
108
108
|
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
109
109
|
*
|
|
110
110
|
* @param options 组件选项,可能包含小程序特有的 properties
|
|
111
111
|
* @internal
|
|
112
112
|
*/
|
|
113
|
-
declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
113
|
+
export declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
114
114
|
properties?: HostMiniProgramComponentPropertyOption;
|
|
115
115
|
}): void;
|
|
116
116
|
/**
|
|
117
117
|
* scoped slot 兼容组件入口(编译产物内部使用)。
|
|
118
118
|
* @internal
|
|
119
119
|
*/
|
|
120
|
-
declare function createWevuScopedSlotComponent(overrides?: {
|
|
120
|
+
export declare function createWevuScopedSlotComponent(overrides?: {
|
|
121
121
|
computed?: ComputedDefinitions;
|
|
122
122
|
inlineMap?: InlineExpressionMap;
|
|
123
123
|
templateRefs?: TemplateRefBinding[];
|
|
124
124
|
}): void;
|
|
125
|
-
//#endregion
|
|
126
|
-
export { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent, createIsolatedWevuComponentDefinition, createWevuComponent, createWevuComponentDefinition, createWevuScopedSlotComponent, defineComponent, getWevuComponentLifecycleDefinition };
|
|
125
|
+
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/runtime/disposables.d.ts
|
|
2
|
-
type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
|
-
type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
|
-
type DisposableLike = (() => void) | DisposableObject;
|
|
5
|
-
interface DisposableBag {
|
|
2
|
+
export type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
|
+
export type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
|
+
export type DisposableLike = (() => void) | DisposableObject;
|
|
5
|
+
export interface DisposableBag {
|
|
6
6
|
/**
|
|
7
7
|
* 注册一个清理项,返回“取消注册”函数(不会立即执行清理)。
|
|
8
8
|
*/
|
|
@@ -26,6 +26,5 @@ interface DisposableBag {
|
|
|
26
26
|
* 典型用法:注册定时器、请求任务、事件监听退订函数,
|
|
27
27
|
* 在页面/组件卸载时自动批量清理,减少内存泄漏风险。
|
|
28
28
|
*/
|
|
29
|
-
declare function useDisposables(): DisposableBag;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, useDisposables };
|
|
29
|
+
export declare function useDisposables(): DisposableBag;
|
|
30
|
+
//#endregion
|
|
@@ -4,8 +4,8 @@ import "../reactivity/index.mjs";
|
|
|
4
4
|
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
5
5
|
import "./types.mjs";
|
|
6
6
|
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
7
|
-
type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
|
-
interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
7
|
+
export type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
|
+
export interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
9
9
|
context?: InternalRuntimeState | null;
|
|
10
10
|
enabled?: MaybeRefOrGetter<boolean>;
|
|
11
11
|
observerOptions?: MaybeRefOrGetter<HostMiniProgramIntersectionObserverOptions>;
|
|
@@ -13,7 +13,7 @@ interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
|
13
13
|
relativeToViewport?: boolean | Record<string, number>;
|
|
14
14
|
selector: MaybeRefOrGetter<string | null | undefined>;
|
|
15
15
|
}
|
|
16
|
-
interface UseElementIntersectionObserverReturn {
|
|
16
|
+
export interface UseElementIntersectionObserverReturn {
|
|
17
17
|
disconnect: () => void;
|
|
18
18
|
observe: () => HostMiniProgramIntersectionObserver | null;
|
|
19
19
|
readonly observer: HostMiniProgramIntersectionObserver | null;
|
|
@@ -21,6 +21,5 @@ interface UseElementIntersectionObserverReturn {
|
|
|
21
21
|
/**
|
|
22
22
|
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
23
23
|
*/
|
|
24
|
-
declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { ElementIntersectionObserverCallback, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, useElementIntersectionObserver };
|
|
24
|
+
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
+
//#endregion
|
package/dist/runtime/emit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e,hyphenate as t}from"../utils.mjs";function n(t){return!t||typeof t!=`object`||Array.isArray(t)?!1:e(t,`bubbles`)||e(t,`composed`)||e(t,`capturePhase`)}function r(e){return e.includes(`:`)?e.
|
|
1
|
+
import{hasOwn as e,hyphenate as t}from"../utils.mjs";function n(t){return!t||typeof t!=`object`||Array.isArray(t)?!1:e(t,`bubbles`)||e(t,`composed`)||e(t,`capturePhase`)}function r(e){return e.includes(`:`)?e.replace(/:/g,`-`).toLowerCase():t(e)}function i(e){if(e.length===0)return{detail:void 0,options:void 0};if(e.length===1)return{detail:e[0],options:void 0};let t=e[e.length-1];if(n(t)){let n=e.slice(0,-1);return{detail:n.length<=1?n[0]:n,options:t}}return{detail:e,options:void 0}}export{r as normalizeEmitEventName,i as normalizeEmitPayload};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
3
|
//#region src/runtime/hooks/base.d.ts
|
|
4
|
-
declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
4
|
+
export declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* 设置当前运行时实例(框架内部使用)。
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
10
|
-
declare function getCurrentSetupContext<T = any>(): T | undefined;
|
|
9
|
+
export declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
10
|
+
export declare function getCurrentSetupContext<T = any>(): T | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* 设置当前 setup 上下文(框架内部使用)。
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
declare function setCurrentSetupContext(ctx: any | undefined): void;
|
|
15
|
+
export declare function setCurrentSetupContext(ctx: any | undefined): void;
|
|
16
16
|
/**
|
|
17
17
|
* 调用批量 hook(框架内部调度入口)。
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
20
|
+
export declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
21
21
|
/**
|
|
22
22
|
* 调用返回值型 hook(框架内部调度入口)。
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
|
-
declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext };
|
|
25
|
+
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
+
//#endregion
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramSaveExitState, HostMiniProgramShareAppMessageOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult } from "../types/miniprogramHost.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
3
|
//#region src/runtime/hooks/register.d.ts
|
|
4
|
-
declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
5
|
-
declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
|
|
6
|
-
declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
|
|
7
|
-
declare function onThemeChange(handler: (options: HostMiniProgramThemeChangeResult) => void): void;
|
|
8
|
-
declare function onMemoryWarning(handler: (options: HostMiniProgramMemoryWarningResult) => void): void;
|
|
9
|
-
declare function onShow(handler: () => void): void;
|
|
10
|
-
declare function onShow(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
11
|
-
declare function onLoad(handler: HostMiniProgramPageLifetime['onLoad']): void;
|
|
12
|
-
declare function onHide(handler: () => void): void;
|
|
13
|
-
declare function onUnload(handler: () => void): void;
|
|
14
|
-
declare function onReady(handler: () => void): void;
|
|
15
|
-
declare function onPullDownRefresh(handler: HostMiniProgramPageLifetime['onPullDownRefresh']): void;
|
|
16
|
-
declare function onReachBottom(handler: HostMiniProgramPageLifetime['onReachBottom']): void;
|
|
17
|
-
declare function onPageScroll(handler: (opt: HostMiniProgramPageScrollOption) => void): void;
|
|
18
|
-
declare function onRouteDone(handler: HostMiniProgramPageLifetime['onRouteDone'] | ((opt?: unknown) => void)): void;
|
|
19
|
-
declare function onTabItemTap(handler: (opt: HostMiniProgramTabItemTapOption) => void): void;
|
|
20
|
-
declare function onResize(handler: (opt: HostMiniProgramPageResizeOption) => void): void;
|
|
21
|
-
declare function onMoved(handler: () => void): void;
|
|
22
|
-
declare function onAttached(handler: () => void): void;
|
|
23
|
-
declare function onDetached(handler: () => void): void;
|
|
24
|
-
declare function onError(handler: (err: any) => void): void;
|
|
25
|
-
declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
|
|
26
|
-
declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
|
|
27
|
-
declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
|
|
28
|
-
declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload };
|
|
4
|
+
export declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
5
|
+
export declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
|
|
6
|
+
export declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
|
|
7
|
+
export declare function onThemeChange(handler: (options: HostMiniProgramThemeChangeResult) => void): void;
|
|
8
|
+
export declare function onMemoryWarning(handler: (options: HostMiniProgramMemoryWarningResult) => void): void;
|
|
9
|
+
export declare function onShow(handler: () => void): void;
|
|
10
|
+
export declare function onShow(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
11
|
+
export declare function onLoad(handler: HostMiniProgramPageLifetime['onLoad']): void;
|
|
12
|
+
export declare function onHide(handler: () => void): void;
|
|
13
|
+
export declare function onUnload(handler: () => void): void;
|
|
14
|
+
export declare function onReady(handler: () => void): void;
|
|
15
|
+
export declare function onPullDownRefresh(handler: HostMiniProgramPageLifetime['onPullDownRefresh']): void;
|
|
16
|
+
export declare function onReachBottom(handler: HostMiniProgramPageLifetime['onReachBottom']): void;
|
|
17
|
+
export declare function onPageScroll(handler: (opt: HostMiniProgramPageScrollOption) => void): void;
|
|
18
|
+
export declare function onRouteDone(handler: HostMiniProgramPageLifetime['onRouteDone'] | ((opt?: unknown) => void)): void;
|
|
19
|
+
export declare function onTabItemTap(handler: (opt: HostMiniProgramTabItemTapOption) => void): void;
|
|
20
|
+
export declare function onResize(handler: (opt: HostMiniProgramPageResizeOption) => void): void;
|
|
21
|
+
export declare function onMoved(handler: () => void): void;
|
|
22
|
+
export declare function onAttached(handler: () => void): void;
|
|
23
|
+
export declare function onDetached(handler: () => void): void;
|
|
24
|
+
export declare function onError(handler: (err: any) => void): void;
|
|
25
|
+
export declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
|
|
26
|
+
export declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
|
|
27
|
+
export declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
|
|
28
|
+
export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
29
|
+
//#endregion
|
|
@@ -4,50 +4,49 @@ import "../types.mjs";
|
|
|
4
4
|
/**
|
|
5
5
|
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
6
6
|
*/
|
|
7
|
-
declare function onMounted(handler: () => void): void;
|
|
7
|
+
export declare function onMounted(handler: () => void): void;
|
|
8
8
|
/**
|
|
9
9
|
* Vue 3 对齐:组件/页面更新后触发。
|
|
10
10
|
* 小程序没有专用 update 生命周期,这里在每次 setData 完成后调用。
|
|
11
11
|
*/
|
|
12
|
-
declare function onUpdated(handler: () => void): void;
|
|
12
|
+
export declare function onUpdated(handler: () => void): void;
|
|
13
13
|
/**
|
|
14
14
|
* Vue 3 对齐:卸载前触发。
|
|
15
15
|
* 小程序无 before-unload 生命周期,setup 时同步执行以保持语义。
|
|
16
16
|
*/
|
|
17
|
-
declare function onBeforeUnmount(handler: () => void): void;
|
|
17
|
+
export declare function onBeforeUnmount(handler: () => void): void;
|
|
18
18
|
/**
|
|
19
19
|
* Vue 3 对齐:组件/页面卸载;映射到页面 onUnload 或组件 detached
|
|
20
20
|
*/
|
|
21
|
-
declare function onUnmounted(handler: () => void): void;
|
|
21
|
+
export declare function onUnmounted(handler: () => void): void;
|
|
22
22
|
/**
|
|
23
23
|
* Vue 3 对齐:挂载前;setup 时同步触发以模拟 beforeMount 语义
|
|
24
24
|
*/
|
|
25
|
-
declare function onBeforeMount(handler: () => void): void;
|
|
25
|
+
export declare function onBeforeMount(handler: () => void): void;
|
|
26
26
|
/**
|
|
27
27
|
* Vue 3 对齐:更新前;在每次 setData 前触发
|
|
28
28
|
*/
|
|
29
|
-
declare function onBeforeUpdate(handler: () => void): void;
|
|
29
|
+
export declare function onBeforeUpdate(handler: () => void): void;
|
|
30
30
|
/**
|
|
31
31
|
* Vue 3 对齐:错误捕获;映射到小程序 onError
|
|
32
32
|
*/
|
|
33
|
-
declare function onErrorCaptured(handler: (err: any, instance: any, info: string) => void): void;
|
|
33
|
+
export declare function onErrorCaptured(handler: (err: any, instance: any, info: string) => void): void;
|
|
34
34
|
/**
|
|
35
35
|
* Vue 3 对齐:组件激活;映射到小程序 onShow
|
|
36
36
|
*/
|
|
37
|
-
declare function onActivated(handler: () => void): void;
|
|
37
|
+
export declare function onActivated(handler: () => void): void;
|
|
38
38
|
/**
|
|
39
39
|
* Vue 3 对齐:组件失活;映射到小程序 onHide
|
|
40
40
|
*/
|
|
41
|
-
declare function onDeactivated(handler: () => void): void;
|
|
41
|
+
export declare function onDeactivated(handler: () => void): void;
|
|
42
42
|
/**
|
|
43
43
|
* Vue 3 对齐:服务端渲染前置钩子。
|
|
44
44
|
* 小程序无此场景,保留空实现以保持 API 兼容。
|
|
45
45
|
*/
|
|
46
|
-
declare function onServerPrefetch(_handler: () => void): void;
|
|
46
|
+
export declare function onServerPrefetch(_handler: () => void): void;
|
|
47
47
|
/**
|
|
48
48
|
* 派发更新阶段钩子(框架内部调度入口)。
|
|
49
49
|
* @internal
|
|
50
50
|
*/
|
|
51
|
-
declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
52
|
-
//#endregion
|
|
53
|
-
export { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated };
|
|
51
|
+
export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
52
|
+
//#endregion
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
3
|
//#region src/runtime/intersectionObserver.d.ts
|
|
4
|
-
type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
5
|
-
type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
4
|
+
export type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
5
|
+
export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
6
6
|
/**
|
|
7
7
|
* 在 setup 中创建 IntersectionObserver,并在卸载时自动断开。
|
|
8
8
|
*
|
|
9
9
|
* - 优先使用 `ctx.instance.createIntersectionObserver(options)`。
|
|
10
10
|
* - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
|
|
11
11
|
*/
|
|
12
|
-
declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { UseIntersectionObserverOptions, UseIntersectionObserverResult, useIntersectionObserver };
|
|
12
|
+
export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
13
|
+
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/runtime/jsxIsland.d.ts
|
|
2
|
-
declare const Fragment: unique symbol;
|
|
3
|
-
interface WevuJsxVNode {
|
|
2
|
+
export declare const Fragment: unique symbol;
|
|
3
|
+
export interface WevuJsxVNode {
|
|
4
4
|
children?: unknown;
|
|
5
5
|
props?: Record<string, any> | null;
|
|
6
6
|
type: unknown;
|
|
7
7
|
}
|
|
8
|
-
interface WevuJsxIslandNode {
|
|
8
|
+
export interface WevuJsxIslandNode {
|
|
9
9
|
children?: WevuJsxIslandNode[];
|
|
10
10
|
events?: Record<string, string>;
|
|
11
11
|
kind: 'element' | 'fragment' | 'text';
|
|
@@ -13,29 +13,28 @@ interface WevuJsxIslandNode {
|
|
|
13
13
|
tag?: string;
|
|
14
14
|
text?: string;
|
|
15
15
|
}
|
|
16
|
-
interface WevuJsxIslandAdapters {
|
|
16
|
+
export interface WevuJsxIslandAdapters {
|
|
17
17
|
normalizeClass: (value: unknown) => string;
|
|
18
18
|
normalizeStyle: (value: unknown) => string;
|
|
19
19
|
}
|
|
20
|
-
declare function createVNode(type: unknown, props?: Record<string, any> | null, children?: unknown): WevuJsxVNode;
|
|
21
|
-
declare function createTextVNode(text: unknown): WevuJsxVNode;
|
|
22
|
-
declare function isVNode(value: unknown): value is WevuJsxVNode;
|
|
23
|
-
declare function mergeProps(...sources: Array<Record<string, any> | null | undefined>): Record<string, any>;
|
|
24
|
-
declare function transformOn(events: Record<string, unknown>): Record<string, unknown>;
|
|
25
|
-
declare function resolveComponent(name: string): string;
|
|
26
|
-
declare const vShow = "show";
|
|
27
|
-
declare const vModelText = "model-text";
|
|
28
|
-
declare const vModelCheckbox = "model-checkbox";
|
|
29
|
-
declare const vModelRadio = "model-radio";
|
|
30
|
-
declare const vModelSelect = "model-select";
|
|
31
|
-
declare function withDirectives(vnode: WevuJsxVNode, directives: unknown[]): {
|
|
20
|
+
export declare function createVNode(type: unknown, props?: Record<string, any> | null, children?: unknown): WevuJsxVNode;
|
|
21
|
+
export declare function createTextVNode(text: unknown): WevuJsxVNode;
|
|
22
|
+
export declare function isVNode(value: unknown): value is WevuJsxVNode;
|
|
23
|
+
export declare function mergeProps(...sources: Array<Record<string, any> | null | undefined>): Record<string, any>;
|
|
24
|
+
export declare function transformOn(events: Record<string, unknown>): Record<string, unknown>;
|
|
25
|
+
export declare function resolveComponent(name: string): string;
|
|
26
|
+
export declare const vShow = "show";
|
|
27
|
+
export declare const vModelText = "model-text";
|
|
28
|
+
export declare const vModelCheckbox = "model-checkbox";
|
|
29
|
+
export declare const vModelRadio = "model-radio";
|
|
30
|
+
export declare const vModelSelect = "model-select";
|
|
31
|
+
export declare function withDirectives(vnode: WevuJsxVNode, directives: unknown[]): {
|
|
32
32
|
props: {
|
|
33
33
|
[x: string]: any;
|
|
34
34
|
};
|
|
35
35
|
children?: unknown;
|
|
36
36
|
type: unknown;
|
|
37
37
|
};
|
|
38
|
-
declare function resolveDirective(name: string): string;
|
|
39
|
-
declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { Fragment, WevuJsxIslandAdapters, WevuJsxIslandNode, WevuJsxVNode, createTextVNode, createVNode, isVNode, mergeProps, normalizeJsxIsland, resolveComponent, resolveDirective, transformOn, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, withDirectives };
|
|
38
|
+
export declare function resolveDirective(name: string): string;
|
|
39
|
+
export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
40
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WEVU_JSX_ISLAND_HANDLER_MAP_KEY as e}from"@weapp-core/constants";const t=Symbol.for(`wevu.jsx.fragment`);function n(e,t,n){return{type:e,props:t,children:n}}function r(e){return{type:`text`,props:null,children:String(e==null?``:e)}}function i(e){return!!e&&typeof e==`object`&&`type`in e}function a(...e){let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n))e===`class`&&t.class?t.class=[t.class,r]:e===`style`&&t.style?t.style=[t.style,r]:t[e]=r;return t}function o(e){let t={};for(let[n,r]of Object.entries(e))t[`on${n.charAt(0).toUpperCase()}${n.slice(1)}`]=r;return t}function s(e){return e}const c=`show`,l=`model-text`,u=`model-checkbox`,d=`model-radio`,f=`model-select`;function p(e,t){var n;let r={...(n=e.props)==null?{}:n};for(let e of t){if(!Array.isArray(e))continue;let[t,n,i]=e;if(t===`show`){r.hidden=!n;continue}if(t===`model-text`||t===`model-checkbox`||t===`model-radio`||t===`model-select`){let e=typeof i==`string`&&i?i:`modelValue`,a=r[`onUpdate:${e}`];if(r[e===`modelValue`?`value`:e]=n,typeof a==`function`){let e=t===`model-text`?`onInput`:`onChange`;r[e]=e=>{var t,n;return a((t=e==null||(n=e.detail)==null?void 0:n.value)==null?e==null?void 0:e.detail:t)}}}}return{...e,props:r}}function m(e){return e}function h(e){if(/^on[A-Z]/.test(e))return e.slice(2).toLowerCase()}function g(t){let n=t==null?void 0:t[e];if(n&&typeof n==`object`)return n;let r=Object.create(null);return t&&(typeof t==`object`||typeof t==`function`)&&Object.defineProperty(t,e,{value:r,configurable:!0,writable:!0}),r}function _(e,t,n,r,a){let o=typeof e==`function`?e():e;if(o==null||o===!1||o===!0)return[];if(Array.isArray(o))
|
|
1
|
+
import{WEVU_JSX_ISLAND_HANDLER_MAP_KEY as e}from"@weapp-core/constants";const t=Symbol.for(`wevu.jsx.fragment`);function n(e,t,n){return{type:e,props:t,children:n}}function r(e){return{type:`text`,props:null,children:String(e==null?``:e)}}function i(e){return!!e&&typeof e==`object`&&`type`in e}function a(...e){let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n))e===`class`&&t.class?t.class=[t.class,r]:e===`style`&&t.style?t.style=[t.style,r]:t[e]=r;return t}function o(e){let t={};for(let[n,r]of Object.entries(e))t[`on${n.charAt(0).toUpperCase()}${n.slice(1)}`]=r;return t}function s(e){return e}const c=`show`,l=`model-text`,u=`model-checkbox`,d=`model-radio`,f=`model-select`;function p(e,t){var n;let r={...(n=e.props)==null?{}:n};for(let e of t){if(!Array.isArray(e))continue;let[t,n,i]=e;if(t===`show`){r.hidden=!n;continue}if(t===`model-text`||t===`model-checkbox`||t===`model-radio`||t===`model-select`){let e=typeof i==`string`&&i?i:`modelValue`,a=r[`onUpdate:${e}`];if(r[e===`modelValue`?`value`:e]=n,typeof a==`function`){let e=t===`model-text`?`onInput`:`onChange`;r[e]=e=>{var t,n;return a((t=e==null||(n=e.detail)==null?void 0:n.value)==null?e==null?void 0:e.detail:t)}}}}return{...e,props:r}}function m(e){return e}function h(e){if(/^on[A-Z]/.test(e))return e.slice(2).toLowerCase()}function g(t){let n=t==null?void 0:t[e];if(n&&typeof n==`object`)return n;let r=Object.create(null);return t&&(typeof t==`object`||typeof t==`function`)&&Object.defineProperty(t,e,{value:r,configurable:!0,writable:!0}),r}function _(e,t,n,r,a){let o=typeof e==`function`?e():e;if(o==null||o===!1||o===!0)return[];if(Array.isArray(o)){let e=[];for(let i of o)e.push(..._(i,t,n,r,a));return e}if(typeof o==`object`&&!i(o))return _(o.default,t,n,r,a);let s=v(o,t,n,r,a);return s?[s]:[]}function v(e,n,r,a,o){var s;if(e==null||e===!1||e===!0)return;if(Array.isArray(e))return{kind:`fragment`,children:_(e,n,r,a,o)};if(typeof e==`string`||typeof e==`number`||!i(e))return{kind:`text`,text:String(e)};if(e.type===t)return{kind:`fragment`,children:_(e.children,n,r,a,o)};if(e.type===`text`){var c;return{kind:`text`,text:String((c=e.children)==null?``:c)}}if(typeof e.type==`function`){var l;return v(e.type((l=e.props)==null?{}:l,e.children),n,r,a,o)}if(e.type&&typeof e.type==`object`&&typeof e.type.render==`function`){var u;return v(e.type.render.call((u=e.props)==null?{}:u),n,r,a,o)}let d=typeof e.type==`string`?e.type:void 0;if(!d)return;let f={},p={},m=g(n);for(let[t,n]of Object.entries((s=e.props)==null?{}:s)){let e=h(t);if(e&&typeof n==`function`){let t=`${r}:${a.value++}`;m[t]=n,p[e]=t;continue}typeof n!=`function`&&n!==void 0&&(t===`class`||t===`className`?f.class=o.normalizeClass(n):t===`style`?f.style=o.normalizeStyle(n):f[t]=n)}return{kind:`element`,tag:d,props:f,events:p,children:_(e.children,n,r,a,o)}}function y(e,t,n){var r;let i=g(this);for(let e of Object.keys(i))e.startsWith(`${t}:`)&&delete i[e];return(r=v(e,this,t,{value:0},n))==null?null:r}function b(t,n){var r,i,a,o,s,c;let l=(r=n==null||(i=n.currentTarget)==null||(i=i.dataset)==null?void 0:i.wvJsxHandler)==null?n==null||(a=n.target)==null||(a=a.dataset)==null?void 0:a.wvJsxHandler:r;if(typeof l!=`string`||!l)return;let u=t==null?void 0:t.__wevu,d=(o=t==null?void 0:t[e])==null?u==null||(s=u.proxy)==null?void 0:s[e]:o,f=d==null?void 0:d[l];return typeof f==`function`?f.call((c=u==null?void 0:u.proxy)==null?t:c,n):void 0}export{t as Fragment,r as createTextVNode,n as createVNode,i as isVNode,a as mergeProps,y as normalizeJsxIsland,s as resolveComponent,m as resolveDirective,b as runJsxIslandHandler,o as transformOn,u as vModelCheckbox,d as vModelRadio,f as vModelSelect,l as vModelText,c as vShow,p as withDirectives};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
type LayoutBridgeContext = Record<string, any>;
|
|
3
3
|
type LayoutBridgeComponentResolver = (selector: string) => any;
|
|
4
4
|
type LayoutHostMap = Record<string, unknown>;
|
|
5
|
-
type LayoutBridgeInstance<T = LayoutBridgeContext> = T & {
|
|
5
|
+
export type LayoutBridgeInstance<T = LayoutBridgeContext> = T & {
|
|
6
6
|
selectComponent?: LayoutBridgeComponentResolver;
|
|
7
7
|
};
|
|
8
|
-
interface LayoutHostBinding {
|
|
8
|
+
export interface LayoutHostBinding {
|
|
9
9
|
key: string;
|
|
10
10
|
refName?: string;
|
|
11
11
|
selector: string;
|
|
@@ -20,40 +20,39 @@ interface LayoutHostResolveOptions<T = any> {
|
|
|
20
20
|
/**
|
|
21
21
|
* 为当前页面注册 layout bridge,使页面或子组件可消费 layout 内部能力。
|
|
22
22
|
*/
|
|
23
|
-
declare function registerPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
23
|
+
export declare function registerPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* 移除当前页面的 layout bridge 注册。
|
|
26
26
|
*/
|
|
27
|
-
declare function unregisterPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
27
|
+
export declare function unregisterPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
28
28
|
/**
|
|
29
29
|
* 解析当前页面已注册的 layout bridge,找不到时回退到传入上下文。
|
|
30
30
|
*/
|
|
31
|
-
declare function resolveLayoutBridge<T = any>(selector: string, fallbackContext?: T): LayoutBridgeInstance<T> | undefined;
|
|
31
|
+
export declare function resolveLayoutBridge<T = any>(selector: string, fallbackContext?: T): LayoutBridgeInstance<T> | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* 解析当前页面 layout 内通过指定 key 暴露的宿主实例。
|
|
34
34
|
*/
|
|
35
|
-
declare function resolveLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): NonNullable<T> | null;
|
|
35
|
+
export declare function resolveLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): NonNullable<T> | null;
|
|
36
36
|
/**
|
|
37
37
|
* 等待当前页面 layout 宿主实例可用,适合页面初次进入时的异步宿主解析。
|
|
38
38
|
*/
|
|
39
|
-
declare function waitForLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): Promise<T | null>;
|
|
39
|
+
export declare function waitForLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): Promise<T | null>;
|
|
40
40
|
/**
|
|
41
41
|
* 在 layout 生命周期内暴露 bridge,使页面或子组件可访问 layout 内部实例。
|
|
42
42
|
*/
|
|
43
|
-
declare function useLayoutBridge(selectors: string | string[], options?: {
|
|
43
|
+
export declare function useLayoutBridge(selectors: string | string[], options?: {
|
|
44
44
|
resolveComponent?: LayoutBridgeComponentResolver;
|
|
45
45
|
}): void;
|
|
46
46
|
/**
|
|
47
47
|
* 使用编译期注入的宿主绑定信息,直接从当前 layout 运行时实例解析子组件宿主并注册 bridge。
|
|
48
48
|
*/
|
|
49
|
-
declare function registerRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): any;
|
|
49
|
+
export declare function registerRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): any;
|
|
50
50
|
/**
|
|
51
51
|
* 移除运行时自动注册的 layout 宿主 bridge。
|
|
52
52
|
*/
|
|
53
|
-
declare function unregisterRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): boolean;
|
|
53
|
+
export declare function unregisterRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): boolean;
|
|
54
54
|
/**
|
|
55
55
|
* 使用 key -> 宿主实例的映射批量暴露 layout 内部宿主,适合 toast/dialog 等共享反馈节点。
|
|
56
56
|
*/
|
|
57
|
-
declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { LayoutBridgeInstance, LayoutHostBinding, registerPageLayoutBridge, registerRuntimeLayoutHosts, resolveLayoutBridge, resolveLayoutHost, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, useLayoutBridge, useLayoutHosts, waitForLayoutHost };
|
|
57
|
+
export declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
58
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/runtime/noSetData.d.ts
|
|
2
|
-
declare function markNoSetData<T extends object>(value: T): T;
|
|
3
|
-
declare function isNoSetData(value: unknown): boolean;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { isNoSetData, markNoSetData };
|
|
2
|
+
export declare function markNoSetData<T extends object>(value: T): T;
|
|
3
|
+
export declare function isNoSetData(value: unknown): boolean;
|
|
4
|
+
//#endregion
|
|
@@ -2,20 +2,20 @@ import { Ref } from "../reactivity/ref.mjs";
|
|
|
2
2
|
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
3
3
|
import "../index.mjs";
|
|
4
4
|
//#region src/runtime/pageEnvironment.d.ts
|
|
5
|
-
interface PageStackSnapshot {
|
|
5
|
+
export interface PageStackSnapshot {
|
|
6
6
|
canGoBack: boolean;
|
|
7
7
|
currentRoute: string;
|
|
8
8
|
stackLength: number;
|
|
9
9
|
}
|
|
10
|
-
interface UsePageStackOptions {
|
|
10
|
+
export interface UsePageStackOptions {
|
|
11
11
|
autoRefresh?: boolean;
|
|
12
12
|
}
|
|
13
|
-
interface NavigationBarMetrics {
|
|
13
|
+
export interface NavigationBarMetrics {
|
|
14
14
|
navigationBarHeight: number;
|
|
15
15
|
navigationHeight: number;
|
|
16
16
|
statusBarHeight: number;
|
|
17
17
|
}
|
|
18
|
-
interface UseNavigationBarMetricsOptions {
|
|
18
|
+
export interface UseNavigationBarMetricsOptions {
|
|
19
19
|
autoRefresh?: boolean;
|
|
20
20
|
defaultNavigationBarHeight?: number;
|
|
21
21
|
defaultStatusBarHeight?: number;
|
|
@@ -23,11 +23,11 @@ interface UseNavigationBarMetricsOptions {
|
|
|
23
23
|
/**
|
|
24
24
|
* 获取当前小程序页面栈的稳定快照。
|
|
25
25
|
*/
|
|
26
|
-
declare function getCurrentPageStackSnapshot(): PageStackSnapshot;
|
|
26
|
+
export declare function getCurrentPageStackSnapshot(): PageStackSnapshot;
|
|
27
27
|
/**
|
|
28
28
|
* 在 setup 中跟踪当前小程序页面栈状态。
|
|
29
29
|
*/
|
|
30
|
-
declare function usePageStack(options?: UsePageStackOptions): {
|
|
30
|
+
export declare function usePageStack(options?: UsePageStackOptions): {
|
|
31
31
|
canGoBack: ComputedRef<boolean>;
|
|
32
32
|
currentRoute: Ref<string, string>;
|
|
33
33
|
refresh: () => void;
|
|
@@ -36,15 +36,14 @@ declare function usePageStack(options?: UsePageStackOptions): {
|
|
|
36
36
|
/**
|
|
37
37
|
* 计算自定义导航栏所需的状态栏和胶囊占位高度。
|
|
38
38
|
*/
|
|
39
|
-
declare function getNavigationBarMetrics(options?: Omit<UseNavigationBarMetricsOptions, 'autoRefresh'>): NavigationBarMetrics;
|
|
39
|
+
export declare function getNavigationBarMetrics(options?: Omit<UseNavigationBarMetricsOptions, 'autoRefresh'>): NavigationBarMetrics;
|
|
40
40
|
/**
|
|
41
41
|
* 在 setup 中跟踪自定义导航栏尺寸。
|
|
42
42
|
*/
|
|
43
|
-
declare function useNavigationBarMetrics(options?: UseNavigationBarMetricsOptions): {
|
|
43
|
+
export declare function useNavigationBarMetrics(options?: UseNavigationBarMetricsOptions): {
|
|
44
44
|
navigationBarHeight: Ref<number, number>;
|
|
45
45
|
navigationHeight: ComputedRef<number>;
|
|
46
46
|
refresh: () => void;
|
|
47
47
|
statusBarHeight: Ref<number, number>;
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
|
-
export { NavigationBarMetrics, PageStackSnapshot, UseNavigationBarMetricsOptions, UsePageStackOptions, getCurrentPageStackSnapshot, getNavigationBarMetrics, useNavigationBarMetrics, usePageStack };
|
|
49
|
+
//#endregion
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/runtime/pageLayout.d.ts
|
|
2
|
-
interface WevuPageLayoutMap {}
|
|
2
|
+
export interface WevuPageLayoutMap {}
|
|
3
3
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
4
4
|
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : Record<string, any>;
|
|
5
5
|
type PageLayoutNamedState = { [Name in ResolveTypedPageLayoutName]: {
|
|
6
6
|
name: Name;
|
|
7
7
|
props: ResolveTypedPageLayoutProps<Name>;
|
|
8
8
|
}; }[ResolveTypedPageLayoutName];
|
|
9
|
-
type PageLayoutState = PageLayoutNamedState | {
|
|
9
|
+
export type PageLayoutState = PageLayoutNamedState | {
|
|
10
10
|
name: false;
|
|
11
11
|
props: Record<string, any>;
|
|
12
12
|
} | {
|
|
@@ -16,11 +16,10 @@ type PageLayoutState = PageLayoutNamedState | {
|
|
|
16
16
|
/**
|
|
17
17
|
* 获取当前页面 layout 状态。
|
|
18
18
|
*/
|
|
19
|
-
declare function usePageLayout(): Readonly<PageLayoutState>;
|
|
20
|
-
declare function syncRuntimePageLayoutState(target: Record<string, any>, layout: string | false, props: Record<string, any>): void;
|
|
21
|
-
declare function syncRuntimePageLayoutStateFromRuntime(target: Record<string, any>): void;
|
|
22
|
-
declare function setPageLayout(layout: false): void;
|
|
23
|
-
declare function setPageLayout<Name extends ResolveTypedPageLayoutName>(layout: Name, props?: ResolveTypedPageLayoutProps<Name>): void;
|
|
24
|
-
declare function resolveRuntimePageLayoutName(layout: string | false): string;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { PageLayoutState, WevuPageLayoutMap, resolveRuntimePageLayoutName, setPageLayout, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, usePageLayout };
|
|
19
|
+
export declare function usePageLayout(): Readonly<PageLayoutState>;
|
|
20
|
+
export declare function syncRuntimePageLayoutState(target: Record<string, any>, layout: string | false, props: Record<string, any>): void;
|
|
21
|
+
export declare function syncRuntimePageLayoutStateFromRuntime(target: Record<string, any>): void;
|
|
22
|
+
export declare function setPageLayout(layout: false): void;
|
|
23
|
+
export declare function setPageLayout<Name extends ResolveTypedPageLayoutName>(layout: Name, props?: ResolveTypedPageLayoutProps<Name>): void;
|
|
24
|
+
export declare function resolveRuntimePageLayoutName(layout: string | false): string;
|
|
25
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HostMiniProgramPageScrollOption } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
3
|
//#region src/runtime/pageScroll.d.ts
|
|
4
|
-
interface UsePageScrollThrottleOptions {
|
|
4
|
+
export interface UsePageScrollThrottleOptions {
|
|
5
5
|
/**
|
|
6
6
|
* 节流间隔(毫秒),默认 80ms。
|
|
7
7
|
*/
|
|
@@ -20,10 +20,9 @@ interface UsePageScrollThrottleOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
maxWait?: number;
|
|
22
22
|
}
|
|
23
|
-
type UsePageScrollThrottleStopHandle = () => void;
|
|
23
|
+
export type UsePageScrollThrottleStopHandle = () => void;
|
|
24
24
|
/**
|
|
25
25
|
* 在 setup 中注册节流后的 onPageScroll 监听,并在卸载时自动清理。
|
|
26
26
|
*/
|
|
27
|
-
declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, usePageScrollThrottle };
|
|
27
|
+
export declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
28
|
+
//#endregion
|