wevu 6.11.1 → 6.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.mts +25 -4
  2. package/package.json +2 -2
package/dist/index.d.mts CHANGED
@@ -1326,7 +1326,17 @@ type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Op
1326
1326
  type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
1327
1327
  type RecordToUnion<T extends Record<string, any>> = T[keyof T];
1328
1328
  type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{ [K in keyof T]: (evt: K, ...args: T[K]) => void }>>;
1329
- type ScriptSetupDefineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> = Omit<DefineComponentOptions<ComponentPropsOptions, D, C, M>, 'props' | 'options'> & {
1329
+ type ScriptSetupNativePropertyOption = WechatMiniprogram.Component.PropertyOption;
1330
+ type ScriptSetupNativeMethodOption = WechatMiniprogram.Component.MethodOption;
1331
+ type ScriptSetupNativeBehaviorOption = WechatMiniprogram.Component.IEmptyArray;
1332
+ type ScriptSetupNativeInstance<D extends object, P extends ScriptSetupNativePropertyOption, M extends ScriptSetupNativeMethodOption> = WechatMiniprogram.Component.Instance<D, P, M, ScriptSetupNativeBehaviorOption>;
1333
+ type ScriptSetupObservedProperty<TProperty extends WechatMiniprogram.Component.AllFullProperty, TInstance> = Omit<TProperty, 'observer'> & {
1334
+ observer?: string | ((this: TInstance, newVal: WechatMiniprogram.Component.PropertyToData<TProperty>, oldVal: WechatMiniprogram.Component.PropertyToData<TProperty>, changedPath: Array<string | number>) => void);
1335
+ };
1336
+ type ScriptSetupPropertyObserver<TProperty extends WechatMiniprogram.Component.AllProperty, TInstance> = TProperty extends infer TCurrent extends WechatMiniprogram.Component.AllFullProperty ? ScriptSetupObservedProperty<TCurrent, TInstance> : TProperty;
1337
+ type ScriptSetupNativeProperties<D extends object, P extends ScriptSetupNativePropertyOption, M extends ScriptSetupNativeMethodOption> = { [K in keyof P]: ScriptSetupPropertyObserver<P[K], ScriptSetupNativeInstance<D, P, M>> };
1338
+ type ScriptSetupNativeMethods<D extends object, P extends ScriptSetupNativePropertyOption, M extends ScriptSetupNativeMethodOption> = M & ThisType<ScriptSetupNativeInstance<D, P, M>>;
1339
+ type ScriptSetupDefineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P extends ScriptSetupNativePropertyOption = ScriptSetupNativePropertyOption> = Omit<DefineComponentOptions<ComponentPropsOptions, D, C, M>, 'props' | 'options' | 'data' | 'methods'> & {
1330
1340
  /**
1331
1341
  * props 必须通过 defineProps() 声明。
1332
1342
  */
@@ -1347,6 +1357,18 @@ type ScriptSetupDefineOptions<D extends object = Record<string, any>, C extends
1347
1357
  * 小程序 Component 选项(multipleSlots/styleIsolation 等)。
1348
1358
  */
1349
1359
  options?: WechatMiniprogram.Component.ComponentOptions;
1360
+ /**
1361
+ * 小程序原生 properties。
1362
+ */
1363
+ properties?: ScriptSetupNativeProperties<D, P, M>;
1364
+ /**
1365
+ * 小程序原生 data。
1366
+ */
1367
+ data?: D | (() => D);
1368
+ /**
1369
+ * 小程序原生 methods。
1370
+ */
1371
+ methods?: ScriptSetupNativeMethods<D, P, M>;
1350
1372
  /**
1351
1373
  * setup 执行时机(默认 attached)。
1352
1374
  */
@@ -1377,9 +1399,8 @@ declare function defineExpose<T extends Record<string, any> = Record<string, any
1377
1399
  /**
1378
1400
  * defineOptions 设置 `<script setup>` 组件选项(仅类型层)。
1379
1401
  */
1380
- declare function defineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options?: ScriptSetupDefineOptions<D, C, M> & {
1381
- options?: WechatMiniprogram.Component.ComponentOptions;
1382
- }): void;
1402
+ declare function defineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P extends WechatMiniprogram.Component.PropertyOption = WechatMiniprogram.Component.PropertyOption>(options?: ScriptSetupDefineOptions<D, C, M, P>): void;
1403
+ declare function defineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P extends WechatMiniprogram.Component.PropertyOption = WechatMiniprogram.Component.PropertyOption>(options?: () => ScriptSetupDefineOptions<D, C, M, P> | Promise<ScriptSetupDefineOptions<D, C, M, P>>): void;
1383
1404
  /**
1384
1405
  * defineSlots 声明 slots 类型(仅类型层)。
1385
1406
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wevu",
3
3
  "type": "module",
4
- "version": "6.11.1",
4
+ "version": "6.11.3",
5
5
  "description": "Vue 3 风格的小程序运行时,包含响应式、diff+setData 与轻量状态管理",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "vue": "^3.5.30",
98
98
  "@wevu/api": "0.2.2",
99
- "@wevu/compiler": "6.11.1"
99
+ "@wevu/compiler": "6.11.3"
100
100
  },
101
101
  "scripts": {
102
102
  "dev": "tsdown -w",