wevu 7.4.0 → 7.5.0

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.
Files changed (227) hide show
  1. package/README.md +2 -0
  2. package/dist/dev/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/defineProperty.mjs +1 -1
  3. package/dist/dev/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPrimitive.mjs +1 -1
  4. package/dist/dev/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPropertyKey.mjs +1 -1
  5. package/dist/dev/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/typeof.mjs +1 -1
  6. package/dist/dev/package.mjs +1 -1
  7. package/dist/dev/reactivity/core.mjs +1 -1
  8. package/dist/dev/reactivity/ref.mjs +1 -1
  9. package/dist/dev/runtime/app/diagnostics.mjs +5 -1
  10. package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
  11. package/dist/dev/runtime/app/mount.mjs +8 -3
  12. package/dist/dev/runtime/app/mount.mjs.map +1 -1
  13. package/dist/dev/runtime/app/setData/commitTracker.mjs +39 -4
  14. package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
  15. package/dist/dev/runtime/app/setData/observation.mjs +109 -0
  16. package/dist/dev/runtime/app/setData/observation.mjs.map +1 -0
  17. package/dist/dev/runtime/app/setData/scheduler.mjs +12 -1
  18. package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
  19. package/dist/dev/runtime/app/setDataOptions.mjs +1 -0
  20. package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
  21. package/dist/dev/runtime/define/initialComputed.mjs +13 -12
  22. package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
  23. package/dist/dev/runtime/define/props.mjs +5 -1
  24. package/dist/dev/runtime/define/props.mjs.map +1 -1
  25. package/dist/dev/runtime/define/scopedSlotOptions.mjs +2 -1
  26. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  27. package/dist/dev/runtime/define.mjs +1 -1
  28. package/dist/dev/runtime/define.mjs.map +1 -1
  29. package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
  30. package/dist/dev/runtime/register/component/props.mjs +14 -4
  31. package/dist/dev/runtime/register/component/props.mjs.map +1 -1
  32. package/dist/dev/runtime/register/component/registerDefinition.mjs +27 -17
  33. package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
  34. package/dist/dev/runtime/register/component.mjs +2 -1
  35. package/dist/dev/runtime/register/component.mjs.map +1 -1
  36. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +14 -7
  37. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
  38. package/dist/dev/runtime/register/runtimeInstance/nativeDeclaration.mjs +78 -0
  39. package/dist/dev/runtime/register/runtimeInstance/nativeDeclaration.mjs.map +1 -0
  40. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +52 -8
  41. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
  42. package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
  43. package/dist/dev/runtime/register/runtimeInstance.mjs +60 -19
  44. package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
  45. package/dist/fetch.mjs +1 -1
  46. package/dist/internal-template.mjs +1 -1
  47. package/dist/package.mjs +1 -1
  48. package/dist/reactivity/core.mjs +1 -1
  49. package/dist/reactivity/reactive/patch.mjs +1 -1
  50. package/dist/reactivity/reactive/patchState.mjs +1 -1
  51. package/dist/reactivity/ref.mjs +1 -1
  52. package/dist/reactivity/watch/helpers.mjs +1 -1
  53. package/dist/router/initialNavigation.mjs +1 -1
  54. package/dist/router/useRoute.mjs +1 -1
  55. package/dist/routerInternal/matching.mjs +1 -1
  56. package/dist/routerInternal/params.mjs +1 -1
  57. package/dist/routerInternal/path.mjs +1 -1
  58. package/dist/routerInternal/query.mjs +1 -1
  59. package/dist/routerInternal/records.mjs +1 -1
  60. package/dist/runtime/app/context.mjs +1 -1
  61. package/dist/runtime/app/diagnostics.mjs +1 -1
  62. package/dist/runtime/app/mount.mjs +1 -1
  63. package/dist/runtime/app/setData/commitTracker.d.mts +2 -1
  64. package/dist/runtime/app/setData/commitTracker.mjs +1 -1
  65. package/dist/runtime/app/setData/observation.d.mts +12 -0
  66. package/dist/runtime/app/setData/observation.mjs +1 -0
  67. package/dist/runtime/app/setData/scheduler.d.mts +1 -0
  68. package/dist/runtime/app/setData/scheduler.mjs +1 -1
  69. package/dist/runtime/app/setDataOptions.mjs +1 -1
  70. package/dist/runtime/define/initialComputed.mjs +1 -1
  71. package/dist/runtime/define/props.mjs +1 -1
  72. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  73. package/dist/runtime/define.mjs +1 -1
  74. package/dist/runtime/diff.mjs +1 -1
  75. package/dist/runtime/features/publicLayout.mjs +1 -1
  76. package/dist/runtime/features/scopedSlots.d.mts +2 -1
  77. package/dist/runtime/jsxIsland.mjs +1 -1
  78. package/dist/runtime/pageLayout.mjs +1 -1
  79. package/dist/runtime/pageScroll.mjs +1 -1
  80. package/dist/runtime/register/component/alipayRegistration.mjs +1 -1
  81. package/dist/runtime/register/component/lifecycle.mjs +1 -1
  82. package/dist/runtime/register/component/props.mjs +1 -1
  83. package/dist/runtime/register/component/registerDefinition.mjs +1 -1
  84. package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
  85. package/dist/runtime/register/component.mjs +1 -1
  86. package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
  87. package/dist/runtime/register/runtimeInstance/nativeDeclaration.mjs +1 -0
  88. package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  89. package/dist/runtime/register/runtimeInstance.d.mts +8 -4
  90. package/dist/runtime/register/runtimeInstance.mjs +1 -1
  91. package/dist/runtime/setupTracking.mjs +1 -1
  92. package/dist/runtime/templateRefs.mjs +1 -1
  93. package/dist/runtime/types/runtime.d.mts +1 -0
  94. package/dist/runtime/types/setData.d.mts +30 -0
  95. package/dist/scheduler.mjs +1 -1
  96. package/dist/web-apis.mjs +1 -1
  97. package/package.json +10 -9
  98. package/dist/dev/api/vitest/setup.d.mts +0 -1
  99. package/dist/dev/api/vitest.d.mts +0 -1
  100. package/dist/dev/api.d.mts +0 -1
  101. package/dist/dev/compiler.d.mts +0 -1
  102. package/dist/dev/fetch.d.mts +0 -9
  103. package/dist/dev/index.d.mts +0 -72
  104. package/dist/dev/internal-reactivity.d.mts +0 -18
  105. package/dist/dev/internal-runtime.d.mts +0 -45
  106. package/dist/dev/internal-template.d.mts +0 -2
  107. package/dist/dev/jsxTypes.d.mts +0 -9
  108. package/dist/dev/macros/shared.d.mts +0 -83
  109. package/dist/dev/macros.d.mts +0 -71
  110. package/dist/dev/reactivity/asyncDerivation.d.mts +0 -41
  111. package/dist/dev/reactivity/computed.d.mts +0 -25
  112. package/dist/dev/reactivity/core.d.mts +0 -35
  113. package/dist/dev/reactivity/index.d.mts +0 -16
  114. package/dist/dev/reactivity/reactive/mutation.d.mts +0 -21
  115. package/dist/dev/reactivity/reactive/patch.d.mts +0 -18
  116. package/dist/dev/reactivity/reactive/shallow.d.mts +0 -22
  117. package/dist/dev/reactivity/reactive/shared.d.mts +0 -4
  118. package/dist/dev/reactivity/reactive.d.mts +0 -42
  119. package/dist/dev/reactivity/readonly.d.mts +0 -27
  120. package/dist/dev/reactivity/ref.d.mts +0 -27
  121. package/dist/dev/reactivity/shallowRef.d.mts +0 -19
  122. package/dist/dev/reactivity/toRefs.d.mts +0 -43
  123. package/dist/dev/reactivity/traverse.d.mts +0 -8
  124. package/dist/dev/reactivity/watch/types.d.mts +0 -43
  125. package/dist/dev/reactivity/watch.d.mts +0 -22
  126. package/dist/dev/router/auto-routes.d.mts +0 -8
  127. package/dist/dev/router/createRouter.d.mts +0 -9
  128. package/dist/dev/router/navigationCore.d.mts +0 -7
  129. package/dist/dev/router/resolve.d.mts +0 -7
  130. package/dist/dev/router/routeSync.d.mts +0 -2
  131. package/dist/dev/router/scrollRestoration/adapters.d.mts +0 -8
  132. package/dist/dev/router/scrollRestoration/controller.d.mts +0 -8
  133. package/dist/dev/router/scrollRestoration/host.d.mts +0 -3
  134. package/dist/dev/router/scrollRestoration/index.d.mts +0 -9
  135. package/dist/dev/router/scrollRestoration/types.d.mts +0 -61
  136. package/dist/dev/router/types.d.mts +0 -267
  137. package/dist/dev/router/useRoute.d.mts +0 -20
  138. package/dist/dev/router/useRouter.d.mts +0 -9
  139. package/dist/dev/router.d.mts +0 -30
  140. package/dist/dev/routerInternal/location.d.mts +0 -2
  141. package/dist/dev/routerInternal/matching.d.mts +0 -2
  142. package/dist/dev/routerInternal/params.d.mts +0 -2
  143. package/dist/dev/routerInternal/query.d.mts +0 -7
  144. package/dist/dev/routerInternal/records.d.mts +0 -2
  145. package/dist/dev/routerInternal/recordsWarnings.d.mts +0 -2
  146. package/dist/dev/routerInternal/shared.d.mts +0 -9
  147. package/dist/dev/routerInternal/snapshots.d.mts +0 -2
  148. package/dist/dev/routerInternal/types.d.mts +0 -9
  149. package/dist/dev/runtime/app/pending.d.mts +0 -10
  150. package/dist/dev/runtime/app/setData/commitTracker.d.mts +0 -13
  151. package/dist/dev/runtime/app/setData/scheduler.d.mts +0 -51
  152. package/dist/dev/runtime/app.d.mts +0 -8
  153. package/dist/dev/runtime/capabilities.d.mts +0 -78
  154. package/dist/dev/runtime/css.d.mts +0 -14
  155. package/dist/dev/runtime/defaults.d.mts +0 -12
  156. package/dist/dev/runtime/define.d.mts +0 -118
  157. package/dist/dev/runtime/disposables.d.mts +0 -31
  158. package/dist/dev/runtime/elementIntersectionObserver.d.mts +0 -26
  159. package/dist/dev/runtime/features/inlineEvents.d.mts +0 -7
  160. package/dist/dev/runtime/features/jsxIslands.d.mts +0 -7
  161. package/dist/dev/runtime/features/layout.d.mts +0 -7
  162. package/dist/dev/runtime/features/patchStrategy.d.mts +0 -7
  163. package/dist/dev/runtime/features/publicLayout.d.mts +0 -24
  164. package/dist/dev/runtime/features/scopedSlots.d.mts +0 -23
  165. package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +0 -7
  166. package/dist/dev/runtime/features/templateRefs.d.mts +0 -7
  167. package/dist/dev/runtime/hooks/base.d.mts +0 -27
  168. package/dist/dev/runtime/hooks/register.d.mts +0 -30
  169. package/dist/dev/runtime/hooks/vue.d.mts +0 -52
  170. package/dist/dev/runtime/hooks.d.mts +0 -4
  171. package/dist/dev/runtime/index.d.mts +0 -46
  172. package/dist/dev/runtime/intersectionObserver.d.mts +0 -14
  173. package/dist/dev/runtime/jsxIsland.d.mts +0 -37
  174. package/dist/dev/runtime/layoutBridge.d.mts +0 -55
  175. package/dist/dev/runtime/noSetData.d.mts +0 -5
  176. package/dist/dev/runtime/pageEnvironment.d.mts +0 -50
  177. package/dist/dev/runtime/pageLayout.d.mts +0 -25
  178. package/dist/dev/runtime/pageScroll.d.mts +0 -29
  179. package/dist/dev/runtime/provide.d.mts +0 -60
  180. package/dist/dev/runtime/provideStore.d.mts +0 -7
  181. package/dist/dev/runtime/publicRuntime.d.mts +0 -22
  182. package/dist/dev/runtime/pullDownRefresh.d.mts +0 -12
  183. package/dist/dev/runtime/register/app.d.mts +0 -14
  184. package/dist/dev/runtime/register/component.d.mts +0 -17
  185. package/dist/dev/runtime/register/inline.d.mts +0 -15
  186. package/dist/dev/runtime/register/runtimeInstance.d.mts +0 -26
  187. package/dist/dev/runtime/register/setup.d.mts +0 -11
  188. package/dist/dev/runtime/register/watch.d.mts +0 -12
  189. package/dist/dev/runtime/register.d.mts +0 -5
  190. package/dist/dev/runtime/selectorQuery.d.mts +0 -54
  191. package/dist/dev/runtime/template.d.mts +0 -6
  192. package/dist/dev/runtime/templateRefTypes.d.mts +0 -12
  193. package/dist/dev/runtime/types/core.d.mts +0 -35
  194. package/dist/dev/runtime/types/miniprogram.d.mts +0 -84
  195. package/dist/dev/runtime/types/miniprogramHost.d.mts +0 -45
  196. package/dist/dev/runtime/types/miniprogramHostSources.d.mts +0 -112
  197. package/dist/dev/runtime/types/options.d.mts +0 -138
  198. package/dist/dev/runtime/types/props/propTypes.d.mts +0 -79
  199. package/dist/dev/runtime/types/props/router.d.mts +0 -51
  200. package/dist/dev/runtime/types/props/setup.d.mts +0 -96
  201. package/dist/dev/runtime/types/props.d.mts +0 -4
  202. package/dist/dev/runtime/types/runtime.d.mts +0 -59
  203. package/dist/dev/runtime/types/setData.d.mts +0 -237
  204. package/dist/dev/runtime/types.d.mts +0 -29
  205. package/dist/dev/runtime/uniAppHost.d.mts +0 -8
  206. package/dist/dev/runtime/updatePerformance.d.mts +0 -13
  207. package/dist/dev/runtime/use.d.mts +0 -13
  208. package/dist/dev/runtime/vueCompat/context.d.mts +0 -8
  209. package/dist/dev/runtime/vueCompat/model.d.mts +0 -30
  210. package/dist/dev/runtime/vueCompat/router.d.mts +0 -29
  211. package/dist/dev/runtime/vueCompat/templateRef.d.mts +0 -9
  212. package/dist/dev/runtime/vueCompat.d.mts +0 -5
  213. package/dist/dev/scheduler.d.mts +0 -4
  214. package/dist/dev/store/define.d.mts +0 -8
  215. package/dist/dev/store/manager.d.mts +0 -16
  216. package/dist/dev/store/storeToRefs.d.mts +0 -11
  217. package/dist/dev/store/types.d.mts +0 -106
  218. package/dist/dev/store.d.mts +0 -5
  219. package/dist/dev/version.d.mts +0 -4
  220. package/dist/dev/vue-augment.d.mts +0 -8
  221. package/dist/dev/vue-demi.d.mts +0 -87
  222. package/dist/dev/vue-types.d.mts +0 -19
  223. package/dist/dev/web-apis.d.mts +0 -3
  224. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/defineProperty.mjs +0 -0
  225. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPrimitive.mjs +0 -0
  226. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPropertyKey.mjs +0 -0
  227. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/typeof.mjs +0 -0
@@ -1,237 +0,0 @@
1
- import { WevuBindingSourceSpanV1, WevuBindingUpdateMode } from "@weapp-core/constants";
2
- //#region src/runtime/types/setData.d.ts
3
- export interface SetDataSnapshotOptions {
4
- /**
5
- * 开发态高频 setData 告警。
6
- *
7
- * - `undefined`:默认关闭(可通过 `weapp.wevu.preset: 'performance'` 自动开启)
8
- * - `false`:关闭告警
9
- * - `true`:启用默认阈值(默认仅开发态生效)
10
- * - `object`:自定义阈值与开关
11
- */
12
- highFrequencyWarning?: boolean | {
13
- /**
14
- * 是否启用告警。
15
- * @default true
16
- */
17
- enabled?: boolean;
18
- /**
19
- * 是否仅在开发态生效。
20
- * @default true
21
- */
22
- devOnly?: boolean;
23
- /**
24
- * 统计窗口(毫秒)。
25
- * @default 1000
26
- */
27
- sampleWindowMs?: number;
28
- /**
29
- * 窗口内超过该次数触发告警。
30
- * @default 30
31
- */
32
- maxCalls?: number;
33
- /**
34
- * 告警冷却时间(毫秒),避免刷屏。
35
- * @default 5000
36
- */
37
- coolDownMs?: number;
38
- /**
39
- * 是否在检测到 `onPageScroll` 回调内调用 setData 时输出专项告警。
40
- * @default true
41
- */
42
- warnOnPageScroll?: boolean;
43
- /**
44
- * `onPageScroll` 专项告警冷却时间(毫秒)。
45
- * @default 2000
46
- */
47
- pageScrollCoolDownMs?: number;
48
- };
49
- /**
50
- * setData 策略:
51
- * - diff:全量快照 + diff(默认,兼容性最好)
52
- * - patch:按变更路径增量产出 payload(性能更好;在共享引用等场景会自动回退 diff)
53
- */
54
- strategy?: 'diff' | 'patch';
55
- /**
56
- * 仅下发指定的顶层字段(包含 data/setup 返回值与 computed)。
57
- * 若为空则默认下发所有字段。
58
- */
59
- pick?: string[];
60
- /**
61
- * 排除指定的顶层字段(包含 data/setup 返回值与 computed)。
62
- */
63
- omit?: string[];
64
- /**
65
- * 是否将 computed 的结果参与 setData(默认 true)。
66
- */
67
- includeComputed?: boolean;
68
- /**
69
- * 页面/组件处于后台态(onHide 之后)时,是否挂起 setData 下发。
70
- *
71
- * - true:后台态仅合并最新 payload,待 onShow 后一次性 flush
72
- * - false:保持默认行为,后台态也继续 setData
73
- *
74
- * @default false
75
- */
76
- suspendWhenHidden?: boolean;
77
- /**
78
- * patch 模式阈值:当本轮变更路径数量超过该值时,自动回退到 diff。
79
- * 说明:大量路径变更时,全量快照 diff 往往更快/更小。
80
- */
81
- maxPatchKeys?: number;
82
- /**
83
- * patch 模式阈值:当本轮 payload 估算字节数超过该值时,自动回退到 diff。
84
- * 说明:该估算基于 `JSON.stringify(payload).length`,仅用于启发式降级。
85
- */
86
- maxPayloadBytes?: number;
87
- /**
88
- * patch 模式优化:当同一父路径下存在多个子路径变更时,合并为父路径整体下发。
89
- *
90
- * 例如:`a.b` 与 `a.c` 同时变更,且 `mergeSiblingThreshold = 2` 时,会下发 `a`。
91
- *
92
- * 注意:当子路径包含删除(null)时,为避免删除语义不一致,将不会触发合并。
93
- */
94
- mergeSiblingThreshold?: number;
95
- /**
96
- * 同级合并的“负优化”防护:若合并后的父路径估算体积大于子路径体积之和 * ratio,则不合并。
97
- */
98
- mergeSiblingMaxInflationRatio?: number;
99
- /**
100
- * 同级合并的“负优化”防护:若父路径估算体积超过该值,则不合并。
101
- */
102
- mergeSiblingMaxParentBytes?: number;
103
- /**
104
- * 是否在父值为数组时跳过同级合并(默认 true)。
105
- */
106
- mergeSiblingSkipArray?: boolean;
107
- /**
108
- * patch 模式优化:computed 变更对比策略。
109
- *
110
- * - reference:仅 `Object.is` 比较(最快,可能会多下发)
111
- * - shallow:仅比较数组/对象第一层(折中)
112
- * - deep:深比较(可能较慢,适合小对象);会受 `computedCompareMaxDepth/maxKeys` 限制
113
- */
114
- computedCompare?: 'reference' | 'shallow' | 'deep';
115
- /**
116
- * computed 深比较最大深度(仅在 `computedCompare = "deep"` 时生效)。
117
- */
118
- computedCompareMaxDepth?: number;
119
- /**
120
- * computed 深比较最多比较 key 数(仅在 `computedCompare = "deep"` 时生效)。
121
- */
122
- computedCompareMaxKeys?: number;
123
- /**
124
- * 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多向下遍历的深度(root 为 0)。
125
- */
126
- prelinkMaxDepth?: number;
127
- /**
128
- * 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多索引的节点数。
129
- */
130
- prelinkMaxKeys?: number;
131
- /**
132
- * setData 调试信息回调(用于观测 patch 命中率/回退原因/payload 大小)。
133
- */
134
- debug?: (info: SetDataDebugInfo) => void;
135
- /**
136
- * 内建诊断日志开关(默认 off)。
137
- *
138
- * - off:关闭内建日志
139
- * - fallback:仅在回退 diff / 超阈值时输出
140
- * - always:每次 flush 都输出
141
- */
142
- diagnostics?: 'off' | 'fallback' | 'always';
143
- /**
144
- * 疑似运行时更新循环诊断。
145
- *
146
- * 在短时间内连续触发 setData flush 时输出告警,帮助定位页面/组件、
147
- * 调度模式、patch 信号和 computed dirty 状态。
148
- */
149
- loopWarning?: boolean | {
150
- /**
151
- * 是否启用告警。
152
- * @default true
153
- */
154
- enabled?: boolean;
155
- /**
156
- * 统计窗口(毫秒)。
157
- * @default 1000
158
- */
159
- sampleWindowMs?: number;
160
- /**
161
- * 窗口内超过该次数触发告警。
162
- * @default 50
163
- */
164
- maxFlushes?: number;
165
- /**
166
- * 告警冷却时间(毫秒),避免刷屏。
167
- * @default 5000
168
- */
169
- coolDownMs?: number;
170
- };
171
- /**
172
- * debug 触发时机:
173
- * - fallback:仅在回退 diff / 超阈值时触发(默认)
174
- * - always:每次 flush 都触发
175
- */
176
- debugWhen?: 'fallback' | 'always';
177
- /**
178
- * debug 采样率(0-1),用于降低 debug 频率与开销(默认 1)。
179
- */
180
- debugSampleRate?: number;
181
- /**
182
- * patch 模式优化:当某个顶层字段下的变更路径数量过多时,直接提升为顶层字段整体替换。
183
- */
184
- elevateTopKeyThreshold?: number;
185
- /**
186
- * setData 序列化上限:最大递归深度(root 为 0)。超过时将停止深拷贝,保留更浅层结构。
187
- */
188
- toPlainMaxDepth?: number;
189
- /**
190
- * setData 序列化上限:最多处理的对象 key 数(累计)。超过时将停止深拷贝,保留更浅层结构。
191
- */
192
- toPlainMaxKeys?: number;
193
- /**
194
- * 是否允许函数进入 setData 快照。
195
- *
196
- * @internal
197
- */
198
- includeFunctions?: boolean;
199
- /**
200
- * 允许函数进入 setData 快照的状态路径。
201
- *
202
- * @internal
203
- */
204
- functionPaths?: string[];
205
- }
206
- /**
207
- * 与本次 setData 诊断相关的编译期模板绑定。
208
- */
209
- export interface SetDataBindingDiagnostic {
210
- id: string;
211
- outputPath: string;
212
- updateMode: WevuBindingUpdateMode;
213
- sourceFile: string;
214
- sourceLocation?: WevuBindingSourceSpanV1;
215
- }
216
- export interface SetDataDebugInfo {
217
- mode: 'patch' | 'diff';
218
- reason: 'patch' | 'diff' | 'needsFullSnapshot' | 'maxPatchKeys' | 'maxPayloadBytes' | 'loopWarning' | 'commitFailure';
219
- pendingPatchKeys: number;
220
- payloadKeys: number;
221
- estimatedBytes?: number;
222
- bytes?: number;
223
- mergedSiblingParents?: number;
224
- computedDirtyKeys?: number;
225
- flushCount?: number;
226
- windowMs?: number;
227
- targetLabel?: string;
228
- message?: string;
229
- /**
230
- * 根据实际 payload 或待处理路径解析出的相关编译期绑定。
231
- */
232
- bindings?: SetDataBindingDiagnostic[];
233
- revision?: number;
234
- committedRevision?: number;
235
- }
236
- //#endregion
237
- //# sourceMappingURL=setData.d.mts.map
@@ -1,29 +0,0 @@
1
- import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./types/miniprogramHostSources.mjs";
2
- 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 "./types/miniprogramHost.mjs";
3
- import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
4
- import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
5
- import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
6
- import { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
7
- import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
8
- import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextSelectorQuery, SetupFunction } from "./types/props/setup.mjs";
9
- import "./types/props.mjs";
10
- import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
11
- import { SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
12
- import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
13
- //#region src/runtime/types.d.ts
14
- export interface WevuGlobalComponents {}
15
- export interface WevuGlobalDirectives {}
16
- export interface GlobalComponents extends WevuGlobalComponents {}
17
- export interface GlobalDirectives extends WevuGlobalDirectives {}
18
- export interface TemplateRefs {}
19
- export interface TemplateRefValue {
20
- selector: string;
21
- boundingClientRect: (cb?: (value: HostMiniProgramBoundingClientRectResult | null) => void) => Promise<HostMiniProgramBoundingClientRectResult | null>;
22
- scrollOffset: (cb?: (value: HostMiniProgramScrollOffsetResult | null) => void) => Promise<HostMiniProgramScrollOffsetResult | null>;
23
- fields: (fields: HostMiniProgramNodesRefFields, cb?: (value: any) => void) => Promise<any | null>;
24
- node: (cb?: (value: any) => void) => Promise<any | null>;
25
- }
26
- export type MiniProgramTemplateRefValue = TemplateRefValue;
27
- //#endregion
28
- export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, AllowedComponentProps, AppConfig, ComponentCustomProps, ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, CreateAppOptions, DataOption, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DefineAppOptions, DefineComponent, DefineComponentOptions, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, ExtractComputed, ExtractDefaultPropTypes, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, 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, InferNativePropType, InferNativeProps, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, MethodDefinitions, MiniProgramAdapter, HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, MiniProgramComponentInstance, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, MiniProgramComponentOptions, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramInstance, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime as MiniProgramPageLifetime, MiniProgramPageLifetimes, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter as MiniProgramRouter, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, ModelBinding, ModelBindingOptions, ModelBindingPayload, NativeComponent, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, ObjectDirective, PageFeatures, PropConstructor, PropOptions, PropType, PublicProps, RuntimeApp, RuntimeInstance, SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextRouter, SetupContextSelectorQuery, SetupFunction, ShallowUnwrapRef, HostMiniProgramTriggerEventOptions as TriggerEventOptions, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, VNode, VNodeProps, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract, WevuPlugin, WevuTypedRouterRouteMap };
29
- //# sourceMappingURL=types.d.mts.map
@@ -1,8 +0,0 @@
1
- //#region src/runtime/uniAppHost.d.ts
2
- type UniAppHost = Record<string, any>;
3
- /**
4
- * 在原生小程序宿主上补齐 uni-app 专属 API,并保持未适配 API 继续继承宿主实现。
5
- */
6
- export declare function createUniAppHost(host: UniAppHost): UniAppHost;
7
- //#endregion
8
- //# sourceMappingURL=uniAppHost.d.mts.map
@@ -1,13 +0,0 @@
1
- //#region src/runtime/updatePerformance.d.ts
2
- export type UpdatePerformanceListenerResult = Record<string, any>;
3
- export type UpdatePerformanceListener = (result: UpdatePerformanceListenerResult) => void;
4
- export type UseUpdatePerformanceListenerStopHandle = () => void;
5
- /**
6
- * 在 setup 中注册更新性能监听,并在卸载时自动清理。
7
- *
8
- * - 底层能力:`instance.setUpdatePerformanceListener(listener)`。
9
- * - 清理策略:卸载时回传 `undefined` 作为监听器,平台不支持时静默降级。
10
- */
11
- export declare function useUpdatePerformanceListener(listener: UpdatePerformanceListener): UseUpdatePerformanceListenerStopHandle;
12
- //#endregion
13
- //# sourceMappingURL=updatePerformance.d.mts.map
@@ -1,13 +0,0 @@
1
- import { RuntimeApp, WevuPlugin } from "./types/runtime.mjs";
2
- import "./types.mjs";
3
- //#region src/runtime/use.d.ts
4
- /**
5
- * 在 `app` 级 `setup()` 中显式获取运行时 app,提供与 `app.use()` / `app.provide()` 对齐的 SFC 写法。
6
- */
7
- export declare function defineAppSetup<T>(setup: (app: RuntimeApp<any, any, any>) => T): T;
8
- /**
9
- * 在 `app` 级 `setup()` 中安装插件,提供与 `app.use()` 对齐的 SFC 调用方式。
10
- */
11
- export declare function use(plugin: WevuPlugin, ...options: any[]): RuntimeApp<any, any, any>;
12
- //#endregion
13
- //# sourceMappingURL=use.d.mts.map
@@ -1,8 +0,0 @@
1
- import { SetupContextNativeInstance } from "../types/props/setup.mjs";
2
- import "../types.mjs";
3
- //#region src/runtime/vueCompat/context.d.ts
4
- export declare function useAttrs(): Record<string, any>;
5
- export declare function useSlots(): Record<string, any>;
6
- export declare function useNativeInstance(): SetupContextNativeInstance;
7
- //#endregion
8
- //# sourceMappingURL=context.d.mts.map
@@ -1,30 +0,0 @@
1
- import { Ref } from "../../reactivity/ref.mjs";
2
- import "../../reactivity/index.mjs";
3
- import { ModelBinding, ModelBindingOptions, ModelBindingPayload } from "../types/core.mjs";
4
- import "../types.mjs";
5
- //#region src/runtime/vueCompat/model.d.ts
6
- export type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>;
7
- export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>];
8
- export interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {
9
- get?: (value: T, modifiers: ModelModifiers<M>) => G;
10
- set?: (value: S, modifiers: ModelModifiers<M>) => T;
11
- }
12
- export declare function useModel<T = any, M extends PropertyKey = string>(props: Record<string, any>, name: string): ModelRef<T, M, T, T>;
13
- export declare function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(props: Record<string, any>, name: string, options: UseModelOptions<T, M, G, S>): ModelRef<T, M, G, S>;
14
- /**
15
- * useBindModel 返回绑定到当前运行时实例的 bindModel。
16
- * 该方法必须在 setup() 的同步阶段调用。
17
- */
18
- type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {
19
- model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
20
- value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => Formatted;
21
- on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
22
- };
23
- export declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
24
- /**
25
- * useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
26
- */
27
- export declare function useChangeModel(): <T = any, ValueProp extends string = "value", Formatted = T>(path: string, options?: ModelBindingOptions<T, "change", ValueProp, Formatted>) => ModelBindingPayload<T, "change", ValueProp, Formatted>;
28
- export declare function mergeModels<T>(a: T, b: T): T;
29
- //#endregion
30
- //# sourceMappingURL=model.d.mts.map
@@ -1,29 +0,0 @@
1
- import { SetupContextRouter } from "../types/props/router.mjs";
2
- import "../types.mjs";
3
- //#region src/runtime/vueCompat/router.d.ts
4
- type RuntimeRouter = SetupContextRouter;
5
- /**
6
- * 获取与当前组件路径语义一致的原生 Router 对象。
7
- *
8
- * - 优先使用实例上的 `this.router`(组件路径语义)。
9
- * - 不可用时回退到 `this.pageRouter`。
10
- * - App setup 或低版本基础库再回退到宿主全局路由方法。
11
- * - 无 setup 上下文且宿主全局路由可用时,仍可创建应用级路由器。
12
- *
13
- * 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
14
- * 推荐改用 `wevu/router` 子入口的 `useRouter()`。
15
- */
16
- export declare function useNativeRouter(): RuntimeRouter;
17
- /**
18
- * 获取与当前页面路径语义一致的原生 Router 对象。
19
- *
20
- * - 优先使用实例上的 `this.pageRouter`(页面路径语义)。
21
- * - 不可用时回退到 `this.router`。
22
- * - App setup 或低版本基础库再回退到宿主全局路由方法。
23
- *
24
- * 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
25
- * 推荐改用 `wevu/router` 子入口的 `useRouter()`。
26
- */
27
- export declare function useNativePageRouter(): RuntimeRouter;
28
- //#endregion
29
- //# sourceMappingURL=router.d.mts.map
@@ -1,9 +0,0 @@
1
- import { ShallowRef } from "../../reactivity/ref.mjs";
2
- import "../../reactivity/index.mjs";
3
- import { TemplateRefs } from "../types.mjs";
4
- //#region src/runtime/vueCompat/templateRef.d.ts
5
- export type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
6
- export declare function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>;
7
- export declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
8
- //#endregion
9
- //# sourceMappingURL=templateRef.d.mts.map
@@ -1,5 +0,0 @@
1
- import { useAttrs, useNativeInstance, useSlots } from "./vueCompat/context.mjs";
2
- import { ModelModifiers, ModelRef, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel } from "./vueCompat/model.mjs";
3
- import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
4
- import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
5
- export { type ModelModifiers, type TemplateRef, type UseModelOptions, mergeModels, useAttrs, useBindModel, useChangeModel, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useSlots, useTemplateRef };
@@ -1,4 +0,0 @@
1
- //#region src/scheduler.d.ts
2
- export declare function nextTick<T>(fn?: () => T): Promise<T>;
3
- //#endregion
4
- //# sourceMappingURL=scheduler.d.mts.map
@@ -1,8 +0,0 @@
1
- import { DefineStoreOptions, OptionsStore, SetupStore, StoreDefinition, StoreSetupOptions } from "./types.mjs";
2
- //#region src/store/define.d.ts
3
- /** 定义 Setup Store,返回值在实例上自动解包 ref。 */
4
- export declare function defineStore<Id extends string, T extends Record<string, any>>(id: Id, setup: () => T, options?: StoreSetupOptions): StoreDefinition<Id, SetupStore<Id, T>>;
5
- /** 定义 Options Store,共享 state/getters/actions 的 this 类型。 */
6
- export declare function defineStore<Id extends string, S extends Record<string, any> = Record<never, never>, G extends Record<string, any> = Record<never, never>, A extends Record<string, any> = Record<never, never>>(id: Id, options: DefineStoreOptions<S, G, A>): StoreDefinition<Id, OptionsStore<S, G, A, Id>>;
7
- //#endregion
8
- //# sourceMappingURL=define.d.mts.map
@@ -1,16 +0,0 @@
1
- import { Pinia } from "./types.mjs";
2
- //#region src/store/manager.d.ts
3
- /** 设置组件外使用的活动 Store 管理器。 */
4
- export declare function setActivePinia(pinia: Pinia): Pinia;
5
- export declare function setActivePinia(pinia: undefined): undefined;
6
- export declare function setActivePinia(pinia: Pinia | undefined): Pinia | undefined;
7
- /** 优先读取当前应用的注入上下文,再读取活动管理器。 */
8
- export declare function getActivePinia(): Pinia | undefined;
9
- /** 创建独立的状态树与作用域;安装或显式激活后再使用 Store。 */
10
- export declare function createPinia(): Pinia;
11
- /** 保留原有创建名称,与推荐的 createPinia 是同一个函数。 */
12
- export declare const createStore: typeof createPinia;
13
- /** 释放整个管理器;与单个 Store 的 $dispose 不同,此操作也清除状态。 */
14
- export declare function disposePinia(pinia: Pinia): void;
15
- //#endregion
16
- //# sourceMappingURL=manager.d.mts.map
@@ -1,11 +0,0 @@
1
- import { Ref } from "../reactivity/ref.mjs";
2
- import { ComputedRef } from "../reactivity/computed.mjs";
3
- import "../reactivity/index.mjs";
4
- import { StoreApi } from "./types.mjs";
5
- //#region src/store/storeToRefs.d.ts
6
- type IfEquals<X, Y, Yes, No> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? Yes : No;
7
- /** 仅提取状态与 getter,保留 getter 的只读类型。 */
8
- export type StoreToRefsResult<T extends Record<string, any>> = { [K in keyof T as K extends keyof StoreApi<any, any, any, any> ? never : T[K] extends ((...args: any[]) => any) ? never : K]: IfEquals<{ [P in K]: T[P]; }, { -readonly [P in K]: T[P]; }, Ref<T[K]>, ComputedRef<T[K]>>; };
9
- export declare function storeToRefs<T extends Record<string, any>>(store: T): StoreToRefsResult<T>;
10
- //#endregion
11
- //# sourceMappingURL=storeToRefs.d.mts.map
@@ -1,106 +0,0 @@
1
- import { Ref as Ref$1 } from "../reactivity/ref.mjs";
2
- import { ComputedRef, WritableComputedRef } from "../reactivity/computed.mjs";
3
- import { EffectScope } from "../reactivity/core.mjs";
4
- import { WatchOptions } from "../reactivity/watch/types.mjs";
5
- import "../reactivity/index.mjs";
6
- import { UnwrapRef } from "vue";
7
- //#region src/store/types.d.ts
8
- /** 与 Pinia 一致的变更类型和值。 */
9
- export declare const MutationType: {
10
- readonly direct: "direct";
11
- readonly patchObject: "patch object";
12
- readonly patchFunction: "patch function";
13
- };
14
- export type MutationType = typeof MutationType[keyof typeof MutationType];
15
- export type StateTree = Record<PropertyKey, any>;
16
- export type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]>; };
17
- export type SubscriptionCallbackMutation<S> = {
18
- type: 'direct' | 'patch function';
19
- storeId: string;
20
- } | {
21
- type: 'patch object';
22
- storeId: string;
23
- payload: DeepPartial<S>;
24
- };
25
- export interface SubscriptionCallback<S = any> {
26
- (mutation: SubscriptionCallbackMutation<S>, state: S): void;
27
- }
28
- /** detached 订阅不随注册时的页面或组件作用域卸载。 */
29
- export interface StoreSubscribeOptions extends WatchOptions<boolean> {
30
- detached?: boolean;
31
- }
32
- export interface ActionContext<TStore = any, TResult = any> {
33
- name: string;
34
- store: TStore;
35
- args: any[];
36
- after: (callback: (result: TResult) => void) => void;
37
- onError: (callback: (error: any) => void) => void;
38
- }
39
- export interface ActionSubscriber<TStore = any, TResult = any> {
40
- (context: ActionContext<TStore, TResult>): void;
41
- }
42
- export interface PiniaPluginContext {
43
- store: any;
44
- pinia: Pinia;
45
- app: any;
46
- options: Record<string, any>;
47
- }
48
- export interface PiniaPlugin {
49
- (context: PiniaPluginContext): Partial<PiniaCustomProperties> & Record<string, any> | void;
50
- }
51
- /** 应用的 Store 管理器,独立保存实例与状态。 */
52
- export interface Pinia {
53
- state: Ref$1<Record<string, StateTree>>;
54
- install: (app: any) => void;
55
- use: (plugin: PiniaPlugin) => Pinia;
56
- _e: EffectScope;
57
- _s: Map<string, any>;
58
- _p: PiniaPlugin[];
59
- _a: any;
60
- /** @deprecated 使用公开的 Pinia API。 */
61
- _stores: Map<string, any>;
62
- /** @deprecated 使用 use() 注册插件。 */
63
- _plugins: PiniaPlugin[];
64
- }
65
- /** createStore 返回的管理器,与 Pinia 使用同一类型契约。 */
66
- export type StoreManager = Pinia;
67
- export interface PiniaCustomProperties {}
68
- export interface PiniaCustomStateProperties<S extends StateTree = StateTree> {}
69
- export interface StoreDefinition<Id extends string = string, T = any> {
70
- (pinia?: Pinia | null): T;
71
- $id: Id;
72
- }
73
- export interface StoreSetupOptions {
74
- [key: string]: any;
75
- }
76
- export type StoreGetters<G> = { readonly [K in keyof G]: G[K] extends ((...args: any[]) => infer R) ? R : never; };
77
- /** 通过 action 名称同时收窄参数与异步解包后的返回值。 */
78
- type StoreActionContext<TStore, A> = { [K in keyof A]: A[K] extends ((...args: infer Args) => infer Result) ? Omit<ActionContext<TStore, Awaited<Result>>, 'name' | 'args'> & {
79
- name: K;
80
- args: Args;
81
- } : never; }[keyof A];
82
- export interface StoreApi<Id extends string, S, TStore, A> {
83
- $id: Id;
84
- $state: keyof PiniaCustomStateProperties extends never ? S : S & PiniaCustomStateProperties;
85
- $patch: (patch: DeepPartial<S> | ((state: S) => void)) => void;
86
- $reset: () => void;
87
- $subscribe: (callback: SubscriptionCallback<S>, options?: StoreSubscribeOptions) => () => void;
88
- $onAction: (callback: (context: StoreActionContext<TStore, A>) => void, detached?: boolean) => () => void;
89
- $dispose: () => void;
90
- }
91
- export type OptionsStore<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>, Id extends string = string> = UnwrapRef<S> & StoreGetters<G> & A & PiniaCustomProperties & PiniaCustomStateProperties<S> & StoreApi<Id, UnwrapRef<S>, OptionsStore<S, G, A, Id>, A>;
92
- export interface DefineStoreOptions<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>> {
93
- state?: () => S;
94
- getters?: G & Record<string, (state: UnwrapRef<S>) => any> & ThisType<OptionsStore<S, G, A>>;
95
- actions?: A & ThisType<OptionsStore<S, G, A>>;
96
- [key: string]: any;
97
- }
98
- type SetupActions<T> = { [K in keyof T as T[K] extends ((...args: any[]) => any) ? K : never]: T[K]; };
99
- type SetupState<T> = { [K in keyof T as T[K] extends ComputedRef<any> | WritableComputedRef<any> | ((...args: any[]) => any) ? never : K]: UnwrapRef<T[K]>; };
100
- type SetupValues<T> = { [K in keyof T as T[K] extends ComputedRef<any> ? never : K]: UnwrapRef<T[K]>; } & { readonly [K in keyof T as T[K] extends ComputedRef<any> ? K : never]: UnwrapRef<T[K]>; };
101
- export type SetupStore<Id extends string, T extends Record<string, any>> = SetupValues<T> & PiniaCustomProperties & StoreApi<Id, SetupState<T>, SetupStore<Id, T>, SetupActions<T>>;
102
- export type StoreGeneric = Record<string, any> & StoreApi<string, any, any, any>;
103
- export type StoreState<T extends StoreGeneric> = T['$state'];
104
- export type StoreActions<T extends StoreGeneric> = SetupActions<Omit<T, keyof StoreApi<any, any, any, any>>>;
105
- //#endregion
106
- //# sourceMappingURL=types.d.mts.map
@@ -1,5 +0,0 @@
1
- import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, Pinia, PiniaCustomProperties, PiniaCustomStateProperties, PiniaPlugin, PiniaPluginContext, StateTree, StoreActions, StoreDefinition, StoreGeneric, StoreManager, StoreState, StoreSubscribeOptions, SubscriptionCallback, SubscriptionCallbackMutation } from "./store/types.mjs";
2
- import { defineStore } from "./store/define.mjs";
3
- import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
4
- import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
5
- export { type ActionContext, type ActionSubscriber, type DefineStoreOptions, MutationType, type Pinia, type PiniaCustomProperties, type PiniaCustomStateProperties, type PiniaPlugin, type PiniaPluginContext, type StateTree, type StoreActions, type StoreDefinition, type StoreGeneric, type StoreManager, type StoreState, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type SubscriptionCallbackMutation, createPinia, createStore, defineStore, disposePinia, getActivePinia, setActivePinia, storeToRefs };
@@ -1,4 +0,0 @@
1
- //#region src/version.d.ts
2
- export declare const version: string;
3
- //#endregion
4
- //# sourceMappingURL=version.d.mts.map
@@ -1,8 +0,0 @@
1
- import { WevuGlobalComponents, WevuGlobalDirectives } from "./runtime/types.mjs";
2
- //#region src/vue-augment.d.ts
3
- declare module '@vue/runtime-core' {
4
- interface GlobalComponents extends WevuGlobalComponents {}
5
- interface GlobalDirectives extends WevuGlobalDirectives {}
6
- }
7
- //#endregion
8
- //# sourceMappingURL=vue-augment.d.mts.map