wevu 7.0.3 → 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/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/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/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.d.mts +15 -16
- package/dist/runtime/disposables.d.mts +6 -7
- package/dist/runtime/elementIntersectionObserver.d.mts +5 -6
- 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/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.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 +2 -2
|
@@ -5,7 +5,7 @@ import { setGlobalProvidedValue } from "./provideStore.mjs";
|
|
|
5
5
|
*
|
|
6
6
|
* wevu 的依赖注入上下文来自同步 `setup()` 阶段的当前实例。
|
|
7
7
|
*/
|
|
8
|
-
declare function hasInjectionContext(): boolean;
|
|
8
|
+
export declare function hasInjectionContext(): boolean;
|
|
9
9
|
/**
|
|
10
10
|
* 在组件上下文中向后代注入值(与 Vue 3 行为兼容),若没有当前实例则回落到全局存储。
|
|
11
11
|
*
|
|
@@ -21,7 +21,7 @@ declare function hasInjectionContext(): boolean;
|
|
|
21
21
|
* })
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
declare function provide<T>(key: any, value: T): void;
|
|
24
|
+
export declare function provide<T>(key: any, value: T): void;
|
|
25
25
|
/**
|
|
26
26
|
* 从祖先组件(或全局存储)读取提供的值。
|
|
27
27
|
*
|
|
@@ -39,21 +39,21 @@ declare function provide<T>(key: any, value: T): void;
|
|
|
39
39
|
* })
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
declare function inject<T>(key: any, defaultValue: T): T;
|
|
43
|
-
declare function inject<T>(key: any): T | undefined;
|
|
42
|
+
export declare function inject<T>(key: any, defaultValue: T): T;
|
|
43
|
+
export declare function inject<T>(key: any): T | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* 全局注入值,适用于历史兼容场景。
|
|
46
46
|
*
|
|
47
47
|
* @deprecated 已弃用,仅用于兼容/过渡。推荐优先使用 `provide()`,
|
|
48
48
|
* 在无实例上下文时 `provide()` 会自动回落到全局存储。
|
|
49
49
|
*/
|
|
50
|
-
declare function provideGlobal<T>(key: any, value: T): void;
|
|
50
|
+
export declare function provideGlobal<T>(key: any, value: T): void;
|
|
51
51
|
/**
|
|
52
52
|
* 从全局存储读取值,适用于历史兼容场景。
|
|
53
53
|
*
|
|
54
54
|
* @deprecated 已弃用,仅用于兼容/过渡。推荐优先使用 `inject()`,
|
|
55
55
|
* 在无实例上下文时 `inject()` 会自动从全局存储读取。
|
|
56
56
|
*/
|
|
57
|
-
declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
57
|
+
export declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
58
58
|
//#endregion
|
|
59
|
-
export {
|
|
59
|
+
export { setGlobalProvidedValue };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
//#region src/runtime/pullDownRefresh.d.ts
|
|
2
|
-
type PullDownRefreshHandler = () => void | Promise<void>;
|
|
3
|
-
interface UseAsyncPullDownRefreshOptions {
|
|
2
|
+
export type PullDownRefreshHandler = () => void | Promise<void>;
|
|
3
|
+
export interface UseAsyncPullDownRefreshOptions {
|
|
4
4
|
onError?: (error: unknown) => void | Promise<void>;
|
|
5
5
|
stopPullDownRefresh?: () => unknown | Promise<unknown>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
9
9
|
*/
|
|
10
|
-
declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { PullDownRefreshHandler, UseAsyncPullDownRefreshOptions, useAsyncPullDownRefresh };
|
|
10
|
+
export declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
11
|
+
//#endregion
|
|
@@ -9,6 +9,5 @@ import { WatchMap } from "./watch.mjs";
|
|
|
9
9
|
* 注册 App 入口(框架内部使用)。
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { registerApp };
|
|
12
|
+
export declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
13
|
+
//#endregion
|
|
@@ -10,8 +10,7 @@ import { WatchMap } from "./watch.mjs";
|
|
|
10
10
|
* 注册组件入口(框架内部使用)。
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions, options?: {
|
|
13
|
+
export declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions, options?: {
|
|
14
14
|
registerNative?: boolean;
|
|
15
15
|
}): any;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { registerComponent };
|
|
16
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/runtime/register/inline.d.ts
|
|
2
|
-
interface InlineExpressionEntry {
|
|
2
|
+
export interface InlineExpressionEntry {
|
|
3
3
|
keys: string[];
|
|
4
4
|
indexKeys?: string[];
|
|
5
5
|
scopeResolvers?: Array<InlineExpressionScopeResolver | ((ctx: any, scope: Record<string, any>, event: any) => any) | undefined>;
|
|
@@ -10,6 +10,5 @@ interface InlineExpressionScopeResolver {
|
|
|
10
10
|
path: string;
|
|
11
11
|
indexKey: string;
|
|
12
12
|
}
|
|
13
|
-
type InlineExpressionMap = Record<string, InlineExpressionEntry>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { InlineExpressionEntry, InlineExpressionMap };
|
|
13
|
+
export type InlineExpressionMap = Record<string, InlineExpressionEntry>;
|
|
14
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../platform.mjs";import{hasOwn as i}from"../../../utils.mjs";import{normalizeEmitPayload as a}from"../../emit.mjs";import{isNativeBridgeMethod as o,markNativeBridgeMethod as s}from"../../nativeBridge.mjs";import{markNoSetData as c}from"../../noSetData.mjs";import{WEVU_NATIVE_INSTANCE_KEY as l,WEVU_PROPS_KEY as u,WEVU_SETUP_CONTEXT_INSTANCE_KEY as d,WEVU_SLOT_NAMES_PROP as f}from"@weapp-core/constants";const p=[`triggerEvent`,`createSelectorQuery`,`createIntersectionObserver`,`setData`,`setUpdatePerformanceListener`];function m(){return Object.freeze(Object.create(null))}const h=()=>[];function g(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.length>0))]:!e||typeof e!=`object`?[]:Object.entries(e).filter(([,e])=>!!e).map(([e])=>e)}function _(e){if(!i(e,f))return m();let t=()=>g(e[f]),n=e=>typeof e==`string`&&t().includes(e);return new Proxy(Object.create(null),{get(e,t){if(n(t))return h},has(e,t){return n(t)},ownKeys(){return t()},getOwnPropertyDescriptor(e,t){if(n(t))return{configurable:!0,enumerable:!0,value:h}},set(){return!1},deleteProperty(){return!1}})}function v(e,t){let n=_(t);try{Object.defineProperty(e,"$slots",{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e.$slots=n}return n}function y(){let e=(()=>{});return e.stop=()=>{},e.pause=()=>{},e.resume=()=>{},e}function b(e){try{return c(e)}catch(t){return e}}function x(t,n,r){let i=t==null?void 0:t.state,a=i&&typeof i==`object`?e(i):void 0,s=t==null?void 0:t.proxy,c=e=>{let t=e[r];if(typeof t!=`function`)return!1;if(o(t))return!0;let i=n[r];return typeof i==`function`&&t===i},u=e=>!e||typeof e!=`object`||e===n||e===s||c(e)?!1:typeof e[r]==`function`,d=a?a[l]:void 0;if(u(d))return d;let f=t==null?void 0:t.instance;if(u(f))return f}function S(e,t,n){s(n);try{Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(r){e[t]=n}}function C(
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../platform.mjs";import{hasOwn as i}from"../../../utils.mjs";import{normalizeEmitPayload as a}from"../../emit.mjs";import{isNativeBridgeMethod as o,markNativeBridgeMethod as s}from"../../nativeBridge.mjs";import{markNoSetData as c}from"../../noSetData.mjs";import{WEVU_NATIVE_INSTANCE_KEY as l,WEVU_PROPS_KEY as u,WEVU_SETUP_CONTEXT_INSTANCE_KEY as d,WEVU_SLOT_NAMES_PROP as f}from"@weapp-core/constants";const p=[`triggerEvent`,`createSelectorQuery`,`createIntersectionObserver`,`setData`,`setUpdatePerformanceListener`];function m(){return Object.freeze(Object.create(null))}const h=()=>[];function g(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.length>0))]:!e||typeof e!=`object`?[]:Object.entries(e).filter(([,e])=>!!e).map(([e])=>e)}function _(e){if(!i(e,f))return m();let t=()=>g(e[f]),n=e=>typeof e==`string`&&t().includes(e);return new Proxy(Object.create(null),{get(e,t){if(n(t))return h},has(e,t){return n(t)},ownKeys(){return t()},getOwnPropertyDescriptor(e,t){if(n(t))return{configurable:!0,enumerable:!0,value:h}},set(){return!1},deleteProperty(){return!1}})}function v(e,t){let n=_(t);try{Object.defineProperty(e,"$slots",{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e.$slots=n}return n}function y(){let e=(()=>{});return e.stop=()=>{},e.pause=()=>{},e.resume=()=>{},e}function b(e){try{return c(e)}catch(t){return e}}function x(t,n,r){let i=t==null?void 0:t.state,a=i&&typeof i==`object`?e(i):void 0,s=t==null?void 0:t.proxy,c=e=>{let t=e[r];if(typeof t!=`function`)return!1;if(o(t))return!0;let i=n[r];return typeof i==`function`&&t===i},u=e=>!e||typeof e!=`object`||e===n||e===s||c(e)?!1:typeof e[r]==`function`,d=a?a[l]:void 0;if(u(d))return d;let f=t==null?void 0:t.instance;if(u(f))return f}function S(e,t,n){s(n);try{Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(r){e[t]=n}}function C(a,s){let c=a[d];if(c&&typeof c==`object`)return c;let f=Object.create(null);try{Object.defineProperty(f,l,{configurable:!0,enumerable:!1,get(){let t=s==null?void 0:s.state,n=t&&typeof t==`object`?e(t):void 0,r=n==null?void 0:n[l];return r&&typeof r==`object`?r:a}})}catch(e){f[l]=a}let p=e=>{var t,n;let r=s==null?void 0:s.proxy;if(r&&Reflect.has(r,e))return{found:!0,value:Reflect.get(r,e)};let o=(t=s==null||(n=s.state)==null?void 0:n[u])==null?a[u]:t;return o&&typeof o==`object`&&i(o,e)?{found:!0,value:Reflect.get(o,e)}:{found:!1,value:void 0}},m=e=>{let t=x(s,a,e);if(t)return t;let n=a[e];if(typeof n==`function`&&!o(n))return a};S(f,`triggerEvent`,(...e)=>{let[t,n,r]=e,i=m(`triggerEvent`);i&&typeof i.triggerEvent==`function`&&(e.length>=3?i.triggerEvent(t,n,r):i.triggerEvent(t,n))}),S(f,`createSelectorQuery`,()=>{var e;let i=m(`createSelectorQuery`);if(i&&typeof i.createSelectorQuery==`function`)return i.createSelectorQuery();let o=n();if(!r(`globalCreateSelectorQuery`)||!o||typeof o.createSelectorQuery!=`function`)return;let c=o.createSelectorQuery();if(!c||!t().selectorQueryScopeByIn||typeof c.in!=`function`)return c;let l=(e=x(s,a,`setData`))==null?a:e;return c.in(l)}),S(f,`createIntersectionObserver`,e=>{var i;let o=m(`createIntersectionObserver`);if(o&&typeof o.createIntersectionObserver==`function`)return o.createIntersectionObserver(e==null?{}:e);let c=n();if(!r(`globalCreateIntersectionObserver`)||!c||typeof c.createIntersectionObserver!=`function`)return;let l=(i=x(s,a,`setData`))==null?a:i;return t().intersectionObserverScopeByParameter?c.createIntersectionObserver(l,e==null?{}:e):c.createIntersectionObserver(e==null?{}:e)}),S(f,`setData`,(e,t)=>{let n=m(`setData`);if(n&&typeof n.setData==`function`)return n.setData(e,t);let r=s==null?void 0:s.adapter,i=typeof(r==null?void 0:r.setData)==`function`?r.setData(e):void 0;return typeof t==`function`&&t(),i}),S(f,`setUpdatePerformanceListener`,e=>{let t=m(`setUpdatePerformanceListener`);if(t&&typeof t.setUpdatePerformanceListener==`function`)return t.setUpdatePerformanceListener(e)});let h=b(new Proxy(f,{get(e,t,n){if(Reflect.has(e,t))return Reflect.get(e,t,n);if(t===`$el`){var r;return(r=x(s,a,`setData`))==null?a:r}if(t===`renderRoot`||t===`shadowRoot`){var i;return((i=x(s,a,`setData`))==null?a:i)[t]}let o=p(t);if(o.found)return o.value;let c=a[t];return typeof c==`function`?c.bind(a):c},has(e,t){return Reflect.has(e,t)||p(t).found||t in a},set(e,t,n){return Reflect.has(e,t)?(e[t]=n,!0):(a[t]=n,!0)}}));try{Object.defineProperty(a,d,{value:h,configurable:!0,enumerable:!1,writable:!0})}catch(e){a[d]=h}return h}export{v as attachRuntimeSlots,y as createNoopWatchStopHandle,m as createSetupSlotsFallback,_ as createSetupSlotsProxy,C as ensureSetupContextInstance,a as normalizeEmitPayload,b as safeMarkNoSetData,p as setupInstanceMethodNames};
|
|
@@ -10,17 +10,16 @@ type RuntimeSetupFunction<D extends object, C extends ComputedDefinitions, M ext
|
|
|
10
10
|
* 挂载运行时实例(框架内部注册流程使用)。
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
declare function mountRuntimeInstance<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(target: InternalRuntimeState, runtimeApp: RuntimeApp<D, C, M>, watchMap: WatchMap | undefined, setup?: RuntimeSetupFunction<D, C, M>, options?: {
|
|
13
|
+
export declare function mountRuntimeInstance<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(target: InternalRuntimeState, runtimeApp: RuntimeApp<D, C, M>, watchMap: WatchMap | undefined, setup?: RuntimeSetupFunction<D, C, M>, options?: {
|
|
14
14
|
deferSetData?: boolean;
|
|
15
15
|
snapshotOmitKeys?: string[];
|
|
16
16
|
}): RuntimeInstance<D, C, M>;
|
|
17
|
-
declare function setRuntimeSetDataVisibility(target: InternalRuntimeState, visible: boolean): void;
|
|
17
|
+
export declare function setRuntimeSetDataVisibility(target: InternalRuntimeState, visible: boolean): void;
|
|
18
18
|
/**
|
|
19
19
|
* 卸载运行时实例(框架内部注册流程使用)。
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
declare function teardownRuntimeInstance(target: InternalRuntimeState, options?: {
|
|
22
|
+
export declare function teardownRuntimeInstance(target: InternalRuntimeState, options?: {
|
|
23
23
|
skipHooks?: boolean;
|
|
24
24
|
}): void;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { mountRuntimeInstance, setRuntimeSetDataVisibility, teardownRuntimeInstance };
|
|
25
|
+
//#endregion
|
|
@@ -6,6 +6,5 @@ type SetupRunner = {
|
|
|
6
6
|
* 执行 setup 函数并注入运行时上下文(框架内部使用)。
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
declare function runSetupFunction(setup: SetupRunner | undefined, props: Record<string, any>, context: any): unknown;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { runSetupFunction };
|
|
9
|
+
export declare function runSetupFunction(setup: SetupRunner | undefined, props: Record<string, any>, context: any): unknown;
|
|
10
|
+
//#endregion
|
|
@@ -2,11 +2,10 @@ import "../../reactivity/index.mjs";
|
|
|
2
2
|
import "../types.mjs";
|
|
3
3
|
//#region src/runtime/register/watch.d.ts
|
|
4
4
|
type WatchHandler = (this: any, value: any, oldValue: any) => void;
|
|
5
|
-
type WatchDescriptor = WatchHandler | string | {
|
|
5
|
+
export type WatchDescriptor = WatchHandler | string | {
|
|
6
6
|
handler: WatchHandler | string;
|
|
7
7
|
immediate?: boolean;
|
|
8
8
|
deep?: boolean;
|
|
9
9
|
};
|
|
10
|
-
type WatchMap = Record<string, WatchDescriptor>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { WatchDescriptor, WatchMap };
|
|
10
|
+
export type WatchMap = Record<string, WatchDescriptor>;
|
|
11
|
+
//#endregion
|
|
@@ -2,53 +2,52 @@ import { HostMiniProgramBoundingClientRectResult, HostMiniProgramNodesRefFields,
|
|
|
2
2
|
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
3
3
|
import "./types.mjs";
|
|
4
4
|
//#region src/runtime/selectorQuery.d.ts
|
|
5
|
-
interface UseSelectorQueryOptions {
|
|
5
|
+
export interface UseSelectorQueryOptions {
|
|
6
6
|
context?: InternalRuntimeState | null;
|
|
7
7
|
}
|
|
8
|
-
interface UseBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
8
|
+
export interface UseBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
9
9
|
all?: boolean;
|
|
10
10
|
}
|
|
11
|
-
interface UseSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
11
|
+
export interface UseSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
12
12
|
all?: boolean;
|
|
13
13
|
fields: HostMiniProgramNodesRefFields;
|
|
14
14
|
}
|
|
15
|
-
interface UseScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
15
|
+
export interface UseScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
16
16
|
all?: boolean;
|
|
17
17
|
}
|
|
18
|
-
interface UseAllBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
18
|
+
export interface UseAllBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
19
19
|
all: true;
|
|
20
20
|
}
|
|
21
|
-
interface UseAllSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
21
|
+
export interface UseAllSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
22
22
|
all: true;
|
|
23
23
|
fields: HostMiniProgramNodesRefFields;
|
|
24
24
|
}
|
|
25
|
-
interface UseAllScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
25
|
+
export interface UseAllScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
26
26
|
all: true;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* 创建绑定当前小程序实例的选择器查询工厂。
|
|
30
30
|
*/
|
|
31
|
-
declare function useSelectorQuery(options?: UseSelectorQueryOptions): () => HostMiniProgramSelectorQuery | null;
|
|
31
|
+
export declare function useSelectorQuery(options?: UseSelectorQueryOptions): () => HostMiniProgramSelectorQuery | null;
|
|
32
32
|
/**
|
|
33
33
|
* 创建绑定当前小程序实例的节点布局查询函数。
|
|
34
34
|
*/
|
|
35
|
-
declare function useBoundingClientRect(options?: UseBoundingClientRectOptions & {
|
|
35
|
+
export declare function useBoundingClientRect(options?: UseBoundingClientRectOptions & {
|
|
36
36
|
all?: false;
|
|
37
37
|
}): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult | null>;
|
|
38
|
-
declare function useBoundingClientRect(options: UseAllBoundingClientRectOptions): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult[] | null>;
|
|
38
|
+
export declare function useBoundingClientRect(options: UseAllBoundingClientRectOptions): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult[] | null>;
|
|
39
39
|
/**
|
|
40
40
|
* 创建绑定当前小程序实例的节点字段查询函数。
|
|
41
41
|
*/
|
|
42
|
-
declare function useSelectorFields(options: UseSelectorFieldsOptions & {
|
|
42
|
+
export declare function useSelectorFields(options: UseSelectorFieldsOptions & {
|
|
43
43
|
all?: false;
|
|
44
44
|
}): (selector: string) => Promise<Record<string, any> | null>;
|
|
45
|
-
declare function useSelectorFields(options: UseAllSelectorFieldsOptions): (selector: string) => Promise<Array<Record<string, any>> | null>;
|
|
45
|
+
export declare function useSelectorFields(options: UseAllSelectorFieldsOptions): (selector: string) => Promise<Array<Record<string, any>> | null>;
|
|
46
46
|
/**
|
|
47
47
|
* 创建绑定当前小程序实例的滚动位置查询函数。
|
|
48
48
|
*/
|
|
49
|
-
declare function useScrollOffset(options?: UseScrollOffsetOptions & {
|
|
49
|
+
export declare function useScrollOffset(options?: UseScrollOffsetOptions & {
|
|
50
50
|
all?: false;
|
|
51
51
|
}): (selector: string) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
52
|
-
declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
53
|
-
//#endregion
|
|
54
|
-
export { UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseBoundingClientRectOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, useBoundingClientRect, useScrollOffset, useSelectorFields, useSelectorQuery };
|
|
52
|
+
export declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
53
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/runtime/template.d.ts
|
|
2
|
-
declare function normalizeStyle(value: any): string;
|
|
3
|
-
declare function normalizeClass(value: any): string;
|
|
4
|
-
declare function resolvePropValue(target: any, key: string, fallback: any, preferProps?: boolean): any;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { normalizeClass, normalizeStyle, resolvePropValue };
|
|
2
|
+
export declare function normalizeStyle(value: any): string;
|
|
3
|
+
export declare function normalizeClass(value: any): string;
|
|
4
|
+
export declare function resolvePropValue(target: any, key: string, fallback: any, preferProps?: boolean): any;
|
|
5
|
+
//#endregion
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "./types.mjs";
|
|
2
2
|
//#region src/runtime/templateRefs.d.ts
|
|
3
|
-
interface TemplateRefBinding {
|
|
3
|
+
export interface TemplateRefBinding {
|
|
4
4
|
selector: string;
|
|
5
5
|
inFor: boolean;
|
|
6
6
|
name?: string;
|
|
7
7
|
get?: () => unknown;
|
|
8
8
|
kind?: 'component' | 'element';
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { TemplateRefBinding };
|
|
10
|
+
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ComputedGetter, WritableComputedOptions } from "../../reactivity/computed.mjs";
|
|
2
2
|
import "../../reactivity/index.mjs";
|
|
3
3
|
//#region src/runtime/types/core.d.ts
|
|
4
|
-
type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
5
|
-
type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
6
|
-
type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never; };
|
|
7
|
-
type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never; };
|
|
8
|
-
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P = Record<string, any>, S = Record<string, any>> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
4
|
+
export type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
5
|
+
export type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
6
|
+
export type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never; };
|
|
7
|
+
export type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never; };
|
|
8
|
+
export type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P = Record<string, any>, S = Record<string, any>> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
9
9
|
$attrs: Record<string, any>;
|
|
10
10
|
$props: P;
|
|
11
11
|
$refs: Record<string, any>;
|
|
@@ -19,17 +19,16 @@ type ComponentPublicInstance<D extends object = Record<string, any>, C extends C
|
|
|
19
19
|
};
|
|
20
20
|
$parent?: ComponentPublicInstance;
|
|
21
21
|
};
|
|
22
|
-
interface ModelBindingOptions<T = any, Event extends string = string, ValueProp extends string = string, Formatted = T> {
|
|
22
|
+
export interface ModelBindingOptions<T = any, Event extends string = string, ValueProp extends string = string, Formatted = T> {
|
|
23
23
|
event?: Event;
|
|
24
24
|
valueProp?: ValueProp;
|
|
25
25
|
parser?: (payload: any) => T;
|
|
26
26
|
formatter?: (value: T) => Formatted;
|
|
27
27
|
}
|
|
28
|
-
type ModelBindingPayload<T = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T> = { [K in ValueProp]: Formatted; } & { [K in `on${Capitalize<Event>}`]: (event: any) => void; };
|
|
29
|
-
interface ModelBinding<T = any> {
|
|
28
|
+
export type ModelBindingPayload<T = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T> = { [K in ValueProp]: Formatted; } & { [K in `on${Capitalize<Event>}`]: (event: any) => void; };
|
|
29
|
+
export interface ModelBinding<T = any> {
|
|
30
30
|
value: T;
|
|
31
31
|
update: (value: T) => void;
|
|
32
32
|
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T>(options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload };
|
|
34
|
+
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
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
2
|
//#region src/runtime/types/miniprogram.d.ts
|
|
3
|
-
interface MiniProgramAdapter {
|
|
3
|
+
export interface MiniProgramAdapter {
|
|
4
4
|
setData?: (payload: Record<string, any>) => void | Promise<void>;
|
|
5
5
|
}
|
|
6
6
|
type MpComponentOptions = HostMiniProgramComponentTrivialOption;
|
|
7
|
-
type MiniProgramBehaviorIdentifier = HostMiniProgramBehaviorIdentifier | string;
|
|
8
|
-
type MiniProgramComponentPropertyValue<TProperty extends HostMiniProgramComponentAllFullProperty> = HostMiniProgramComponentPropertyValue<TProperty>;
|
|
9
|
-
type MiniProgramComponentInstance<D extends object, P extends HostMiniProgramComponentPropertyOption, M extends HostMiniProgramComponentMethodOption, B extends HostMiniProgramComponentEmptyArray = HostMiniProgramComponentEmptyArray> = HostMiniProgramComponentInstance<D, P, M, B>;
|
|
10
|
-
interface MiniProgramComponentOptions {
|
|
7
|
+
export type MiniProgramBehaviorIdentifier = HostMiniProgramBehaviorIdentifier | string;
|
|
8
|
+
export type MiniProgramComponentPropertyValue<TProperty extends HostMiniProgramComponentAllFullProperty> = HostMiniProgramComponentPropertyValue<TProperty>;
|
|
9
|
+
export type MiniProgramComponentInstance<D extends object, P extends HostMiniProgramComponentPropertyOption, M extends HostMiniProgramComponentMethodOption, B extends HostMiniProgramComponentEmptyArray = HostMiniProgramComponentEmptyArray> = HostMiniProgramComponentInstance<D, P, M, B>;
|
|
10
|
+
export interface MiniProgramComponentOptions {
|
|
11
11
|
/**
|
|
12
12
|
* 类似于 mixins/traits 的组件间代码复用机制(behaviors)。
|
|
13
13
|
*/
|
|
@@ -70,11 +70,11 @@ interface MiniProgramComponentOptions {
|
|
|
70
70
|
detached?: MpComponentOptions['detached'];
|
|
71
71
|
error?: MpComponentOptions['error'];
|
|
72
72
|
}
|
|
73
|
-
type MiniProgramAppOptions<T extends Record<string, any> = Record<string, any>> = HostMiniProgramAppOptions<T>;
|
|
74
|
-
type MiniProgramInstance = HostMiniProgramComponentTrivialInstance | HostMiniProgramPageTrivialInstance | HostMiniProgramAppTrivialInstance;
|
|
75
|
-
type MiniProgramPageLifetimes = Partial<HostMiniProgramPageLifetime>;
|
|
76
|
-
type MiniProgramComponentRawOptions = Omit<HostMiniProgramComponentTrivialOption, 'behaviors'> & {
|
|
73
|
+
export type MiniProgramAppOptions<T extends Record<string, any> = Record<string, any>> = HostMiniProgramAppOptions<T>;
|
|
74
|
+
export type MiniProgramInstance = HostMiniProgramComponentTrivialInstance | HostMiniProgramPageTrivialInstance | HostMiniProgramAppTrivialInstance;
|
|
75
|
+
export type MiniProgramPageLifetimes = Partial<HostMiniProgramPageLifetime>;
|
|
76
|
+
export type MiniProgramComponentRawOptions = Omit<HostMiniProgramComponentTrivialOption, 'behaviors'> & {
|
|
77
77
|
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
78
78
|
} & MiniProgramPageLifetimes & Record<string, any>;
|
|
79
79
|
//#endregion
|
|
80
|
-
export {
|
|
80
|
+
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 };
|
|
@@ -1,44 +1,44 @@
|
|
|
1
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
2
|
//#region src/runtime/types/miniprogramHost.d.ts
|
|
3
|
-
type HostMiniProgramComponentBehaviorOptions = MiniProgramHostNamespace.Component.ComponentOptions;
|
|
4
|
-
type HostMiniProgramComponentTrivialOption = MiniProgramHostNamespace.Component.TrivialOption;
|
|
5
|
-
type HostMiniProgramBehaviorIdentifier = MiniProgramHostNamespace.Behavior.Identifier;
|
|
6
|
-
type HostMiniProgramLaunchOptions = MiniProgramHostNamespace.App.LaunchShowOption;
|
|
7
|
-
type HostMiniProgramPageNotFoundOptions = MiniProgramHostNamespace.App.PageNotFoundOption;
|
|
8
|
-
type HostMiniProgramUnhandledRejectionResult = MiniProgramHostNamespace.OnUnhandledRejectionListenerResult;
|
|
9
|
-
type HostMiniProgramThemeChangeResult = MiniProgramHostNamespace.OnThemeChangeListenerResult;
|
|
10
|
-
type HostMiniProgramMemoryWarningResult = MiniProgramHostNamespace.OnMemoryWarningListenerResult;
|
|
11
|
-
type HostMiniProgramPageScrollOption = MiniProgramHostNamespace.Page.IPageScrollOption;
|
|
12
|
-
type HostMiniProgramTabItemTapOption = MiniProgramHostNamespace.Page.ITabItemTapOption;
|
|
13
|
-
type HostMiniProgramPageResizeOption = MiniProgramHostNamespace.Page.IResizeOption;
|
|
14
|
-
type HostMiniProgramShareAppMessageOption = MiniProgramHostNamespace.Page.IShareAppMessageOption;
|
|
15
|
-
type HostMiniProgramAddToFavoritesOption = MiniProgramHostNamespace.Page.IAddToFavoritesOption;
|
|
16
|
-
type HostMiniProgramSaveExitState = MiniProgramHostNamespace.Page.ISaveExitState;
|
|
17
|
-
type HostMiniProgramRouter = MiniProgramHostNamespace.Component.Router;
|
|
18
|
-
type HostMiniProgramSwitchTabOption = MiniProgramHostNamespace.SwitchTabOption;
|
|
19
|
-
type HostMiniProgramReLaunchOption = MiniProgramHostNamespace.ReLaunchOption;
|
|
20
|
-
type HostMiniProgramRedirectToOption = MiniProgramHostNamespace.RedirectToOption;
|
|
21
|
-
type HostMiniProgramNavigateToOption = MiniProgramHostNamespace.NavigateToOption;
|
|
22
|
-
type HostMiniProgramPageLifetime = MiniProgramHostNamespace.Page.ILifetime;
|
|
23
|
-
type HostMiniProgramNodesRef = MiniProgramHostNamespace.NodesRef;
|
|
24
|
-
type HostMiniProgramNodesRefFields = Parameters<HostMiniProgramNodesRef['fields']>[0];
|
|
25
|
-
type HostMiniProgramBoundingClientRectResult = MiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
26
|
-
type HostMiniProgramScrollOffsetResult = MiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
27
|
-
type HostMiniProgramSelectorQuery = MiniProgramHostNamespace.SelectorQuery;
|
|
28
|
-
type HostMiniProgramIntersectionObserverOptions = MiniProgramHostNamespace.CreateIntersectionObserverOption;
|
|
29
|
-
type HostMiniProgramIntersectionObserver = MiniProgramHostNamespace.IntersectionObserver;
|
|
30
|
-
type HostMiniProgramComponentPropertyOption = MiniProgramHostNamespace.Component.PropertyOption;
|
|
31
|
-
type HostMiniProgramComponentMethodOption = MiniProgramHostNamespace.Component.MethodOption;
|
|
32
|
-
type HostMiniProgramComponentEmptyArray = MiniProgramHostNamespace.Component.IEmptyArray;
|
|
33
|
-
type HostMiniProgramComponentAllProperty = MiniProgramHostNamespace.Component.AllProperty;
|
|
34
|
-
type HostMiniProgramComponentAllFullProperty = MiniProgramHostNamespace.Component.AllFullProperty;
|
|
35
|
-
type HostMiniProgramComponentShortProperty = MiniProgramHostNamespace.Component.ShortProperty;
|
|
36
|
-
type HostMiniProgramComponentPropertyValue<TProperty extends HostMiniProgramComponentAllFullProperty> = MiniProgramHostNamespace.Component.PropertyToData<TProperty>;
|
|
37
|
-
type HostMiniProgramComponentInstance<D extends object, P extends HostMiniProgramComponentPropertyOption, M extends HostMiniProgramComponentMethodOption, B extends HostMiniProgramComponentEmptyArray = HostMiniProgramComponentEmptyArray> = MiniProgramHostNamespace.Component.Instance<D, P, M, B>;
|
|
38
|
-
type HostMiniProgramTriggerEventOptions = MiniProgramHostNamespace.Component.TriggerEventOption;
|
|
39
|
-
type HostMiniProgramAppOptions<T extends Record<string, any>> = MiniProgramHostNamespace.App.Options<T>;
|
|
40
|
-
type HostMiniProgramComponentTrivialInstance = MiniProgramHostNamespace.Component.TrivialInstance;
|
|
41
|
-
type HostMiniProgramPageTrivialInstance = MiniProgramHostNamespace.Page.TrivialInstance;
|
|
42
|
-
type HostMiniProgramAppTrivialInstance = MiniProgramHostNamespace.App.TrivialInstance;
|
|
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
43
|
//#endregion
|
|
44
|
-
export {
|
|
44
|
+
export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/runtime/types/miniprogramHostSources.d.ts
|
|
2
|
-
declare namespace WechatMiniProgramHostNamespace {
|
|
2
|
+
export declare namespace WechatMiniProgramHostNamespace {
|
|
3
3
|
export import App = WechatMiniprogram.App;
|
|
4
4
|
export import Behavior = WechatMiniprogram.Behavior;
|
|
5
5
|
export import Component = WechatMiniprogram.Component;
|
|
@@ -18,10 +18,10 @@ declare namespace WechatMiniProgramHostNamespace {
|
|
|
18
18
|
export import RedirectToOption = WechatMiniprogram.RedirectToOption;
|
|
19
19
|
export import NavigateToOption = WechatMiniprogram.NavigateToOption;
|
|
20
20
|
}
|
|
21
|
-
declare namespace AlipayMiniProgramHostNamespace {}
|
|
22
|
-
declare namespace DouyinMiniProgramHostNamespace {}
|
|
23
|
-
declare namespace TtMiniProgramHostNamespace {}
|
|
24
|
-
declare namespace DefaultMiniProgramHostNamespace {
|
|
21
|
+
export declare namespace AlipayMiniProgramHostNamespace {}
|
|
22
|
+
export declare namespace DouyinMiniProgramHostNamespace {}
|
|
23
|
+
export declare namespace TtMiniProgramHostNamespace {}
|
|
24
|
+
export declare namespace DefaultMiniProgramHostNamespace {
|
|
25
25
|
export import App = WechatMiniProgramHostNamespace.App;
|
|
26
26
|
export import Behavior = WechatMiniProgramHostNamespace.Behavior;
|
|
27
27
|
export import Component = WechatMiniProgramHostNamespace.Component;
|
|
@@ -40,7 +40,7 @@ declare namespace DefaultMiniProgramHostNamespace {
|
|
|
40
40
|
export import RedirectToOption = WechatMiniProgramHostNamespace.RedirectToOption;
|
|
41
41
|
export import NavigateToOption = WechatMiniProgramHostNamespace.NavigateToOption;
|
|
42
42
|
}
|
|
43
|
-
declare namespace MiniProgramHostNamespace {
|
|
43
|
+
export declare namespace MiniProgramHostNamespace {
|
|
44
44
|
export import App = DefaultMiniProgramHostNamespace.App;
|
|
45
45
|
export import Behavior = DefaultMiniProgramHostNamespace.Behavior;
|
|
46
46
|
export import Component = DefaultMiniProgramHostNamespace.Component;
|
|
@@ -59,10 +59,10 @@ declare namespace MiniProgramHostNamespace {
|
|
|
59
59
|
export import RedirectToOption = DefaultMiniProgramHostNamespace.RedirectToOption;
|
|
60
60
|
export import NavigateToOption = DefaultMiniProgramHostNamespace.NavigateToOption;
|
|
61
61
|
}
|
|
62
|
-
type MiniProgramPlatformHostSourceName = 'default' | 'wechat' | 'alipay' | 'douyin';
|
|
63
|
-
type MiniProgramRuntimeHostSourceName = 'wx' | 'my' | 'tt';
|
|
64
|
-
type MiniProgramHostSourceName = MiniProgramPlatformHostSourceName | MiniProgramRuntimeHostSourceName;
|
|
65
|
-
interface DefaultMiniProgramHostSourceContract {
|
|
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
66
|
BoundingClientRectCallbackResult: DefaultMiniProgramHostNamespace.BoundingClientRectCallbackResult;
|
|
67
67
|
ScrollOffsetCallbackResult: DefaultMiniProgramHostNamespace.ScrollOffsetCallbackResult;
|
|
68
68
|
NodesRef: DefaultMiniProgramHostNamespace.NodesRef;
|
|
@@ -80,33 +80,32 @@ interface DefaultMiniProgramHostSourceContract {
|
|
|
80
80
|
/**
|
|
81
81
|
* @description 微信平台命名兼容契约;当前默认宿主语义仍复用微信底座,但上层主链路应优先依赖 default。
|
|
82
82
|
*/
|
|
83
|
-
interface WechatMiniProgramHostSourceContract extends DefaultMiniProgramHostSourceContract {}
|
|
83
|
+
export interface WechatMiniProgramHostSourceContract extends DefaultMiniProgramHostSourceContract {}
|
|
84
84
|
/**
|
|
85
85
|
* @description 支付宝宿主类型契约占位;后续接入稳定 typings 时在此扩展。
|
|
86
86
|
*/
|
|
87
|
-
interface AlipayMiniProgramHostSourceContract extends Record<never, never> {}
|
|
87
|
+
export interface AlipayMiniProgramHostSourceContract extends Record<never, never> {}
|
|
88
88
|
/**
|
|
89
89
|
* @description 抖音宿主类型契约占位;后续接入稳定 typings 时在此扩展。
|
|
90
90
|
*/
|
|
91
|
-
interface DouyinMiniProgramHostSourceContract extends Record<never, never> {}
|
|
91
|
+
export interface DouyinMiniProgramHostSourceContract extends Record<never, never> {}
|
|
92
92
|
/**
|
|
93
93
|
* @description `tt` 命名兼容入口,保持与抖音宿主语义主名一致。
|
|
94
94
|
*/
|
|
95
|
-
interface TtMiniProgramHostSourceContract extends DouyinMiniProgramHostSourceContract {}
|
|
96
|
-
interface MiniProgramPlatformHostSourceRegistry {
|
|
95
|
+
export interface TtMiniProgramHostSourceContract extends DouyinMiniProgramHostSourceContract {}
|
|
96
|
+
export interface MiniProgramPlatformHostSourceRegistry {
|
|
97
97
|
default: DefaultMiniProgramHostSourceContract;
|
|
98
98
|
wechat: WechatMiniProgramHostSourceContract;
|
|
99
99
|
alipay: AlipayMiniProgramHostSourceContract;
|
|
100
100
|
douyin: DouyinMiniProgramHostSourceContract;
|
|
101
101
|
}
|
|
102
|
-
interface MiniProgramRuntimeHostSourceRegistry {
|
|
102
|
+
export interface MiniProgramRuntimeHostSourceRegistry {
|
|
103
103
|
wx: DefaultMiniProgramHostSourceContract;
|
|
104
104
|
my: AlipayMiniProgramHostSourceContract;
|
|
105
105
|
tt: TtMiniProgramHostSourceContract;
|
|
106
106
|
}
|
|
107
|
-
interface MiniProgramHostSourceRegistry extends MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostSourceRegistry {}
|
|
108
|
-
type MiniProgramPlatformHostNamespaceBySource<TSourceName extends MiniProgramPlatformHostSourceName = MiniProgramPlatformHostSourceName> = MiniProgramPlatformHostSourceRegistry[TSourceName];
|
|
109
|
-
type MiniProgramRuntimeHostNamespaceBySource<TSourceName extends MiniProgramRuntimeHostSourceName = MiniProgramRuntimeHostSourceName> = MiniProgramRuntimeHostSourceRegistry[TSourceName];
|
|
110
|
-
type MiniProgramHostNamespaceBySource<TSourceName extends MiniProgramHostSourceName = MiniProgramHostSourceName> = MiniProgramHostSourceRegistry[TSourceName];
|
|
111
|
-
//#endregion
|
|
112
|
-
export { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract };
|
|
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
|