phecda-core 3.0.0-alpha.1 → 3.0.0-alpha.3

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 CHANGED
@@ -4,6 +4,7 @@ interface NameSpace {
4
4
  interface InjectData {
5
5
  [key: string]: any;
6
6
  }
7
+ type Construct<T = any> = new (...args: any[]) => T;
7
8
  interface Handler {
8
9
  [key: string]: any;
9
10
  }
@@ -38,6 +39,7 @@ declare const DataMap: InjectData;
38
39
  declare function Provide<K extends keyof InjectData>(key: K, value: InjectData[K]): void;
39
40
  declare function Inject<K extends keyof InjectData>(key: K): InjectData[K];
40
41
  declare function Nested<M extends new (...args: any) => any>(module: M): (proto: any, key: PropertyKey) => void;
42
+ declare function Isolate(): (target: any) => void;
41
43
 
42
44
  declare function getTag<M extends new (...args: any) => any>(module: M): any;
43
45
  declare function getSymbol<M extends new (...args: any) => any>(instance: InstanceType<M>): any;
@@ -53,7 +55,7 @@ declare function snapShot<T extends new (...args: any) => any>(data: InstanceTyp
53
55
  declare function addDecoToClass<M extends new (...args: any) => any>(c: M, key: keyof InstanceType<M> | string, handler: ((target: any, key: PropertyKey) => void), type?: 'property' | 'class'): void;
54
56
  declare function Pipeline(...decos: ((...args: any) => void)[]): (...args: any) => void;
55
57
 
56
- declare function isPhecda(module: any): boolean;
58
+ declare function isPhecda(module: any): module is Construct;
57
59
  declare const SHARE_KEY: unique symbol;
58
60
  declare function init(proto: Phecda): void;
59
61
  declare function setVar(proto: Phecda, key: PropertyKey): void;
@@ -82,4 +84,4 @@ declare function Watcher(eventName: keyof Events, options?: {
82
84
  declare function Effect(eventName: string, options?: any): (proto: any, key: string) => void;
83
85
  declare function Storage(storeKey?: string): (proto: any, key?: PropertyKey) => void;
84
86
 
85
- export { Assign, Bind, ClassValue, Clear, DataMap, Effect, Empty, Err, Events, Expose, Global, Handler, Ignore, Init, Inject, InjectData, NameSpace, Nested, Phecda, Pipeline, Provide, SHARE_KEY, Storage, Tag, To, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getModuleState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnModuleState, getOwnState, getProperty, getState, getSymbol, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, register, registerAsync, setExposeKey, setIgnoreKey, setState, setVar, snapShot, transformClass };
87
+ export { Assign, Bind, ClassValue, Clear, Construct, DataMap, Effect, Empty, Err, Events, Expose, Global, Handler, Ignore, Init, Inject, InjectData, Isolate, NameSpace, Nested, Phecda, Pipeline, Provide, SHARE_KEY, Storage, Tag, To, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getModuleState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnModuleState, getOwnState, getProperty, getState, getSymbol, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, register, registerAsync, setExposeKey, setIgnoreKey, setState, setVar, snapShot, transformClass };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
33
33
  Ignore: () => Ignore,
34
34
  Init: () => Init,
35
35
  Inject: () => Inject,
36
+ Isolate: () => Isolate,
36
37
  Nested: () => Nested,
37
38
  Pipeline: () => Pipeline,
38
39
  Provide: () => Provide,
@@ -442,6 +443,12 @@ function Nested(module2) {
442
443
  });
443
444
  }
444
445
  __name(Nested, "Nested");
446
+ function Isolate() {
447
+ return (target) => {
448
+ target.prototype.__ISOLATE__ = true;
449
+ };
450
+ }
451
+ __name(Isolate, "Isolate");
445
452
 
446
453
  // src/custom/decorator.ts
447
454
  var activeInstance = {};
@@ -545,6 +552,7 @@ __name(Storage, "Storage");
545
552
  Ignore,
546
553
  Init,
547
554
  Inject,
555
+ Isolate,
548
556
  Nested,
549
557
  Pipeline,
550
558
  Provide,
package/dist/index.mjs CHANGED
@@ -370,6 +370,12 @@ function Nested(module) {
370
370
  });
371
371
  }
372
372
  __name(Nested, "Nested");
373
+ function Isolate() {
374
+ return (target) => {
375
+ target.prototype.__ISOLATE__ = true;
376
+ };
377
+ }
378
+ __name(Isolate, "Isolate");
373
379
 
374
380
  // src/custom/decorator.ts
375
381
  var activeInstance = {};
@@ -472,6 +478,7 @@ export {
472
478
  Ignore,
473
479
  Init,
474
480
  Inject,
481
+ Isolate,
475
482
  Nested,
476
483
  Pipeline,
477
484
  Provide,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "provide base function and abstract limit to other phecda module ",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",