phecda-core 4.3.0 → 4.4.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/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +14 -7
- package/dist/index.mjs +13 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -76,9 +76,10 @@ declare function Storage({ key, json, stringify }?: {
|
|
|
76
76
|
key?: string;
|
|
77
77
|
}): (proto: any, property?: PropertyKey) => void;
|
|
78
78
|
|
|
79
|
-
declare function Rule(...rules: ((value: any) => void | string | Promise<void | string>)[]): (target: any, property: PropertyKey) => void;
|
|
80
|
-
declare function Required(target: any, property: PropertyKey): void;
|
|
81
|
-
declare function Optional(target: any, property: PropertyKey): void;
|
|
79
|
+
declare function Rule(...rules: ((value: any) => void | string | boolean | Promise<void | string | boolean>)[]): (target: any, property: PropertyKey, index?: any) => void;
|
|
80
|
+
declare function Required(target: any, property: PropertyKey, index?: any): void;
|
|
81
|
+
declare function Optional(target: any, property: PropertyKey, index?: any): void;
|
|
82
|
+
declare function Doc(doc: string): (target: any, property: PropertyKey, index?: any) => void;
|
|
82
83
|
|
|
83
84
|
declare function getTag<M extends Construct | AbConstruct>(moduleOrInstance: M | InstanceType<M>): PropertyKey;
|
|
84
85
|
/**
|
|
@@ -122,4 +123,4 @@ declare abstract class Base {
|
|
|
122
123
|
private _unmount;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
export { type AbConstruct, Assign, Base, CLEAR_KEY, type ClassValue, Clear, type Construct, DataMap, Effect, Empty, Err, type Events, Expose, Global, If, Init, Inject, type InjectData, Injectable, Isolate, type NameSpace, Optional, PHECDA_KEY, type Phecda, Pipeline, Provide, Required, Rule, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, functionToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, objectToClass, omit, override, partial, pick, set, setInject, setMeta, wait };
|
|
126
|
+
export { type AbConstruct, Assign, Base, CLEAR_KEY, type ClassValue, Clear, type Construct, DataMap, Doc, Effect, Empty, Err, type Events, Expose, Global, If, Init, Inject, type InjectData, Injectable, Isolate, type NameSpace, Optional, PHECDA_KEY, type Phecda, Pipeline, Provide, Required, Rule, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, functionToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, objectToClass, omit, override, partial, pick, set, setInject, setMeta, wait };
|
package/dist/index.d.ts
CHANGED
|
@@ -76,9 +76,10 @@ declare function Storage({ key, json, stringify }?: {
|
|
|
76
76
|
key?: string;
|
|
77
77
|
}): (proto: any, property?: PropertyKey) => void;
|
|
78
78
|
|
|
79
|
-
declare function Rule(...rules: ((value: any) => void | string | Promise<void | string>)[]): (target: any, property: PropertyKey) => void;
|
|
80
|
-
declare function Required(target: any, property: PropertyKey): void;
|
|
81
|
-
declare function Optional(target: any, property: PropertyKey): void;
|
|
79
|
+
declare function Rule(...rules: ((value: any) => void | string | boolean | Promise<void | string | boolean>)[]): (target: any, property: PropertyKey, index?: any) => void;
|
|
80
|
+
declare function Required(target: any, property: PropertyKey, index?: any): void;
|
|
81
|
+
declare function Optional(target: any, property: PropertyKey, index?: any): void;
|
|
82
|
+
declare function Doc(doc: string): (target: any, property: PropertyKey, index?: any) => void;
|
|
82
83
|
|
|
83
84
|
declare function getTag<M extends Construct | AbConstruct>(moduleOrInstance: M | InstanceType<M>): PropertyKey;
|
|
84
85
|
/**
|
|
@@ -122,4 +123,4 @@ declare abstract class Base {
|
|
|
122
123
|
private _unmount;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
export { type AbConstruct, Assign, Base, CLEAR_KEY, type ClassValue, Clear, type Construct, DataMap, Effect, Empty, Err, type Events, Expose, Global, If, Init, Inject, type InjectData, Injectable, Isolate, type NameSpace, Optional, PHECDA_KEY, type Phecda, Pipeline, Provide, Required, Rule, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, functionToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, objectToClass, omit, override, partial, pick, set, setInject, setMeta, wait };
|
|
126
|
+
export { type AbConstruct, Assign, Base, CLEAR_KEY, type ClassValue, Clear, type Construct, DataMap, Doc, Effect, Empty, Err, type Events, Expose, Global, If, Init, Inject, type InjectData, Injectable, Isolate, type NameSpace, Optional, PHECDA_KEY, type Phecda, Pipeline, Provide, Required, Rule, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, functionToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, objectToClass, omit, override, partial, pick, set, setInject, setMeta, wait };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
CLEAR_KEY: () => CLEAR_KEY,
|
|
34
34
|
Clear: () => Clear,
|
|
35
35
|
DataMap: () => DataMap,
|
|
36
|
+
Doc: () => Doc,
|
|
36
37
|
Effect: () => Effect,
|
|
37
38
|
Empty: () => Empty,
|
|
38
39
|
Err: () => Err,
|
|
@@ -530,17 +531,22 @@ function Storage({ key, json, stringify } = {}) {
|
|
|
530
531
|
};
|
|
531
532
|
}
|
|
532
533
|
|
|
533
|
-
// src/decorators/
|
|
534
|
+
// src/decorators/other.ts
|
|
534
535
|
function Rule(...rules) {
|
|
535
|
-
return (target, property) => {
|
|
536
|
-
setMeta(target, property,
|
|
536
|
+
return (target, property, index) => {
|
|
537
|
+
setMeta(target, property, index, { rules });
|
|
537
538
|
};
|
|
538
539
|
}
|
|
539
|
-
function Required(target, property) {
|
|
540
|
-
setMeta(target, property,
|
|
540
|
+
function Required(target, property, index) {
|
|
541
|
+
setMeta(target, property, index, { required: true });
|
|
541
542
|
}
|
|
542
|
-
function Optional(target, property) {
|
|
543
|
-
setMeta(target, property,
|
|
543
|
+
function Optional(target, property, index) {
|
|
544
|
+
setMeta(target, property, index, { required: false });
|
|
545
|
+
}
|
|
546
|
+
function Doc(doc) {
|
|
547
|
+
return (target, property, index) => {
|
|
548
|
+
setMeta(target, property, index, { doc });
|
|
549
|
+
};
|
|
544
550
|
}
|
|
545
551
|
|
|
546
552
|
// src/base.ts
|
|
@@ -590,6 +596,7 @@ Base = __decorateClass([
|
|
|
590
596
|
CLEAR_KEY,
|
|
591
597
|
Clear,
|
|
592
598
|
DataMap,
|
|
599
|
+
Doc,
|
|
593
600
|
Effect,
|
|
594
601
|
Empty,
|
|
595
602
|
Err,
|
package/dist/index.mjs
CHANGED
|
@@ -452,17 +452,22 @@ function Storage({ key, json, stringify } = {}) {
|
|
|
452
452
|
};
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
// src/decorators/
|
|
455
|
+
// src/decorators/other.ts
|
|
456
456
|
function Rule(...rules) {
|
|
457
|
-
return (target, property) => {
|
|
458
|
-
setMeta(target, property,
|
|
457
|
+
return (target, property, index) => {
|
|
458
|
+
setMeta(target, property, index, { rules });
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
function Required(target, property) {
|
|
462
|
-
setMeta(target, property,
|
|
461
|
+
function Required(target, property, index) {
|
|
462
|
+
setMeta(target, property, index, { required: true });
|
|
463
463
|
}
|
|
464
|
-
function Optional(target, property) {
|
|
465
|
-
setMeta(target, property,
|
|
464
|
+
function Optional(target, property, index) {
|
|
465
|
+
setMeta(target, property, index, { required: false });
|
|
466
|
+
}
|
|
467
|
+
function Doc(doc) {
|
|
468
|
+
return (target, property, index) => {
|
|
469
|
+
setMeta(target, property, index, { doc });
|
|
470
|
+
};
|
|
466
471
|
}
|
|
467
472
|
|
|
468
473
|
// src/base.ts
|
|
@@ -511,6 +516,7 @@ export {
|
|
|
511
516
|
CLEAR_KEY,
|
|
512
517
|
Clear,
|
|
513
518
|
DataMap,
|
|
519
|
+
Doc,
|
|
514
520
|
Effect,
|
|
515
521
|
Empty,
|
|
516
522
|
Err,
|