annil 1.12.0-alpha.8 → 1.12.7
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 +308 -0
- package/README.md +38 -10
- package/dist/api/ChunkComponent/index.d.ts +3 -3
- package/dist/api/ChunkComponent/index.js.map +1 -1
- package/dist/api/CustomComponent/CustomEvents/CustomEventsConstraint.d.ts +3 -3
- package/dist/api/CustomComponent/CustomInherit/CustomInheritConstraint.d.ts +2 -2
- package/dist/api/CustomComponent/index.d.ts +7 -27
- package/dist/api/CustomComponent/index.js.map +1 -1
- package/dist/api/CustomComponent/returnType.d.ts +27 -0
- package/dist/api/CustomComponent/returnType.js +2 -0
- package/dist/api/CustomComponent/returnType.js.map +1 -0
- package/dist/api/DefineComponent/RootComponent/RootComponentOption.d.ts +3 -3
- package/dist/api/DefineComponent/SubComponents/SubComponentsOption.d.ts +3 -3
- package/dist/api/DefineComponent/index.d.ts +10 -12
- package/dist/api/DefineComponent/index.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.d.ts +3 -3
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/handleRootComponent.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/handleRootComponent.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/index.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/index.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/otherFieldsHandle.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/otherFieldsHandle.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.d.ts +3 -3
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js.map +1 -1
- package/dist/api/DefineComponent/returnType/ComponentDoc.d.ts +9 -0
- package/dist/api/DefineComponent/returnType/ComponentDoc.js +2 -0
- package/dist/api/DefineComponent/returnType/ComponentDoc.js.map +1 -0
- package/dist/api/DefineComponent/returnType/GenerateComponentDoc.d.ts +18 -0
- package/dist/api/DefineComponent/returnType/GenerateComponentDoc.js +2 -0
- package/dist/api/DefineComponent/returnType/GenerateComponentDoc.js.map +1 -0
- package/dist/api/DefineComponent/{ReturnType/CreatePageDoc.d.ts → returnType/GeneratePageDoc.d.ts} +2 -2
- package/dist/api/DefineComponent/returnType/GeneratePageDoc.js +2 -0
- package/dist/api/DefineComponent/returnType/GeneratePageDoc.js.map +1 -0
- package/dist/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.d.ts +8 -0
- package/dist/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.js.map +1 -0
- package/dist/api/DefineComponent/returnType/PageDoc.js.map +1 -0
- package/dist/api/RootComponent/Events/EventsConstraint.d.ts +4 -4
- package/dist/api/RootComponent/Store/GeTStoreDoc.d.ts +3 -5
- package/dist/api/RootComponent/index.d.ts +3 -20
- package/dist/api/RootComponent/index.js.map +1 -1
- package/dist/api/RootComponent/returnType.d.ts +46 -0
- package/dist/api/RootComponent/returnType.js +2 -0
- package/dist/api/RootComponent/returnType.js.map +1 -0
- package/dist/api/wxSugar.d.ts +1 -1
- package/dist/thirdLib/wm/map.d.ts +1 -1
- package/dist/thirdLib/wm/scrollView.d.ts +2 -2
- package/dist/thirdLib/wm/view.d.ts +1 -1
- package/dist/types/CreateComponentType.d.ts +4 -4
- package/dist/types/ExtendComponentType.d.ts +3 -3
- package/dist/types/GetComponentPrefix.d.ts +2 -2
- package/dist/types/ReplacePrefix.d.ts +4 -4
- package/dist/utils/debounce.d.ts +1 -3
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/throttle.d.ts +1 -3
- package/dist/utils/throttle.js.map +1 -1
- package/package.json +10 -4
- package/src/api/ChunkComponent/ChunkComputed/test/mock.ts +14 -14
- package/src/api/ChunkComponent/ChunkData/test/mock.ts +18 -18
- package/src/api/ChunkComponent/ChunkStore/test/mock.ts +12 -12
- package/src/api/ChunkComponent/index.ts +50 -20
- package/src/api/CustomComponent/CustomComputed/test/error.test.ts +4 -4
- package/src/api/CustomComponent/CustomComputed/test/normal.test.ts +5 -5
- package/src/api/CustomComponent/CustomData/test/error.test.ts +4 -4
- package/src/api/CustomComponent/CustomData/test/normal.test.ts +2 -2
- package/src/api/CustomComponent/CustomEvents/CustomEventsConstraint.ts +6 -6
- package/src/api/CustomComponent/CustomEvents/test/error.test.ts +4 -4
- package/src/api/CustomComponent/CustomEvents/test/normal.test.ts +3 -3
- package/src/api/CustomComponent/CustomInherit/CustomInheritConstraint.ts +2 -2
- package/src/api/CustomComponent/CustomInherit/test/error.test.ts +6 -6
- package/src/api/CustomComponent/CustomInherit/test/normal.test.ts +4 -4
- package/src/api/CustomComponent/CustomInstance/test/error.test.ts +2 -2
- package/src/api/CustomComponent/CustomInstance/test/normal.test.ts +5 -5
- package/src/api/CustomComponent/CustomMethods/test/error.test.ts +5 -5
- package/src/api/CustomComponent/CustomMethods/test/normarl.test.ts +5 -5
- package/src/api/CustomComponent/CustomReturnType/test/error.test.ts +2 -2
- package/src/api/CustomComponent/CustomReturnType/test/normal.test.ts +3 -3
- package/src/api/CustomComponent/CustomStore/test/error.test.ts +3 -3
- package/src/api/CustomComponent/CustomStore/test/normal.test.ts +3 -3
- package/src/api/CustomComponent/CustomWatch/test/WatchComputed.test.ts +4 -4
- package/src/api/CustomComponent/CustomWatch/test/WatchRootData.test.ts +2 -2
- package/src/api/CustomComponent/CustomWatch/test/WatchSubData.test.ts +2 -2
- package/src/api/CustomComponent/index.ts +16 -41
- package/src/api/CustomComponent/returnType.ts +53 -0
- package/src/api/DefineComponent/NameOrPage/NameOrPathOption.ts +4 -2
- package/src/api/DefineComponent/NameOrPage/test/error.test.ts +6 -6
- package/src/api/DefineComponent/RootComponent/RootComponentOption.ts +3 -3
- package/src/api/DefineComponent/SubComponents/SubComponentsOption.ts +4 -3
- package/src/api/DefineComponent/SubComponents/test/normal.test.ts +4 -4
- package/src/api/DefineComponent/index.ts +31 -30
- package/src/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.ts +3 -3
- package/src/api/DefineComponent/normalizeOptions/handleRootComponent.ts +3 -2
- package/src/api/DefineComponent/normalizeOptions/handleSubComponents.ts +2 -2
- package/src/api/DefineComponent/normalizeOptions/index.ts +2 -2
- package/src/api/DefineComponent/normalizeOptions/otherFieldsHandle.ts +3 -3
- package/src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts +4 -3
- package/src/api/DefineComponent/returnType/ComponentDoc.ts +25 -0
- package/src/api/DefineComponent/{ReturnType/CreateComponentDoc.ts → returnType/GenerateComponentDoc.ts} +13 -10
- package/src/api/DefineComponent/{ReturnType/CreatePageDoc.ts → returnType/GeneratePageDoc.ts} +7 -3
- package/src/api/DefineComponent/{ReturnType → returnType}/GetCustomEventDocOfSubDoc.ts +4 -4
- package/src/api/DefineComponent/{ReturnType → returnType}/test/normalComponentDoc.test.ts +24 -13
- package/src/api/RootComponent/Events/EventsConstraint.ts +6 -6
- package/src/api/RootComponent/Events/test/normal.test.ts +5 -5
- package/src/api/RootComponent/Store/GeTStoreDoc.ts +13 -9
- package/src/api/RootComponent/index.ts +8 -25
- package/src/api/RootComponent/returnType.ts +57 -0
- package/src/api/wxSugar.ts +1 -1
- package/src/thirdLib/wm/map.ts +1 -1
- package/src/thirdLib/wm/scrollView.ts +2 -2
- package/src/thirdLib/wm/view.ts +1 -1
- package/src/types/CreateComponentType.ts +3 -3
- package/src/types/ExtendComponentType.ts +6 -6
- package/src/types/GetComponentPrefix.ts +4 -4
- package/src/types/ReplacePrefix.ts +6 -6
- package/src/utils/debounce.ts +6 -6
- package/src/utils/throttle.ts +5 -5
- package/tsconfig.json +3 -2
- package/dist/api/CustomComponent/CustomComponentType.d.ts +0 -10
- package/dist/api/CustomComponent/CustomComponentType.js +0 -2
- package/dist/api/CustomComponent/CustomComponentType.js.map +0 -1
- package/dist/api/DefineComponent/ReturnType/ComponentType.d.ts +0 -9
- package/dist/api/DefineComponent/ReturnType/ComponentType.js +0 -2
- package/dist/api/DefineComponent/ReturnType/ComponentType.js.map +0 -1
- package/dist/api/DefineComponent/ReturnType/CreateComponentDoc.d.ts +0 -18
- package/dist/api/DefineComponent/ReturnType/CreateComponentDoc.js +0 -2
- package/dist/api/DefineComponent/ReturnType/CreateComponentDoc.js.map +0 -1
- package/dist/api/DefineComponent/ReturnType/CreatePageDoc.js +0 -2
- package/dist/api/DefineComponent/ReturnType/CreatePageDoc.js.map +0 -1
- package/dist/api/DefineComponent/ReturnType/GetCustomEventDocOfSubDoc.d.ts +0 -8
- package/dist/api/DefineComponent/ReturnType/GetCustomEventDocOfSubDoc.js.map +0 -1
- package/dist/api/DefineComponent/ReturnType/PageDoc.js.map +0 -1
- package/dist/api/RootComponent/RootComponentType.d.ts +0 -22
- package/dist/api/RootComponent/RootComponentType.js +0 -2
- package/dist/api/RootComponent/RootComponentType.js.map +0 -1
- package/src/api/CustomComponent/CustomComponentType.ts +0 -37
- package/src/api/DefineComponent/ReturnType/ComponentType.ts +0 -25
- package/src/api/RootComponent/RootComponentType.ts +0 -44
- /package/dist/api/DefineComponent/{ReturnType → returnType}/GetCustomEventDocOfSubDoc.js +0 -0
- /package/dist/api/DefineComponent/{ReturnType → returnType}/PageDoc.d.ts +0 -0
- /package/dist/api/DefineComponent/{ReturnType → returnType}/PageDoc.js +0 -0
- /package/src/api/DefineComponent/{ReturnType → returnType}/GetPropertiesDocOfSubDoc.ts +0 -0
- /package/src/api/DefineComponent/{ReturnType → returnType}/PageDoc.ts +0 -0
- /package/src/api/DefineComponent/{ReturnType → returnType}/test/normalPageDoc.test.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"returnType.js","sourceRoot":"","sources":["../../../src/api/CustomComponent/returnType.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type RootComponentOption<
|
|
3
|
-
rootComponent?:
|
|
1
|
+
import type { RootComponentDefinition } from "../../RootComponent/returnType";
|
|
2
|
+
export type RootComponentOption<TRootComponentReturnType extends RootComponentDefinition> = {
|
|
3
|
+
rootComponent?: TRootComponentReturnType;
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type SubComponentsOption<
|
|
3
|
-
subComponents?: [...
|
|
1
|
+
import type { CustomComponentDefinition } from "../../CustomComponent/returnType";
|
|
2
|
+
export type SubComponentsOption<TCustomComponentReturnTypeList extends CustomComponentDefinition[]> = {
|
|
3
|
+
subComponents?: [...TCustomComponentReturnTypeList];
|
|
4
4
|
};
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { RootComponentTrueOptions } from "../RootComponent";
|
|
5
|
-
import type { RootComponentType } from "../RootComponent/RootComponentType";
|
|
2
|
+
import type { CustomComponentDefinition, CustomComponentDefinitionRuntime } from "../CustomComponent/returnType";
|
|
3
|
+
import type { RootComponentDefinition, RootComponentDefinitionRuntime } from "../RootComponent/returnType";
|
|
6
4
|
import type { NameOrPathOption } from "./NameOrPage/NameOrPathOption";
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
5
|
+
import type { GenerateComponentDoc } from "./returnType/GenerateComponentDoc";
|
|
6
|
+
import type { GeneratePageDoc } from "./returnType/GeneratePageDoc";
|
|
9
7
|
import type { RootComponentOption } from "./RootComponent/RootComponentOption";
|
|
10
8
|
import type { SubComponentsOption } from "./SubComponents/SubComponentsOption";
|
|
11
9
|
export type Path = `/${string}`;
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
export type
|
|
10
|
+
type Options<TRootComponentDefinition extends RootComponentDefinition, TCustomComponentDefinitionList extends CustomComponentDefinition[], TName extends string, TPath extends Path> = NameOrPathOption<TName, TPath, NonNullable<TRootComponentDefinition["isPage"]>> & RootComponentOption<TRootComponentDefinition> & SubComponentsOption<TCustomComponentDefinitionList>;
|
|
11
|
+
type Constructor = <TRootComponentDefinition extends RootComponentDefinition = {}, TCustomComponentDefinitionList extends CustomComponentDefinition[] = [], TName extends string = "", TPath extends Path = "/">(options: Options<TRootComponentDefinition, TCustomComponentDefinitionList, TName, TPath>) => IfExtends<"", TName, GeneratePageDoc<TRootComponentDefinition, TPath>, GenerateComponentDoc<TRootComponentDefinition, TName, TCustomComponentDefinitionList>>;
|
|
12
|
+
export type DefineComponentOptionRuntime = {
|
|
15
13
|
name?: string;
|
|
16
14
|
path?: string;
|
|
17
|
-
rootComponent?:
|
|
18
|
-
subComponents?:
|
|
15
|
+
rootComponent?: RootComponentDefinitionRuntime;
|
|
16
|
+
subComponents?: CustomComponentDefinitionRuntime[];
|
|
19
17
|
};
|
|
20
|
-
export declare const DefineComponent:
|
|
18
|
+
export declare const DefineComponent: Constructor;
|
|
21
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/DefineComponent/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/DefineComponent/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA+CtD,MAAM,CAAC,MAAM,eAAe,GAAgB,UAAS,OAAO;IAC1D,SAAS,CAEP,gBAAgB,CAAC,OAAuC,CAAQ,CACjE,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SlotComponentReturnType } from "../../ChunkComponent/SlotComponentReturnType";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
export declare function __throttleDebounce__FieldCheck(config:
|
|
2
|
+
import type { CustomComponentDefinitionRuntime } from "../../CustomComponent/returnType";
|
|
3
|
+
import type { RootComponentDefinitionRuntime } from "../../RootComponent/returnType";
|
|
4
|
+
export declare function __throttleDebounce__FieldCheck(config: RootComponentDefinitionRuntime | CustomComponentDefinitionRuntime[] | SlotComponentReturnType[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__throttleDebounce__FieldCheck.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,8BAA8B,CAC5C,
|
|
1
|
+
{"version":3,"file":"__throttleDebounce__FieldCheck.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,8BAA8B,CAC5C,MAAuG;IAEvG,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,KAAK,MAAM,YAAY,IAAI,MAAM,EAAE,CAAC;YAClC,8BAA8B,CAAC,YAAY,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;YAC9C,MAAM,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RootComponentDefinitionRuntime } from "../../RootComponent/returnType";
|
|
2
2
|
import type { FinalOptionsOfComponent, SameFuncOptions } from ".";
|
|
3
|
-
export declare function handleRootComponent(finalOptions: FinalOptionsOfComponent, rootComponent:
|
|
3
|
+
export declare function handleRootComponent(finalOptions: FinalOptionsOfComponent, rootComponent: RootComponentDefinitionRuntime | undefined, funcOptions: SameFuncOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleRootComponent.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/handleRootComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"handleRootComponent.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/handleRootComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAQhE,MAAM,UAAU,mBAAmB,CACjC,YAAqC,EACrC,aAAyD,EACzD,WAA4B;IAE5B,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC;QAEnD,8BAA8B,CAAC,aAAa,CAAC,CAAC;QAE9C,IAAI,aAAa,CAAC,YAAY;YAAE,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC7F,OAAO,aAAa,CAAC,YAAY,CAAC;QAClC,IAAI,aAAa,CAAC,MAAM;YAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACpF,OAAO,aAAa,CAAC,MAAM,CAAC;QAC5B,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAElD,iBAAiB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CustomComponentDefinitionRuntime } from "../../CustomComponent/returnType";
|
|
2
2
|
import type { FinalOptionsOfComponent, SameFuncOptions } from ".";
|
|
3
|
-
export declare function handleSubComponents(componentOptions: FinalOptionsOfComponent, subComponents:
|
|
3
|
+
export declare function handleSubComponents(componentOptions: FinalOptionsOfComponent, subComponents: CustomComponentDefinitionRuntime[] | undefined, funcOptions: SameFuncOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleSubComponents.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/handleSubComponents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,UAAU,mBAAmB,CACjC,gBAAyC,EACzC,
|
|
1
|
+
{"version":3,"file":"handleSubComponents.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/handleSubComponents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,UAAU,mBAAmB,CACjC,gBAAyC,EACzC,aAA6D,EAC7D,WAA4B;IAE5B,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAEhD,8BAA8B,CAAC,aAAa,CAAC,CAAC;QAC9C,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAClC,IAAI,SAAS,CAAC,MAAM;gBAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YAEhF,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAE9C,iBAAiB,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type { MethodsConstraint } from "../../RootComponent/Methods/MethodsConst
|
|
|
6
6
|
import type { PageLifetimesOption } from "../../RootComponent/PageLifetimes/PageLifetimesOption";
|
|
7
7
|
import type { PropertiesConstraint } from "../../RootComponent/Properties/PropertiesConstraint";
|
|
8
8
|
import type { StoreConstraint } from "../../RootComponent/Store/StoreConstraint";
|
|
9
|
-
import type {
|
|
9
|
+
import type { DefineComponentOptionRuntime } from "..";
|
|
10
10
|
import type { ComputedCache } from "./initComputed/initComputedAndGetCache";
|
|
11
11
|
export type WatchOldValue = Record<string, unknown[]>;
|
|
12
12
|
export type ThrottleDebounce = Partial<Record<"throttle" | "debounce", Record<string, number>>>;
|
|
@@ -37,4 +37,4 @@ export type FinalOptionsOfComponent = {
|
|
|
37
37
|
watch: Record<string, Func>;
|
|
38
38
|
lifetimes: LifetimesConstraint;
|
|
39
39
|
};
|
|
40
|
-
export declare function normalizeOptions(defineComponentOption:
|
|
40
|
+
export declare function normalizeOptions(defineComponentOption: DefineComponentOptionRuntime): FinalOptionsOfComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgD9C,MAAM,UAAU,gBAAgB,CAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgD9C,MAAM,UAAU,gBAAgB,CAC9B,qBAAmD;;IAEnD,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,qBAAqB,CAAC;IACrE,MAAM,MAAM,GAAG,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,mCAAI,KAAK,CAAC;IAC9C,MAAM,wBAAwB,GAA4B;QACxD,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;QACR,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,CAAC,iBAAiB,CAAC;QAC9B,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,EAAE;QACjB,MAAM;QACN,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,iBAAiB,CAAC,wBAAwB,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAKvE,MAAM,eAAe,GAAoB;QACvC,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;KACd,CAAC;IAEF,mBAAmB,CAAC,wBAAwB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;IAE9E,mBAAmB,CAAC,wBAAwB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;IAE9E,qBAAqB,CAAC,wBAAwB,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;IAGzE,uBAAuB,CAAC,wBAAwB,CAAC,CAAC;IAGlD,IAAI,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,CAAC;QAC/C,OAAO,CAAC,cAAc,CAAC,wBAAwB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC1E,CAAC;IAGD,wBAAwB,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAG3D,YAAY,CAAC,wBAAwB,CAAC,CAAC;IAGvC,wBAAwB,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAGvD,YAAY,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAErD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RootComponentDefinitionRuntime } from "../../RootComponent/returnType";
|
|
2
2
|
import type { FinalOptionsOfComponent } from ".";
|
|
3
|
-
export declare function otherFieldsHandle(finalOptions: FinalOptionsOfComponent, rootComponentOptions: Omit<
|
|
3
|
+
export declare function otherFieldsHandle(finalOptions: FinalOptionsOfComponent, rootComponentOptions: Omit<RootComponentDefinitionRuntime, "customEvents" | "events">): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otherFieldsHandle.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/otherFieldsHandle.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,iBAAiB,CAC/B,YAAqC,EACrC,
|
|
1
|
+
{"version":3,"file":"otherFieldsHandle.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/otherFieldsHandle.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,iBAAiB,CAC/B,YAAqC,EACrC,oBAAqF;IAErF,IAAI,GAA0E,CAAC;IAC/E,KAAK,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,MAAM,KAAK,SAAS;YAAE,SAAS;QACnC,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,MAAkB,CAAC,CAAC;QAChD,CAAC;aAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAEtC,YAAY,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAE5C,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,OAAO,MAAM,KAAK,SAAS,EAAE,CAAC;YACvC,YAAY,CAAC,GAAe,CAAC,GAAG,MAAM,CAAC;QACzC,CAAC;aAAM,CAAC;YAEN,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QAC7B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CustomComponentDefinitionRuntime } from "../../CustomComponent/returnType";
|
|
2
|
+
import type { RootComponentDefinitionRuntime } from "../../RootComponent/returnType";
|
|
3
3
|
import type { SameFuncOptions } from ".";
|
|
4
|
-
export declare function sameFuncFieldsCollect(options:
|
|
4
|
+
export declare function sameFuncFieldsCollect(options: CustomComponentDefinitionRuntime | RootComponentDefinitionRuntime, funcOptions: SameFuncOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sameFuncFieldsCollect.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sameFuncFieldsCollect.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,qBAAqB,CACnC,OAA0E,EAC1E,WAA4B;;IAE5B,IAAI,GAA0B,CAAC;IAC/B,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;QACxB,MAAM,gBAAgB,GAAqC,OAAO,CAAC,GAAG,CAAC,CAAC;QACxE,IAAI,gBAAgB,EAAE,CAAC;YACrB,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;gBACpC,OAAC,WAAW,CAAC,GAAG,CAAC,EAAC,IAAI,SAAJ,IAAI,IAAM,EAAE,EAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type PrefixKey = `${string}_${string}`;
|
|
2
|
+
type _ComponentDoc = {
|
|
3
|
+
properties?: Record<PrefixKey, unknown>;
|
|
4
|
+
events?: Record<PrefixKey, unknown>;
|
|
5
|
+
};
|
|
6
|
+
type Error = "{ properties?: Record<PrefixKey, any>; events?: Record<PrefixKey, any>;}";
|
|
7
|
+
type _Validator<O> = keyof O extends keyof _ComponentDoc ? keyof (O["properties"] & O["events"]) extends PrefixKey ? _ComponentDoc : Error : Error;
|
|
8
|
+
export type ComponentDoc<O extends _Validator<O> = _ComponentDoc> = O;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentDoc.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/returnType/ComponentDoc.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
+
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
3
|
+
import type { CustomComponentDefinition } from "../../CustomComponent/returnType";
|
|
4
|
+
import type { RootComponentDefinition } from "../../RootComponent/returnType";
|
|
5
|
+
import type { GetCustomEventDocOfSubDoc } from "./GetCustomEventDocOfSubDoc";
|
|
6
|
+
type GetStopKeys<O> = {
|
|
7
|
+
[k in keyof O]: k extends `${string}_${infer Key}_${string}_catch` ? Key : never;
|
|
8
|
+
}[keyof O];
|
|
9
|
+
export type GenerateComponentDoc<TRootDoc extends RootComponentDefinition, TName extends string, TSubComponentTuple extends CustomComponentDefinition[], AllPropertiesDoc extends unknown | object = TRootDoc["properties"], AllEventsDoc extends unknown | object = TRootDoc["customEvents"] & GetCustomEventDocOfSubDoc<TSubComponentTuple[number]>, StopKeys extends string = GetStopKeys<TRootDoc["events"]>, FinalEventsDoc extends object = Omit<AllEventsDoc, StopKeys>> = ComputeIntersection<IfExtends<unknown, AllPropertiesDoc, {}, {
|
|
10
|
+
properties: {
|
|
11
|
+
[k in keyof AllPropertiesDoc as `${TName}_${k & string}`]: AllPropertiesDoc[k];
|
|
12
|
+
};
|
|
13
|
+
}> & IfExtends<{}, FinalEventsDoc, {}, {
|
|
14
|
+
events: {
|
|
15
|
+
[k in keyof FinalEventsDoc as `${TName}_${k & string}`]: FinalEventsDoc[k];
|
|
16
|
+
};
|
|
17
|
+
}>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateComponentDoc.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/returnType/GenerateComponentDoc.ts"],"names":[],"mappings":""}
|
package/dist/api/DefineComponent/{ReturnType/CreatePageDoc.d.ts → returnType/GeneratePageDoc.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
2
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
3
|
-
import type {
|
|
4
|
-
export type
|
|
3
|
+
import type { RootComponentDefinition } from "../../RootComponent/returnType";
|
|
4
|
+
export type GeneratePageDoc<TRootDoc extends RootComponentDefinition, TPath extends string> = ComputeIntersection<{
|
|
5
5
|
path: TPath;
|
|
6
6
|
} & IfExtends<unknown, TRootDoc["properties"], unknown, {
|
|
7
7
|
properties: TRootDoc["properties"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratePageDoc.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/returnType/GeneratePageDoc.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IsNever, IsUnion } from "hry-types/src/Any/_api";
|
|
2
|
+
import type { UnionTwoObject } from "hry-types/src/Object/UnionTwoObject";
|
|
3
|
+
import type { Last } from "hry-types/src/Union/Last";
|
|
4
|
+
import type { Assert } from "../../../types/Assert";
|
|
5
|
+
import type { CustomComponentDefinition } from "../../CustomComponent/returnType";
|
|
6
|
+
type _GetCustomEventDocOfSubDoc<U extends CustomComponentDefinition, Result = {}, TLast extends CustomComponentDefinition = Assert<Last<U>, CustomComponentDefinition>> = IsNever<U> extends true ? Result : _GetCustomEventDocOfSubDoc<Exclude<U, TLast>, UnionTwoObject<Result, TLast["composedEvents"]>>;
|
|
7
|
+
export type GetCustomEventDocOfSubDoc<UnionSubDoc extends CustomComponentDefinition> = IsUnion<UnionSubDoc> extends true ? _GetCustomEventDocOfSubDoc<UnionSubDoc> : UnionSubDoc["composedEvents"];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetCustomEventDocOfSubDoc.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageDoc.js","sourceRoot":"","sources":["../../../../src/api/DefineComponent/returnType/PageDoc.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/_api";
|
|
2
2
|
import type { Select } from "hry-types/src/Object/_api";
|
|
3
3
|
import type { Detail, WMBaseEvent } from "../../../types/OfficialTypeAlias";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ComponentDoc } from "../../DefineComponent/returnType/ComponentDoc";
|
|
5
5
|
import type { CustomEventsDoc } from "../CustomEvents/CustomEventsDoc";
|
|
6
6
|
import type { Bubbles, BubblesCaptureComposed, BubblesComposed, Capture, CaptureComposed, CustomEventsTags } from "../CustomEvents/CustomEventsTag";
|
|
7
7
|
type FilterNormalFields<O extends object> = Select<O, Bubbles | Capture, "contains->">;
|
|
8
|
-
type GetBubblesOrCaptureEventsFromCompDoc<ComponentDocList extends
|
|
8
|
+
type GetBubblesOrCaptureEventsFromCompDoc<ComponentDocList extends ComponentDoc[], Result extends CustomEventsDoc = {}> = ComponentDocList extends [infer Head extends ComponentDoc, ...infer Rest extends ComponentDoc[]] ? GetBubblesOrCaptureEventsFromCompDoc<Rest, Result & (FilterNormalFields<Head["events"] & {}>)> : Result;
|
|
9
9
|
type _AddSuffixForKey<key extends string, Value extends CustomEventsTags> = Value extends BubblesComposed ? `${key}_bubbles` | `${key}_bubbles_catch` : Value extends CaptureComposed ? `${key}_capture` | `${key}_capture_catch` : Value extends BubblesCaptureComposed ? `${key}_bubbles&capture` | `${key}_bubbles&capture_catch` : never;
|
|
10
10
|
type TransformCustomEventsDocTypeToFunctionTypeAndAddSuffix<T extends CustomEventsDoc> = {
|
|
11
11
|
[k in keyof T as _AddSuffixForKey<k & string, Extract<T[k], CustomEventsTags>>]?: (detail: Detail<Exclude<T[k], CustomEventsTags>>) => void;
|
|
12
12
|
};
|
|
13
|
-
type GetAllSubCustomEventsConstraint<ComponentDocList extends
|
|
13
|
+
type GetAllSubCustomEventsConstraint<ComponentDocList extends ComponentDoc[], AllCustomEvents extends CustomEventsDoc = GetBubblesOrCaptureEventsFromCompDoc<ComponentDocList>> = IfExtends<{}, AllCustomEvents, BaseEvent, TransformCustomEventsDocTypeToFunctionTypeAndAddSuffix<AllCustomEvents>>;
|
|
14
14
|
type BaseEvent = Record<string, (e: WMBaseEvent) => unknown>;
|
|
15
|
-
export type EventsConstraint<ComponentDocList extends
|
|
15
|
+
export type EventsConstraint<ComponentDocList extends ComponentDoc[] = []> = IfExtends<[
|
|
16
16
|
], ComponentDocList, BaseEvent, GetAllSubCustomEventsConstraint<ComponentDocList>>;
|
|
17
17
|
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Getter } from "./StoreConstraint";
|
|
2
|
-
type UndefinedToNull<T> = T extends undefined ? null : T;
|
|
3
2
|
export type GetStoreDoc<TStore extends object> = {
|
|
4
|
-
[k in keyof TStore]: TStore[k] extends Getter ?
|
|
5
|
-
getter: () => infer R;
|
|
3
|
+
[k in keyof TStore]: TStore[k] extends Getter ? ReturnType<TStore[k]> : TStore[k] extends {
|
|
4
|
+
getter: (...args: unknown[]) => infer R;
|
|
6
5
|
default: infer D;
|
|
7
|
-
} ? Exclude<R, undefined> | D : never;
|
|
6
|
+
} ? Exclude<R, undefined> | (D extends null ? null : never) : never;
|
|
8
7
|
};
|
|
9
|
-
export {};
|
|
@@ -5,7 +5,7 @@ import type { ComputeIntersection } from "hry-types/src/Object/_api";
|
|
|
5
5
|
import type { ComputeObject } from "../../types/ComputeObj";
|
|
6
6
|
import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
|
|
7
7
|
import type { RemoveNullOfRequired } from "../../types/RemoveNullOfRequired";
|
|
8
|
-
import type {
|
|
8
|
+
import type { ComponentDoc } from "../DefineComponent/returnType/ComponentDoc";
|
|
9
9
|
import type { IInjectStore } from "../InstanceInject/instanceConfig";
|
|
10
10
|
import type { ComputedConstraint } from "./Computed/ComputedConstraint";
|
|
11
11
|
import type { ComputedOption } from "./Computed/ComputedOption";
|
|
@@ -13,13 +13,11 @@ import type { GetComputedDoc } from "./Computed/GetComputedDoc";
|
|
|
13
13
|
import type { CustomEventConstraint } from "./CustomEvents/CustomEventConstraint";
|
|
14
14
|
import type { CustomEventsOption } from "./CustomEvents/CustomEventsOption";
|
|
15
15
|
import type { GetCustomEventDoc } from "./CustomEvents/GetCustomEventDoc";
|
|
16
|
-
import type { DataConstraint } from "./Data/DataConstraint";
|
|
17
16
|
import type { DataOption } from "./Data/DataOption";
|
|
18
17
|
import type { EventsConstraint } from "./Events/EventsConstraint";
|
|
19
18
|
import type { EventsOption } from "./Events/EventsOption";
|
|
20
19
|
import type { RootComponentInstance } from "./Instance/RootComponentInstance";
|
|
21
20
|
import type { IsPageOption } from "./IsPage/IsPageOption";
|
|
22
|
-
import type { LifetimesConstraint } from "./Lifetimes/LifetimesConstraint";
|
|
23
21
|
import type { LifetimesOption } from "./Lifetimes/LifetimesOption";
|
|
24
22
|
import type { MethodsConstraint } from "./Methods/MethodsConstraint";
|
|
25
23
|
import type { MethodsOption } from "./Methods/MethodsOption";
|
|
@@ -33,7 +31,7 @@ import type { StoreConstraint } from "./Store/StoreConstraint";
|
|
|
33
31
|
import type { StoreOption } from "./Store/StoreOption";
|
|
34
32
|
import type { WatchOption } from "./Watch/WatchOption";
|
|
35
33
|
type RootComponentOptions<TEvents extends object, TIsPage extends boolean, TCustomEvents extends CustomEventConstraint, TMethods extends MethodsConstraint, TProperties extends PropertiesConstraint, TData extends object, TStore extends StoreConstraint, TComputed extends Record<string, Func>, EventsDoc extends object, CustomEventsDoc extends object, PropertiesDoc extends object, DataDoc extends object, StoreDoc extends object, ComputedDoc extends object> = MethodsOption<TMethods, keyof (EventsDoc & CustomEventsDoc)> & PropertiesOption<TProperties> & IsPageOption<TIsPage> & EventsOption<TEvents> & CustomEventsOption<TCustomEvents, keyof EventsDoc> & DataOption<TData, keyof PropertiesDoc> & StoreOption<TStore, keyof (PropertiesDoc & DataDoc)> & ComputedOption<TComputed, keyof (PropertiesDoc & DataDoc & StoreDoc)> & PageLifetimesOption<TIsPage, PropertiesDoc> & LifetimesOption & WatchOption<ComputedDoc & Required<PropertiesDoc> & DataDoc & StoreDoc & IInjectStore> & Partial<Omit<WMCompOtherOption, "pageLifetimes" | "definitionFilter" | "observers">> & ObserversOption<ComputedDoc & Required<PropertiesDoc> & DataDoc & StoreDoc & IInjectStore> & ThisType<RootComponentInstance<TIsPage, TMethods, DataDoc, DataDoc & Required<PropertiesDoc> & StoreDoc & ComputedDoc, CustomEventsDoc, StoreDoc>>;
|
|
36
|
-
type RootComponentConstructor<TComponentDocList extends
|
|
34
|
+
type RootComponentConstructor<TComponentDocList extends ComponentDoc[]> = <TEvents extends EventsConstraint<TComponentDocList>, TStore extends StoreConstraint<PropertiesDoc>, TIsPage extends boolean = false, const TProperties extends PropertiesConstraint = {}, TData extends object = {}, TComputed extends ComputedConstraint = {}, TCustomEvents extends IfExtends<TIsPage, false, CustomEventConstraint, EmptyObject> = {}, TMethods extends MethodsConstraint = {}, EventsDoc extends object = IfExtends<EventsConstraint<TComponentDocList>, TEvents, {}, TEvents>, CustomEventsDoc extends object = GetCustomEventDoc<TCustomEvents>, PropertiesDoc extends object = GetPropertiesDoc<TProperties>, DataDoc extends object = TData, StoreDoc extends object = StoreConstraint<PropertiesDoc> extends TStore ? {} : GetStoreDoc<TStore>, ComputedDoc extends object = GetComputedDoc<TComputed>>(options: RootComponentOptions<TEvents, TIsPage, TCustomEvents, TMethods, TProperties, TData, TStore, TComputed, EventsDoc, CustomEventsDoc, PropertiesDoc, DataDoc, StoreDoc, ComputedDoc>) => ComputeIntersection<IfExtends<TIsPage, false, {}, {
|
|
37
35
|
isPage: true;
|
|
38
36
|
}> & IfExtends<EmptyObject, PropertiesDoc, {}, {
|
|
39
37
|
properties: IfExtends<false, TIsPage, PropertiesDoc, RemoveNullOfRequired<PropertiesDoc>>;
|
|
@@ -50,20 +48,5 @@ type RootComponentConstructor<TComponentDocList extends ComponentType[]> = <TEve
|
|
|
50
48
|
}> & IfExtends<EmptyObject, CustomEventsDoc, {}, {
|
|
51
49
|
customEvents: ComputeObject<CustomEventsDoc>;
|
|
52
50
|
}>>;
|
|
53
|
-
export declare function RootComponent<TComponentDocList extends
|
|
54
|
-
export type RootComponentTrueOptions = {
|
|
55
|
-
isPage?: boolean;
|
|
56
|
-
properties?: PropertiesConstraint;
|
|
57
|
-
data?: DataConstraint;
|
|
58
|
-
computed?: ComputedConstraint;
|
|
59
|
-
customEvents?: CustomEventConstraint;
|
|
60
|
-
observers?: Record<string, Func>;
|
|
61
|
-
methods?: MethodsConstraint;
|
|
62
|
-
behaviors?: string[];
|
|
63
|
-
events?: EventsConstraint;
|
|
64
|
-
store?: StoreConstraint;
|
|
65
|
-
watch?: Record<string, Func>;
|
|
66
|
-
lifetimes?: LifetimesConstraint;
|
|
67
|
-
pageLifetimes?: PageLifetimesOption<false, object>["pageLifetimes"] | PageLifetimesOption<true, object>["pageLifetimes"];
|
|
68
|
-
};
|
|
51
|
+
export declare function RootComponent<TComponentDocList extends ComponentDoc[] = []>(): RootComponentConstructor<TComponentDocList>;
|
|
69
52
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/RootComponent/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/RootComponent/index.ts"],"names":[],"mappings":"AA8IA,MAAM,UAAU,aAAa;IAO3B,OAAO,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Func } from "hry-types/src/Misc/Func";
|
|
2
|
+
import type { WMCompPageLifetimes, WMPageLifetimes } from "../../types/OfficialTypeAlias";
|
|
3
|
+
import type { ComputedConstraint } from "./Computed/ComputedConstraint";
|
|
4
|
+
import type { CustomEventConstraint } from "./CustomEvents/CustomEventConstraint";
|
|
5
|
+
import type { DataConstraint } from "./Data/DataConstraint";
|
|
6
|
+
import type { EventsConstraint } from "./Events/EventsConstraint";
|
|
7
|
+
import type { LifetimesConstraint } from "./Lifetimes/LifetimesConstraint";
|
|
8
|
+
import type { MethodsConstraint } from "./Methods/MethodsConstraint";
|
|
9
|
+
import type { PageLifetimesOption } from "./PageLifetimes/PageLifetimesOption";
|
|
10
|
+
import type { PropertiesConstraint } from "./Properties/PropertiesConstraint";
|
|
11
|
+
import type { StoreConstraint } from "./Store/StoreConstraint";
|
|
12
|
+
type _RootComponentDefinition = {
|
|
13
|
+
isPage?: boolean;
|
|
14
|
+
properties?: object;
|
|
15
|
+
data?: object;
|
|
16
|
+
computed?: object;
|
|
17
|
+
customEvents?: object;
|
|
18
|
+
methods?: object;
|
|
19
|
+
events?: object;
|
|
20
|
+
store?: object;
|
|
21
|
+
watch?: Record<string, AnyFunction>;
|
|
22
|
+
lifetimes?: LifetimesConstraint;
|
|
23
|
+
pageLifetimes?: Partial<WMCompPageLifetimes & {
|
|
24
|
+
load: AnyFunction;
|
|
25
|
+
}> | Partial<WMPageLifetimes>;
|
|
26
|
+
externalClasses?: string[];
|
|
27
|
+
export?: () => void;
|
|
28
|
+
};
|
|
29
|
+
type _Validator<O, Doc, ErrKeys = Exclude<keyof O, keyof Doc>> = [ErrKeys] extends [never] ? Doc : `错误的字段${ErrKeys & string}`;
|
|
30
|
+
export type RootComponentDefinition<O extends _Validator<O, _RootComponentDefinition> = _RootComponentDefinition> = O;
|
|
31
|
+
export type RootComponentDefinitionRuntime = {
|
|
32
|
+
isPage?: boolean;
|
|
33
|
+
properties?: PropertiesConstraint;
|
|
34
|
+
data?: DataConstraint;
|
|
35
|
+
computed?: ComputedConstraint;
|
|
36
|
+
customEvents?: CustomEventConstraint;
|
|
37
|
+
observers?: Record<string, Func>;
|
|
38
|
+
methods?: MethodsConstraint;
|
|
39
|
+
behaviors?: string[];
|
|
40
|
+
events?: EventsConstraint;
|
|
41
|
+
store?: StoreConstraint;
|
|
42
|
+
watch?: Record<string, Func>;
|
|
43
|
+
lifetimes?: LifetimesConstraint;
|
|
44
|
+
pageLifetimes?: PageLifetimesOption<false, object>["pageLifetimes"] | PageLifetimesOption<true, object>["pageLifetimes"];
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"returnType.js","sourceRoot":"","sources":["../../../src/api/RootComponent/returnType.ts"],"names":[],"mappings":""}
|
package/dist/api/wxSugar.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { NoInfer } from "hry-types/src/Generic/NoInfer";
|
|
|
4
4
|
import type { ComputeObject } from "../types/ComputeObj";
|
|
5
5
|
import type { WMNavigateToOption } from "../types/OfficialTypeAlias";
|
|
6
6
|
import type { RequiredKeys } from "../types/RequiredKeys";
|
|
7
|
-
import type { PageDoc } from "./DefineComponent/
|
|
7
|
+
import type { PageDoc } from "./DefineComponent/returnType/PageDoc";
|
|
8
8
|
type NavigateToOption<T extends PageDoc> = ComputeObject<{
|
|
9
9
|
url: T["path"];
|
|
10
10
|
} & IfExtends<unknown, T["properties"], unknown, IfEquals<RequiredKeys<NonNullable<T["properties"]>>, never, {
|
|
@@ -26,7 +26,7 @@ export type ScrollView = CreateComponentType<"scrollView", {
|
|
|
26
26
|
paging_enabled?: boolean;
|
|
27
27
|
fast_deceleration?: boolean;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
events: {
|
|
30
30
|
binddragstart: {
|
|
31
31
|
scrollTop: number;
|
|
32
32
|
scrollLeft: number;
|
|
@@ -52,7 +52,7 @@ export type ScrollView = CreateComponentType<"scrollView", {
|
|
|
52
52
|
};
|
|
53
53
|
bindrefresherpulling: EmptyObject;
|
|
54
54
|
bindrefresherrefresh: EmptyObject;
|
|
55
|
-
|
|
55
|
+
bindrefresherrestore: EmptyObject;
|
|
56
56
|
bindrefresherabort: EmptyObject;
|
|
57
57
|
};
|
|
58
58
|
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/_api";
|
|
2
2
|
import type { ComputeIntersection } from "hry-types/src/Object/_api";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
4
4
|
import type { AddPrefix } from "./AddPrefix";
|
|
5
|
-
export type CreateComponentType<TName extends string, T extends
|
|
5
|
+
export type CreateComponentType<TName extends string, T extends ComponentDoc> = ComputeIntersection<IfExtends<unknown, T["properties"], {}, {
|
|
6
6
|
properties: AddPrefix<T["properties"] & {}, TName>;
|
|
7
|
-
}> & IfExtends<unknown, T["
|
|
8
|
-
|
|
7
|
+
}> & IfExtends<unknown, T["events"], {}, {
|
|
8
|
+
events: AddPrefix<T["events"] & {}, TName>;
|
|
9
9
|
}>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
2
|
import type { ComputeIntersectionDeep } from "hry-types/src/Object/ComputeIntersectionDeep";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
4
4
|
import type { GetComponentPrefix } from "./GetComponentPrefix";
|
|
5
|
-
type Validator<TOriginalComponentType extends
|
|
6
|
-
export type ExtendComponentType<TOriginalComponentType extends
|
|
5
|
+
type Validator<TOriginalComponentType extends ComponentDoc, TExtensionType extends ComponentDoc, TOriginalPrefix extends PropertyKey = GetComponentPrefix<TOriginalComponentType>, TExtenstionPrefix extends PropertyKey = GetComponentPrefix<TExtensionType>, DuplicateKeys extends PropertyKey = Extract<keyof TExtensionType["properties"], keyof TOriginalComponentType["properties"]> | Extract<keyof TExtensionType["events"], keyof TOriginalComponentType["events"]>> = IfExtends<TOriginalPrefix, TExtenstionPrefix, IfExtends<DuplicateKeys, never, ComponentDoc, `${DuplicateKeys & string}字段重复`>, `前缀错误,应为${TOriginalPrefix & string}`>;
|
|
6
|
+
export type ExtendComponentType<TOriginalComponentType extends ComponentDoc, TExtensionType extends Validator<TOriginalComponentType, TExtensionType>> = ComputeIntersectionDeep<TOriginalComponentType & TExtensionType>;
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
2
|
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
3
|
-
import type {
|
|
4
|
-
export type GetComponentPrefix<TComponentDoc extends
|
|
3
|
+
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
4
|
+
export type GetComponentPrefix<TComponentDoc extends ComponentDoc> = EmptyObject extends TComponentDoc ? never : keyof IfExtends<unknown, TComponentDoc["properties"], TComponentDoc["events"], TComponentDoc["properties"]> extends `${infer P}_${string}` ? P : never;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
3
3
|
type _ReplacePrefix<O, TPrefix extends string> = {
|
|
4
4
|
[k in keyof O as k extends `${string}_${infer L}` ? `${TPrefix}_${L}` : k]: O[k];
|
|
5
5
|
};
|
|
6
|
-
export type ReplacePrefix<TComponentDoc extends
|
|
6
|
+
export type ReplacePrefix<TComponentDoc extends ComponentDoc, TPrefix extends string = ""> = IfExtends<unknown, TComponentDoc["properties"], {}, {
|
|
7
7
|
properties: _ReplacePrefix<TComponentDoc["properties"], TPrefix>;
|
|
8
|
-
}> & IfExtends<unknown, TComponentDoc["
|
|
9
|
-
|
|
8
|
+
}> & IfExtends<unknown, TComponentDoc["events"], {}, {
|
|
9
|
+
events: _ReplacePrefix<TComponentDoc["events"], TPrefix>;
|
|
10
10
|
}>;
|
|
11
11
|
export {};
|
package/dist/utils/debounce.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function debounce<F extends Callback>(func: F, wait?: number): (...args: Parameters<F>) => void;
|
|
3
|
-
export {};
|
|
1
|
+
export declare function debounce<TArgs extends unknown[]>(func: (...args: TArgs) => unknown, wait?: number): (...args: TArgs) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,QAAQ,CACtB,IAAiC,EACjC,IAAI,GAAG,GAAG;IAEV,IAAI,SAAS,GAAyC,IAAI,CAAC;IAE3D,OAAO,UAAwB,GAAG,IAAW;QAC3C,IAAI,SAAS,EAAE,CAAC;YACd,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;QAED,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/utils/throttle.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function throttle<F extends Callback>(callback: F, interval?: number): (...args: Parameters<F>) => void;
|
|
3
|
-
export {};
|
|
1
|
+
export declare function throttle<TArgs extends unknown[]>(callback: (...args: TArgs) => unknown, interval?: number): (...args: TArgs) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/utils/throttle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/utils/throttle.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,QAAQ,CACtB,QAAqC,EACrC,QAAQ,GAAG,GAAG;IAEd,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,OAAO,UAAwB,GAAG,IAAW;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEvB,IAAI,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC/B,QAAQ,GAAG,GAAG,CAAC;YAEf,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "annil",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.7",
|
|
4
4
|
"description": "微信小程序(原生开发)插件",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -17,11 +17,16 @@
|
|
|
17
17
|
"tsc": "tsc --watch",
|
|
18
18
|
"test": "jest --watch",
|
|
19
19
|
"build": "tsc -p tsconfig.build.json",
|
|
20
|
-
"check": "tsc --noEmit && eslint . --max-warnings 0 && (dprint check || (dprint fmt && exit 1))"
|
|
20
|
+
"check": "tsc --noEmit && eslint . --max-warnings 0 && (dprint check || (dprint fmt && exit 1))",
|
|
21
|
+
"docs:dev": "vitepress dev docs",
|
|
22
|
+
"docs:build": "vitepress build docs",
|
|
23
|
+
"docs:preview": "vitepress preview docs"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@commitlint/config-conventional": "^17.6.5",
|
|
27
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
24
28
|
"@types/jest": "^29.5.5",
|
|
29
|
+
"@types/node": "^20.19.37",
|
|
25
30
|
"commitlint": "^17.6.5",
|
|
26
31
|
"eslint": "^9.10.0",
|
|
27
32
|
"hry-types": "^0.19.3",
|
|
@@ -31,8 +36,9 @@
|
|
|
31
36
|
"miniprogram-simulate": "^1.6.1",
|
|
32
37
|
"mobx": "^6.9.0",
|
|
33
38
|
"ts-jest": "^29.1.1",
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"typescript-eslint": "^8.
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"typescript-eslint": "^8.57.0",
|
|
41
|
+
"vitepress": "^1.6.4"
|
|
36
42
|
},
|
|
37
43
|
"files": [
|
|
38
44
|
"LICENSE",
|