phecda-core 4.0.0 → 4.0.1

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 CHANGED
@@ -88,6 +88,7 @@ declare function invokeInit(instance: any): Promise<PromiseSettledResult<any>[]>
88
88
  declare function invokeUnmount(instance: any): Promise<PromiseSettledResult<any>[]>;
89
89
  declare function If(value: Boolean, ...decorators: (ClassDecorator[]) | (PropertyDecorator[]) | (ParameterDecorator[])): (...args: any[]) => void;
90
90
  declare function getMergedMeta(target: any, property?: PropertyKey, index?: number, merger?: (prev: any, cur: any) => any): any;
91
+ declare function wait(...instances: InstanceType<Construct>[]): Promise<any[]>;
91
92
 
92
93
  declare const DataMap: InjectData;
93
94
  declare function Provide<K extends keyof InjectData>(key: K, value: InjectData[K]): void;
@@ -110,4 +111,4 @@ declare abstract class Base {
110
111
  private _unmount;
111
112
  }
112
113
 
113
- 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, PHECDA_KEY, type Phecda, Pipeline, Provide, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, set, setInject, setMeta };
114
+ 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, PHECDA_KEY, type Phecda, Pipeline, Provide, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, set, setInject, setMeta, wait };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,7 @@ declare function invokeInit(instance: any): Promise<PromiseSettledResult<any>[]>
88
88
  declare function invokeUnmount(instance: any): Promise<PromiseSettledResult<any>[]>;
89
89
  declare function If(value: Boolean, ...decorators: (ClassDecorator[]) | (PropertyDecorator[]) | (ParameterDecorator[])): (...args: any[]) => void;
90
90
  declare function getMergedMeta(target: any, property?: PropertyKey, index?: number, merger?: (prev: any, cur: any) => any): any;
91
+ declare function wait(...instances: InstanceType<Construct>[]): Promise<any[]>;
91
92
 
92
93
  declare const DataMap: InjectData;
93
94
  declare function Provide<K extends keyof InjectData>(key: K, value: InjectData[K]): void;
@@ -110,4 +111,4 @@ declare abstract class Base {
110
111
  private _unmount;
111
112
  }
112
113
 
113
- 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, PHECDA_KEY, type Phecda, Pipeline, Provide, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, set, setInject, setMeta };
114
+ 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, PHECDA_KEY, type Phecda, Pipeline, Provide, SHARE_KEY, Storage, type StorageParam, Tag, Unique, Unmount, Watcher, type WatcherParam, activeInstance, addDecoToClass, get, getInject, getMergedMeta, getMeta, getMetaKey, getMetaParams, getOwnMeta, getOwnMetaKey, getOwnMetaParams, getPhecdaFromTarget, getTag, init, invoke, invokeInit, invokeUnmount, isAsyncFunc, isPhecda, set, setInject, setMeta, wait };
package/dist/index.js CHANGED
@@ -73,7 +73,8 @@ __export(src_exports, {
73
73
  isPhecda: () => isPhecda,
74
74
  set: () => set,
75
75
  setInject: () => setInject,
76
- setMeta: () => setMeta
76
+ setMeta: () => setMeta,
77
+ wait: () => wait
77
78
  });
78
79
  module.exports = __toCommonJS(src_exports);
79
80
 
@@ -304,6 +305,9 @@ function defaultMerger(prev, cur) {
304
305
  }
305
306
  return newMeta;
306
307
  }
308
+ function wait(...instances) {
309
+ return Promise.all(instances.map((i) => i.__PROMISE_SYMBOL__));
310
+ }
307
311
 
308
312
  // src/di.ts
309
313
  var DataMap = {};
@@ -521,5 +525,6 @@ Base = __decorateClass([
521
525
  isPhecda,
522
526
  set,
523
527
  setInject,
524
- setMeta
528
+ setMeta,
529
+ wait
525
530
  });
package/dist/index.mjs CHANGED
@@ -236,6 +236,9 @@ function defaultMerger(prev, cur) {
236
236
  }
237
237
  return newMeta;
238
238
  }
239
+ function wait(...instances) {
240
+ return Promise.all(instances.map((i) => i.__PROMISE_SYMBOL__));
241
+ }
239
242
 
240
243
  // src/di.ts
241
244
  var DataMap = {};
@@ -452,5 +455,6 @@ export {
452
455
  isPhecda,
453
456
  set,
454
457
  setInject,
455
- setMeta
458
+ setMeta,
459
+ wait
456
460
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "provide base function and abstract limit to other phecda module ",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",