phecda-core 1.0.4 → 1.0.5
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 +2 -1
- package/dist/index.js +9 -0
- package/dist/index.mjs +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ declare function Get(target: any, key: PropertyKey): void;
|
|
|
83
83
|
declare function Pipe(v: ReturnType<typeof to>): (obj: any, key: PropertyKey) => void;
|
|
84
84
|
declare function Tag(tag: string): (target: any) => void;
|
|
85
85
|
declare function Storage(target: any): void;
|
|
86
|
+
declare function Window(target: any): void;
|
|
86
87
|
|
|
87
88
|
declare function validate(p: RegExp | string | Function | Object | Number, v: any): Promise<any>;
|
|
88
89
|
declare function getTag<M extends new (...args: any) => any>(Model: M): any;
|
|
@@ -125,4 +126,4 @@ declare function getProperty(key: string): any;
|
|
|
125
126
|
|
|
126
127
|
declare function Watcher(eventName: string): (obj: any, key: string) => void;
|
|
127
128
|
|
|
128
|
-
export { ClassValue, Clear, Err, Get, Ignore, Init, Phecda, PhecdaHandler, PhecdaNameSpace, Pipe, Rule, Storage, Tag, UsePipeOptions, Watcher, activeInstance, addDecoToClass, classToValue, getExposeKey, getHandler, getIgnoreKey, getInitEvent, getModelState, getProperty, getTag, init, injectProperty, isArray, isBoolean, isCnName, isDate, isEnName, isHexColor, isIdCard, isLandline, isMailBox, isMobile, isNumber, isObject, isPostalCode, isString, isWechat, plainToClass, regisHandler, regisInitEvent, register, setExposeKey, setIgnoreKey, setModalState, snapShot, to, toNumber, toString, validate };
|
|
129
|
+
export { ClassValue, Clear, Err, Get, Ignore, Init, Phecda, PhecdaHandler, PhecdaNameSpace, Pipe, Rule, Storage, Tag, UsePipeOptions, Watcher, Window, activeInstance, addDecoToClass, classToValue, getExposeKey, getHandler, getIgnoreKey, getInitEvent, getModelState, getProperty, getTag, init, injectProperty, isArray, isBoolean, isCnName, isDate, isEnName, isHexColor, isIdCard, isLandline, isMailBox, isMobile, isNumber, isObject, isPostalCode, isString, isWechat, plainToClass, regisHandler, regisInitEvent, register, setExposeKey, setIgnoreKey, setModalState, snapShot, to, toNumber, toString, validate };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __export(src_exports, {
|
|
|
30
30
|
Storage: () => Storage,
|
|
31
31
|
Tag: () => Tag,
|
|
32
32
|
Watcher: () => Watcher,
|
|
33
|
+
Window: () => Window,
|
|
33
34
|
activeInstance: () => activeInstance,
|
|
34
35
|
addDecoToClass: () => addDecoToClass,
|
|
35
36
|
classToValue: () => classToValue,
|
|
@@ -218,6 +219,13 @@ function Storage(target) {
|
|
|
218
219
|
}
|
|
219
220
|
});
|
|
220
221
|
}
|
|
222
|
+
function Window(target) {
|
|
223
|
+
if (!window.__PHECDA__)
|
|
224
|
+
window.__PHECDA__ = {};
|
|
225
|
+
const tag = target.prototype._namespace.__TAG__;
|
|
226
|
+
if (tag)
|
|
227
|
+
window.__PHECDA__[tag] = target;
|
|
228
|
+
}
|
|
221
229
|
|
|
222
230
|
// src/utils.ts
|
|
223
231
|
async function validate(p, v) {
|
|
@@ -421,6 +429,7 @@ function Watcher(eventName) {
|
|
|
421
429
|
Storage,
|
|
422
430
|
Tag,
|
|
423
431
|
Watcher,
|
|
432
|
+
Window,
|
|
424
433
|
activeInstance,
|
|
425
434
|
addDecoToClass,
|
|
426
435
|
classToValue,
|
package/dist/index.mjs
CHANGED
|
@@ -144,6 +144,13 @@ function Storage(target) {
|
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
+
function Window(target) {
|
|
148
|
+
if (!window.__PHECDA__)
|
|
149
|
+
window.__PHECDA__ = {};
|
|
150
|
+
const tag = target.prototype._namespace.__TAG__;
|
|
151
|
+
if (tag)
|
|
152
|
+
window.__PHECDA__[tag] = target;
|
|
153
|
+
}
|
|
147
154
|
|
|
148
155
|
// src/utils.ts
|
|
149
156
|
async function validate(p, v) {
|
|
@@ -346,6 +353,7 @@ export {
|
|
|
346
353
|
Storage,
|
|
347
354
|
Tag,
|
|
348
355
|
Watcher,
|
|
356
|
+
Window,
|
|
349
357
|
activeInstance,
|
|
350
358
|
addDecoToClass,
|
|
351
359
|
classToValue,
|