phecda-core 1.1.0 → 1.1.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.ts CHANGED
@@ -22,6 +22,8 @@ interface Phecda {
22
22
  type ClassValue<I> = {
23
23
  [P in keyof I]: I[P] extends Function ? undefined : I[P];
24
24
  };
25
+ interface PhecdaEvents {
26
+ }
25
27
 
26
28
  declare function plainToClass<M extends new (...args: any) => any, Data extends Record<PropertyKey, any>>(Model: M, input: Data, options?: UsePipeOptions): Promise<{
27
29
  err: string[];
@@ -124,6 +126,8 @@ declare const activeInstance: Record<string, any>;
124
126
  declare function injectProperty(key: string, value: any): Record<string, any>;
125
127
  declare function getProperty(key: string): any;
126
128
 
127
- declare function Watcher(eventName: string): (obj: any, key: string) => void;
129
+ declare function Watcher(eventName: keyof PhecdaEvents, options?: {
130
+ once: boolean;
131
+ }): (obj: any, key: string) => void;
128
132
 
129
- export { ClassValue, Clear, Err, Global, Ignore, Init, P, Phecda, PhecdaHandler, PhecdaNameSpace, Pipe, Rule, Storage, Tag, UsePipeOptions, Watcher, activeInstance, addDecoToClass, classToValue, getExposeKey, getHandler, getIgnoreKey, getInitEvent, getModelState, getProperty, getState, getTag, init, injectProperty, isArray, isBoolean, isCnName, isDate, isEnName, isHexColor, isIdCard, isLandline, isMailBox, isMobile, isNumber, isObject, isPhecda, isPostalCode, isString, isWechat, mergeOptions, mergeState, plainToClass, regisHandler, regisInitEvent, register, registerAsync, setExposeKey, setIgnoreKey, setModalVar, snapShot, to, toNumber, toString, validate };
133
+ export { ClassValue, Clear, Err, Global, Ignore, Init, P, Phecda, PhecdaEvents, PhecdaHandler, PhecdaNameSpace, Pipe, Rule, Storage, Tag, UsePipeOptions, Watcher, activeInstance, addDecoToClass, classToValue, getExposeKey, getHandler, getIgnoreKey, getInitEvent, getModelState, getProperty, getState, getTag, init, injectProperty, isArray, isBoolean, isCnName, isDate, isEnName, isHexColor, isIdCard, isLandline, isMailBox, isMobile, isNumber, isObject, isPhecda, isPostalCode, isString, isWechat, mergeOptions, mergeState, plainToClass, regisHandler, regisInitEvent, register, registerAsync, setExposeKey, setIgnoreKey, setModalVar, snapShot, to, toNumber, toString, validate };
package/dist/index.js CHANGED
@@ -498,7 +498,7 @@ function getProperty(key) {
498
498
  __name(getProperty, "getProperty");
499
499
 
500
500
  // src/custom/decorator.ts
501
- function Watcher(eventName) {
501
+ function Watcher(eventName, options) {
502
502
  return (obj, key) => {
503
503
  setModalVar(obj, key);
504
504
  regisHandler(obj, key, {
@@ -506,7 +506,8 @@ function Watcher(eventName) {
506
506
  getProperty("watcher")?.({
507
507
  eventName,
508
508
  instance,
509
- key
509
+ key,
510
+ options
510
511
  });
511
512
  }
512
513
  });
package/dist/index.mjs CHANGED
@@ -420,7 +420,7 @@ function getProperty(key) {
420
420
  __name(getProperty, "getProperty");
421
421
 
422
422
  // src/custom/decorator.ts
423
- function Watcher(eventName) {
423
+ function Watcher(eventName, options) {
424
424
  return (obj, key) => {
425
425
  setModalVar(obj, key);
426
426
  regisHandler(obj, key, {
@@ -428,7 +428,8 @@ function Watcher(eventName) {
428
428
  getProperty("watcher")?.({
429
429
  eventName,
430
430
  instance,
431
- key
431
+ key,
432
+ options
432
433
  });
433
434
  }
434
435
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",