phecda-core 3.0.0-alpha.7 → 3.0.0-alpha.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +5 -4
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ interface InjectData {
5
5
  [key: string]: any;
6
6
  }
7
7
  type Construct<T = any> = new (...args: any[]) => T;
8
+ type AbConstruct<T = any> = abstract new (...args: any[]) => T;
8
9
  interface Handler {
9
10
  [key: string]: any;
10
11
  }
@@ -43,8 +44,8 @@ declare function Inject<K extends keyof InjectData>(key: K): InjectData[K];
43
44
  declare function Nested<M extends new (...args: any) => any>(module: M): (proto: any, key: PropertyKey) => void;
44
45
  declare function Isolate(): (target: any) => void;
45
46
 
46
- declare function getTag<M extends Construct>(moduleOrInstance: M | InstanceType<M>): PropertyKey;
47
- declare function getBind<M extends Construct>(module: M): any;
47
+ declare function getTag<M extends Construct | AbConstruct>(moduleOrInstance: M | InstanceType<M>): PropertyKey;
48
+ declare function getBind<M extends Construct | AbConstruct>(module: M): any;
48
49
  declare function plainToClass<M extends Construct, Data extends Record<PropertyKey, any>>(module: M, input: Data): InstanceType<M>;
49
50
  declare function transformClass<M extends Construct>(instance: InstanceType<M>, force?: boolean): Promise<string[]>;
50
51
  declare function classToValue<M>(instance: M): ClassValue<M>;
@@ -53,7 +54,7 @@ declare function snapShot<T extends Construct>(data: InstanceType<T>): {
53
54
  clear(): void;
54
55
  apply(): void;
55
56
  };
56
- declare function addDecoToClass<M extends Construct>(c: M, key: keyof InstanceType<M> | string, handler: ((target: any, key: PropertyKey) => void), type?: 'property' | 'class'): void;
57
+ declare function addDecoToClass<M extends Construct | AbConstruct>(c: M, key: keyof InstanceType<M> | string, handler: ((target: any, key: PropertyKey) => void), type?: 'property' | 'class'): void;
57
58
  declare function Pipeline(...decos: ((...args: any) => void)[]): (...args: any) => void;
58
59
 
59
60
  declare function isPhecda(module: any): module is Construct;
@@ -86,4 +87,4 @@ declare function Watcher(eventName: keyof Events, options?: {
86
87
  declare function Effect(eventName: string, options?: any): (proto: any, key: string) => void;
87
88
  declare function Storage(storeKey?: string): (proto: any, key?: PropertyKey) => void;
88
89
 
89
- 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, Unique, Unmount, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getModuleState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnModuleState, getOwnState, getProperty, getState, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, registerParallel, registerSerial, setExposeKey, setIgnoreKey, setState, setVar, snapShot, transformClass, unmountParallel };
90
+ export { AbConstruct, 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, Unique, Unmount, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getModuleState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnModuleState, getOwnState, getProperty, getState, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, registerParallel, registerSerial, setExposeKey, setIgnoreKey, setState, setVar, snapShot, transformClass, unmountParallel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "3.0.0-alpha.7",
3
+ "version": "3.0.0-alpha.8",
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",