annil 1.13.1 → 1.14.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@
4
4
 
5
5
  * 解决DetailedType不接收接口类型的错误 ([ae8acbf](https://github.com/missannil/annil/commit/ae8acbfc2e62f99db565c448ad9253aa549e78bb))
6
6
 
7
+ ## [1.14.0](https://github.com/missannil/annil/compare/v1.13.2...v1.14.0) (2026-06-05)
8
+
9
+
10
+ ### Features
11
+
12
+ * 更新action符合node.js 24 ([f16712e](https://github.com/missannil/annil/commit/f16712e239071d0c65a7803247ce36fc05b079b5))
13
+
14
+ ## [1.13.2](https://github.com/missannil/annil/compare/v1.13.1...v1.13.2) (2026-06-05)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * typeEqual 和_CustomComponentDefinition ([9914cc5](https://github.com/missannil/annil/commit/9914cc59d063a1dce2427b33fd27c18d233636d1))
20
+
7
21
  ## [1.13.1](https://github.com/missannil/annil/compare/v1.13.0...v1.13.1) (2026-03-26)
8
22
 
9
23
 
@@ -1,6 +1,5 @@
1
1
  import type { Func } from "hry-types/src/Misc/Func";
2
2
  import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
3
- import type { CustomEventsTags } from "../RootComponent/CustomEvents/CustomEventsTag";
4
3
  import type { DataConstraint } from "../RootComponent/Data/DataConstraint";
5
4
  import type { EventsConstraint } from "../RootComponent/Events/EventsConstraint";
6
5
  import type { LifetimesConstraint } from "../RootComponent/Lifetimes/LifetimesConstraint";
@@ -8,7 +7,7 @@ import type { MethodsConstraint } from "../RootComponent/Methods/MethodsConstrai
8
7
  import type { PageLifetimesOption } from "../RootComponent/PageLifetimes/PageLifetimesOption";
9
8
  import type { StoreConstraint } from "../RootComponent/Store/StoreConstraint";
10
9
  type _CustomComponentDefinition = {
11
- composedEvents?: Record<string, string | number | bigint | boolean | symbol | null | undefined | Record<string, unknown> | unknown[] | CustomEventsTags>;
10
+ composedEvents?: Record<string, unknown>;
12
11
  };
13
12
  type _Validator<O, Doc, ErrKeys = Exclude<keyof O, keyof Doc>> = [ErrKeys] extends [never] ? Doc : `错误的字段${ErrKeys & string}`;
14
13
  export type CustomComponentDefinition<O extends _Validator<O, _CustomComponentDefinition> = _CustomComponentDefinition> = O;
@@ -1,2 +1,3 @@
1
1
  import type { Equals } from "hry-types/src/Any/Equals";
2
- export declare function typeEqual<const A, const B extends Equals<A, B> extends true ? unknown : never = never>(a?: NoInfer<A>): void;
2
+ export declare function typeEqual<const A>(): <B>(b: B & (Equals<A, B> extends true ? unknown : never)) => void;
3
+ export declare function typeEqual<const A, const B extends Equals<A, B> extends true ? unknown : never>(): () => void;
@@ -1,4 +1,4 @@
1
- export function typeEqual(a) {
2
- void a;
1
+ export function typeEqual() {
2
+ return () => void 0;
3
3
  }
4
4
  //# sourceMappingURL=typeEqual.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeEqual.js","sourceRoot":"","sources":["../../src/utils/typeEqual.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,SAAS,CAGvB,CAAc;IACd,KAAK,CAAC,CAAC;AACT,CAAC"}
1
+ {"version":3,"file":"typeEqual.js","sourceRoot":"","sources":["../../src/utils/typeEqual.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,SAAS;IAIvB,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "annil",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "description": "微信小程序(原生开发)插件",
5
5
  "main": "dist/index.js",
6
6
  "types": "src/index.ts",
@@ -1,6 +1,5 @@
1
1
  import type { Func } from "hry-types/src/Misc/Func";
2
2
  import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
3
- import type { CustomEventsTags } from "../RootComponent/CustomEvents/CustomEventsTag";
4
3
  import type { DataConstraint } from "../RootComponent/Data/DataConstraint";
5
4
  import type { EventsConstraint } from "../RootComponent/Events/EventsConstraint";
6
5
  import type { LifetimesConstraint } from "../RootComponent/Lifetimes/LifetimesConstraint";
@@ -9,19 +8,7 @@ import type { PageLifetimesOption } from "../RootComponent/PageLifetimes/PageLif
9
8
  import type { StoreConstraint } from "../RootComponent/Store/StoreConstraint";
10
9
 
11
10
  type _CustomComponentDefinition = {
12
- composedEvents?: Record<
13
- string,
14
- | string
15
- | number
16
- | bigint
17
- | boolean
18
- | symbol
19
- | null
20
- | undefined
21
- | Record<string, unknown>
22
- | unknown[]
23
- | CustomEventsTags
24
- >;
11
+ composedEvents?: Record<string, unknown>;
25
12
  };
26
13
 
27
14
  // 验证key是否合法
@@ -1046,4 +1046,4 @@ type Epected = {
1046
1046
  test_c: boolean | Composed;
1047
1047
  };
1048
1048
  };
1049
- typeEqual<Epected>(aaa);
1049
+ typeEqual<Epected>()(aaa);
@@ -12,11 +12,11 @@ CustomComponent<{}, Wm.Swiper>()({
12
12
  },
13
13
  events: {
14
14
  swiper_change(e) {
15
- typeEqual<number>(e.detail.current);
15
+ typeEqual<number>()(e.detail.current);
16
16
  },
17
17
 
18
18
  swiper_animationfinish(e) {
19
- typeEqual<number>(e.detail.current);
19
+ typeEqual<number>()(e.detail.current);
20
20
  },
21
21
  },
22
22
  });
@@ -7,13 +7,24 @@ import type { Equals } from "hry-types/src/Any/Equals";
7
7
  * type A = typeof a;
8
8
  * const b = 2;
9
9
  * type B = typeof b;
10
- * typeEqual<A, B>(); // B位置报错
11
- * typeEqual<A>(a); // 不报错
10
+ * type C = 1;
11
+ * typeEqual<A, C>(); // 不报错
12
+ * typeEqual<A>()(a); // 不报错
13
+ * typeEqual<A, B>(); // B位置报错 - 类型“2”不满足约束“never”
14
+ * typeEqual<A>()(b); // b位置报错 - 类型“2”的参数不能赋给类型“never”的参数。
12
15
  * ```
13
16
  */
17
+ export function typeEqual<
18
+ const A,
19
+ >(): <B>(b: B & (Equals<A, B> extends true ? unknown : never)) => void;
20
+ export function typeEqual<
21
+ const A,
22
+ const B extends Equals<A, B> extends true ? unknown : never,
23
+ >(): () => void;
24
+
14
25
  export function typeEqual<
15
26
  const A,
16
27
  const B extends Equals<A, B> extends true ? unknown : never = never,
17
- >(a?: NoInfer<A>): void {
18
- void a;
28
+ >(): (b?: B) => void {
29
+ return () => void 0;
19
30
  }