phecda-core 2.1.0 → 2.1.2-alpha.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 CHANGED
@@ -52,8 +52,9 @@ declare function snapShot<T extends new (...args: any) => any>(data: InstanceTyp
52
52
  apply(): void;
53
53
  };
54
54
  declare function addDecoToClass<M extends new (...args: any) => any>(c: M, key: keyof InstanceType<M> | string, handler: ((target: any, key: PropertyKey) => void), type?: 'static' | 'class' | 'normal'): void;
55
+ declare function Pipeline(...decos: ((...args: any) => void)[]): (...args: any) => void;
55
56
 
56
- declare function isPhecda(target: any): any;
57
+ declare function isPhecda(target: any): boolean;
57
58
  declare function init(target: Phecda): void;
58
59
  declare function regisInitEvent(target: Phecda, key: string): void;
59
60
  declare function getOwnInitEvent(target: Phecda): string[];
@@ -85,4 +86,4 @@ declare function Watcher(eventName: keyof Events, options?: {
85
86
  declare function Effect(eventName: string, options?: any): (obj: any, key: string) => void;
86
87
  declare function Storage(storeKey?: string): (target: any, key?: PropertyKey) => void;
87
88
 
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 };
89
+ export { Assign, Bind, ClassValue, Clear, DataMap, Effect, Empty, Err, Events, Expose, Global, Handler, Ignore, Init, Inject, InjectData, NameSpace, Nested, Phecda, Pipeline, 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,6 +34,7 @@ __export(src_exports, {
34
34
  Init: () => Init,
35
35
  Inject: () => Inject,
36
36
  Nested: () => Nested,
37
+ Pipeline: () => Pipeline,
37
38
  Provide: () => Provide,
38
39
  Storage: () => Storage,
39
40
  Tag: () => Tag,
@@ -76,7 +77,10 @@ module.exports = __toCommonJS(src_exports);
76
77
 
77
78
  // src/core.ts
78
79
  function isPhecda(target) {
79
- return target && !!target.prototype._namespace;
80
+ if (typeof target === "function") {
81
+ return !!target.prototype?._namespace;
82
+ }
83
+ return false;
80
84
  }
81
85
  __name(isPhecda, "isPhecda");
82
86
  function init(target) {
@@ -336,6 +340,13 @@ function addDecoToClass(c, key, handler, type = "normal") {
336
340
  handler(type === "normal" ? c.prototype : c, key);
337
341
  }
338
342
  __name(addDecoToClass, "addDecoToClass");
343
+ function Pipeline(...decos) {
344
+ return (...args) => {
345
+ for (const d of decos)
346
+ d(...args);
347
+ };
348
+ }
349
+ __name(Pipeline, "Pipeline");
339
350
 
340
351
  // src/decorators.ts
341
352
  function Init(target, key) {
@@ -566,6 +577,7 @@ __name(Storage, "Storage");
566
577
  Init,
567
578
  Inject,
568
579
  Nested,
580
+ Pipeline,
569
581
  Provide,
570
582
  Storage,
571
583
  Tag,
package/dist/index.mjs CHANGED
@@ -3,7 +3,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
 
4
4
  // src/core.ts
5
5
  function isPhecda(target) {
6
- return target && !!target.prototype._namespace;
6
+ if (typeof target === "function") {
7
+ return !!target.prototype?._namespace;
8
+ }
9
+ return false;
7
10
  }
8
11
  __name(isPhecda, "isPhecda");
9
12
  function init(target) {
@@ -263,6 +266,13 @@ function addDecoToClass(c, key, handler, type = "normal") {
263
266
  handler(type === "normal" ? c.prototype : c, key);
264
267
  }
265
268
  __name(addDecoToClass, "addDecoToClass");
269
+ function Pipeline(...decos) {
270
+ return (...args) => {
271
+ for (const d of decos)
272
+ d(...args);
273
+ };
274
+ }
275
+ __name(Pipeline, "Pipeline");
266
276
 
267
277
  // src/decorators.ts
268
278
  function Init(target, key) {
@@ -492,6 +502,7 @@ export {
492
502
  Init,
493
503
  Inject,
494
504
  Nested,
505
+ Pipeline,
495
506
  Provide,
496
507
  Storage,
497
508
  Tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "2.1.0",
3
+ "version": "2.1.2-alpha.0",
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",