phecda-core 2.1.0-alpha.1 → 2.1.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.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare function Ignore(target: any, key: PropertyKey): void;
|
|
|
30
30
|
declare function Clear(target: any, key: PropertyKey): void;
|
|
31
31
|
declare function Err<Fn extends (...args: any) => any>(cb: Fn): (target: any, key: PropertyKey) => void;
|
|
32
32
|
declare function Expose(target: any, key: PropertyKey): void;
|
|
33
|
-
declare function
|
|
33
|
+
declare function To(cb: (arg: any, instance: any, key: string) => any): (obj: any, key: PropertyKey) => void;
|
|
34
34
|
declare function Tag(tag: string): (target: any) => void;
|
|
35
35
|
declare function Assign(cb: (instance?: any) => any): (target: any) => void;
|
|
36
36
|
declare function Global(target: any): void;
|
|
@@ -85,4 +85,4 @@ declare function Watcher(eventName: keyof Events, options?: {
|
|
|
85
85
|
declare function Effect(eventName: string, options?: any): (obj: any, key: string) => void;
|
|
86
86
|
declare function Storage(storeKey?: string): (target: any, key?: PropertyKey) => void;
|
|
87
87
|
|
|
88
|
-
export { Assign, Bind, ClassValue, Clear, DataMap, Effect, Empty, Err, Events, Expose, Global, Handler, Ignore, Init, Inject, InjectData, NameSpace, Nested, Phecda,
|
|
88
|
+
export { Assign, Bind, ClassValue, Clear, DataMap, Effect, Empty, Err, Events, Expose, Global, Handler, Ignore, Init, Inject, InjectData, NameSpace, Nested, Phecda, Provide, Storage, Tag, To, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getInitEvent, getModelState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnInitEvent, getOwnModelState, getOwnState, getProperty, getState, getSymbol, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, regisInitEvent, register, registerAsync, setExposeKey, setIgnoreKey, setModelVar, setState, snapShot, transformClass };
|
package/dist/index.js
CHANGED
|
@@ -34,10 +34,10 @@ __export(src_exports, {
|
|
|
34
34
|
Init: () => Init,
|
|
35
35
|
Inject: () => Inject,
|
|
36
36
|
Nested: () => Nested,
|
|
37
|
-
Pipe: () => Pipe,
|
|
38
37
|
Provide: () => Provide,
|
|
39
38
|
Storage: () => Storage,
|
|
40
39
|
Tag: () => Tag,
|
|
40
|
+
To: () => To,
|
|
41
41
|
Watcher: () => Watcher,
|
|
42
42
|
activeInstance: () => activeInstance,
|
|
43
43
|
addDecoToClass: () => addDecoToClass,
|
|
@@ -383,7 +383,7 @@ function Expose(target, key) {
|
|
|
383
383
|
setExposeKey(target, key);
|
|
384
384
|
}
|
|
385
385
|
__name(Expose, "Expose");
|
|
386
|
-
function
|
|
386
|
+
function To(cb) {
|
|
387
387
|
return (obj, key) => {
|
|
388
388
|
setModelVar(obj, key);
|
|
389
389
|
regisHandler(obj, key, {
|
|
@@ -393,7 +393,7 @@ function Pipe(cb) {
|
|
|
393
393
|
});
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
__name(
|
|
396
|
+
__name(To, "To");
|
|
397
397
|
function Tag(tag) {
|
|
398
398
|
return (target) => {
|
|
399
399
|
init(target.prototype);
|
|
@@ -451,7 +451,7 @@ function Inject(key) {
|
|
|
451
451
|
}
|
|
452
452
|
__name(Inject, "Inject");
|
|
453
453
|
function Nested(Model) {
|
|
454
|
-
return
|
|
454
|
+
return To(async (property) => {
|
|
455
455
|
const instance = plainToClass(Model, property);
|
|
456
456
|
const err = await transformClass(instance);
|
|
457
457
|
if (err.length > 0)
|
|
@@ -566,10 +566,10 @@ __name(Storage, "Storage");
|
|
|
566
566
|
Init,
|
|
567
567
|
Inject,
|
|
568
568
|
Nested,
|
|
569
|
-
Pipe,
|
|
570
569
|
Provide,
|
|
571
570
|
Storage,
|
|
572
571
|
Tag,
|
|
572
|
+
To,
|
|
573
573
|
Watcher,
|
|
574
574
|
activeInstance,
|
|
575
575
|
addDecoToClass,
|
package/dist/index.mjs
CHANGED
|
@@ -310,7 +310,7 @@ function Expose(target, key) {
|
|
|
310
310
|
setExposeKey(target, key);
|
|
311
311
|
}
|
|
312
312
|
__name(Expose, "Expose");
|
|
313
|
-
function
|
|
313
|
+
function To(cb) {
|
|
314
314
|
return (obj, key) => {
|
|
315
315
|
setModelVar(obj, key);
|
|
316
316
|
regisHandler(obj, key, {
|
|
@@ -320,7 +320,7 @@ function Pipe(cb) {
|
|
|
320
320
|
});
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
__name(
|
|
323
|
+
__name(To, "To");
|
|
324
324
|
function Tag(tag) {
|
|
325
325
|
return (target) => {
|
|
326
326
|
init(target.prototype);
|
|
@@ -378,7 +378,7 @@ function Inject(key) {
|
|
|
378
378
|
}
|
|
379
379
|
__name(Inject, "Inject");
|
|
380
380
|
function Nested(Model) {
|
|
381
|
-
return
|
|
381
|
+
return To(async (property) => {
|
|
382
382
|
const instance = plainToClass(Model, property);
|
|
383
383
|
const err = await transformClass(instance);
|
|
384
384
|
if (err.length > 0)
|
|
@@ -492,10 +492,10 @@ export {
|
|
|
492
492
|
Init,
|
|
493
493
|
Inject,
|
|
494
494
|
Nested,
|
|
495
|
-
Pipe,
|
|
496
495
|
Provide,
|
|
497
496
|
Storage,
|
|
498
497
|
Tag,
|
|
498
|
+
To,
|
|
499
499
|
Watcher,
|
|
500
500
|
activeInstance,
|
|
501
501
|
addDecoToClass,
|