annil 1.7.7 → 1.7.8

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,13 @@
4
4
 
5
5
  * 解决DetailedType不接收接口类型的错误 ([ae8acbf](https://github.com/missannil/annil/commit/ae8acbfc2e62f99db565c448ad9253aa549e78bb))
6
6
 
7
+ ## [1.7.8](https://github.com/missannil/annil/compare/v1.7.7...v1.7.8) (2024-08-22)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * 当SubComponents组件有后缀时,阻止穿透(_catch)事件类型被返回的错误 ([deab409](https://github.com/missannil/annil/commit/deab409c1116d2e810cc018797b6c38061701f25))
13
+
7
14
  ## [1.7.7](https://github.com/missannil/annil/compare/v1.7.6...v1.7.7) (2024-08-13)
8
15
 
9
16
 
@@ -42,7 +42,7 @@ type Options<RootDoc extends RootComponentType, IsPage extends boolean, CurrentC
42
42
  }> & SubEventsOption<TEvents, SubEventsDoc, keyof SubEventsConstraint<CurrentCompDoc>> & SubMethodsOption<TSubMethods, Prefix, keyof (CurrentCompDoc["customEvents"] & SubEventsDoc)> & SubPageLifetimesOption<IsPage, NonNullable<RootDoc["properties"]>> & SubLifetimesOption & SubWatchOption<SubComputedDoc & SubDataDoc & AllRootDataDoc & SubStoreDoc & IInjectStore> & Partial<Omit<WMCompOtherOption, "pageLifetimes" | "definitionFilter" | "export" | "observers" | "relations">> & SubObserversOption<SubComputedDoc & SubDataDoc & AllRootDataDoc & SubStoreDoc & IInjectStore> & ThisType<SubInstance<SubMethodsDoc & RootDoc["methods"], Replace<SubDataDoc, Required<CurrentCompDoc["properties"]>>, AllRootDataDoc & Replace<SubDataDoc & SubComputedDoc & SubStoreDoc, Required<CurrentCompDoc["properties"]>>, NonNullable<RootDoc["customEvents"]>, SubStoreDoc>>;
43
43
  type SubComponentConstructor<TRootDoc extends RootComponentType, TOriginalCompDoc extends ComponentType, TSupplementalPrefix extends string = "", IsPage extends boolean = TRootDoc["isPage"] extends true ? true : false, CurrentPrefix extends string = `${GetComponentPrefix<TOriginalCompDoc>}${Capitalize<TSupplementalPrefix>}`, CurrentCompDoc extends ComponentType = IfExtends<TSupplementalPrefix, "", TOriginalCompDoc, ReplacePrefix<TOriginalCompDoc, CurrentPrefix>>, AllRootDataDoc extends object = Required<TRootDoc["properties"]> & TRootDoc["data"] & TRootDoc["computed"] & TRootDoc["store"]> = <TInherit extends InheritConstraint<AllRootDataDoc, CurrentCompDoc>, TSubData extends SubDataConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubStore extends SubStoreConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TEvents extends SubEventsConstraint<CurrentCompDoc>, TSubComputed extends SubComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubMethods extends SubMethodsConstraint = {}, InheritDoc extends object = IfExtends<InheritConstraint<AllRootDataDoc, CurrentCompDoc>, TInherit, {}, TInherit>, SubDataDoc extends object = IfExtends<SubDataConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubData, {}, TSubData>, SubStoreDoc extends object = IfExtends<SubStoreConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubStore, {}, {
44
44
  [k in keyof TSubStore]: ReturnType<NonNullable<TSubStore[k]>>;
45
- }>, SubComputedDoc extends object = IfExtends<SubComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubComputed, {}, GetSubComputedDoc<TSubComputed>>, SubEventsDoc extends object = IfExtends<SubEventsConstraint<CurrentCompDoc>, TEvents, {}, TEvents>, SubMethodsDoc extends object = TSubMethods, MissingRequiredField extends PropertyKey = Exclude<RequiredKeys<NonNullable<CurrentCompDoc["properties"]>>, keyof (InheritDoc & SubDataDoc & SubStoreDoc & IfExtends<SubComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)>>, TSubComputed, {}, GetSubComputedDoc<TSubComputed>>)>>(options: Options<TRootDoc, IsPage, CurrentCompDoc, CurrentPrefix, AllRootDataDoc, TInherit, TSubData, TSubStore, TSubComputed, TEvents, TSubMethods, InheritDoc, SubDataDoc, SubStoreDoc, SubComputedDoc, SubEventsDoc, SubMethodsDoc>) => CreateSubComponentDoc<NonNullable<TOriginalCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
45
+ }>, SubComputedDoc extends object = IfExtends<SubComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TSubComputed, {}, GetSubComputedDoc<TSubComputed>>, SubEventsDoc extends object = IfExtends<SubEventsConstraint<CurrentCompDoc>, TEvents, {}, TEvents>, SubMethodsDoc extends object = TSubMethods, MissingRequiredField extends PropertyKey = Exclude<RequiredKeys<NonNullable<CurrentCompDoc["properties"]>>, keyof (InheritDoc & SubDataDoc & SubStoreDoc & IfExtends<SubComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)>>, TSubComputed, {}, GetSubComputedDoc<TSubComputed>>)>>(options: Options<TRootDoc, IsPage, CurrentCompDoc, CurrentPrefix, AllRootDataDoc, TInherit, TSubData, TSubStore, TSubComputed, TEvents, TSubMethods, InheritDoc, SubDataDoc, SubStoreDoc, SubComputedDoc, SubEventsDoc, SubMethodsDoc>) => CreateSubComponentDoc<NonNullable<CurrentCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
46
46
  /**
47
47
  * 子组件构建函数
48
48
  * @returns `(options:) => SubComponentDoc`
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import type { CreateComponentType } from "./types/CreateComponentType";
7
7
  import type { DetailedType } from "./types/DetailedType";
8
8
  import type { ExtendComponentType } from "./types/ExtendComponentType";
9
9
  import type { ParamsEqual } from "./types/TwoParamsEqual";
10
+ export type { Bubbles, BubblesCapture, BubblesCaptureComposed, BubblesComposed, Capture, CaptureComposed, Composed, CustomEventsTags, } from "./api/RootComponent/CustomEvents/CustomEventsTag";
10
11
  export type { Vant, Wm } from "./thirdLib";
11
12
  export type { CurrentTargetDataset, Dataset, Detail, Mark, TargetDataset, WMBaseEvent, WMCustomEvent, } from "./types/OfficialTypeAlias";
12
13
  export { type CreateComponentType, DefineComponent, type DetailedType, type ExtendComponentType, type IInjectInfo, instanceConfig, navigateTo, type ParamsEqual, RootComponent, SubComponent, };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAoB,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBlD,OAAO,EAEL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,aAAa,EACb,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAoB,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA2BlD,OAAO,EAEL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,aAAa,EACb,YAAY,GACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "annil",
3
- "version": "1.7.7",
3
+ "version": "1.7.8",
4
4
  "description": "微信小程序(原生开发)插件",
5
5
  "main": "dist/index.js",
6
6
  "types": "src/index.ts",
@@ -37,3 +37,47 @@ type SubDocExpect = {
37
37
  };
38
38
 
39
39
  Checking<typeof SubDoc, SubDocExpect, Test.Pass>();
40
+ // 去除已经声明的穿透事件
41
+ const removeCatchedEvents = SubComponent<{}, CompDoc>()({
42
+ data: {
43
+ aaa_str: "string",
44
+ },
45
+ events: {
46
+ aaa_bubblesCaptrueComposed_catch(e) {
47
+ console.log(e);
48
+ },
49
+ aaa_bubblesComposed_catch(e) {
50
+ console.log(e);
51
+ },
52
+ aaa_captrueComposed_catch(e) {
53
+ console.log(e);
54
+ },
55
+ },
56
+ });
57
+ void removeCatchedEvents;
58
+ // 返回穿透的自定义事件,并去除了前缀
59
+ type RemoveSubDoc = never;
60
+
61
+ Checking<typeof removeCatchedEvents, RemoveSubDoc, Test.Pass>();
62
+ // 去除有后缀时,已经声明的穿透事件
63
+ const removeCatchedEventsOfSuffix = SubComponent<{}, CompDoc, "aa">()({
64
+ data: {
65
+ aaaAa_str: "string",
66
+ },
67
+ events: {
68
+ aaaAa_bubblesCaptrueComposed_catch(e) {
69
+ console.log(e);
70
+ },
71
+ aaaAa_bubblesComposed_catch(e) {
72
+ console.log(e);
73
+ },
74
+ aaaAa_captrueComposed_catch(e) {
75
+ console.log(e);
76
+ },
77
+ },
78
+ });
79
+ void removeCatchedEventsOfSuffix;
80
+ // 返回穿透的自定义事件,并去除了前缀
81
+ type RemoveCatchedEventsOfSuffix = never;
82
+
83
+ Checking<typeof removeCatchedEventsOfSuffix, RemoveCatchedEventsOfSuffix, Test.Pass>();
@@ -231,7 +231,7 @@ type SubComponentConstructor<
231
231
  SubEventsDoc,
232
232
  SubMethodsDoc
233
233
  >,
234
- ) => CreateSubComponentDoc<NonNullable<TOriginalCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
234
+ ) => CreateSubComponentDoc<NonNullable<CurrentCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
235
235
 
236
236
  /**
237
237
  * 子组件构建函数
package/src/index.ts CHANGED
@@ -7,6 +7,16 @@ import type { CreateComponentType } from "./types/CreateComponentType";
7
7
  import type { DetailedType } from "./types/DetailedType";
8
8
  import type { ExtendComponentType } from "./types/ExtendComponentType";
9
9
  import type { ParamsEqual } from "./types/TwoParamsEqual";
10
+ export type {
11
+ Bubbles,
12
+ BubblesCapture,
13
+ BubblesCaptureComposed,
14
+ BubblesComposed,
15
+ Capture,
16
+ CaptureComposed,
17
+ Composed,
18
+ CustomEventsTags,
19
+ } from "./api/RootComponent/CustomEvents/CustomEventsTag";
10
20
  export type { Vant, Wm } from "./thirdLib";
11
21
 
12
22
  export type {