@aom-js/core 0.0.4 → 0.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/cjs/defines/callstack.d.ts +40 -0
- package/dist/cjs/defines/callstack.d.ts.map +1 -0
- package/dist/cjs/defines/callstack.js +99 -0
- package/dist/cjs/defines/callstack.js.map +1 -0
- package/dist/cjs/defines/classes.d.ts +1 -1
- package/dist/cjs/defines/classes.d.ts.map +1 -1
- package/dist/cjs/defines/classes.js.map +1 -1
- package/dist/cjs/defines/core.d.ts +11 -70
- package/dist/cjs/defines/core.d.ts.map +1 -1
- package/dist/cjs/defines/core.js +30 -157
- package/dist/cjs/defines/core.js.map +1 -1
- package/dist/cjs/defines/functions.d.ts +1 -2
- package/dist/cjs/defines/functions.d.ts.map +1 -1
- package/dist/cjs/defines/functions.js +0 -4
- package/dist/cjs/defines/functions.js.map +1 -1
- package/dist/cjs/defines/index.d.ts +4 -4
- package/dist/cjs/defines/index.js +4 -4
- package/dist/cjs/defines/internals.d.ts +14 -0
- package/dist/cjs/defines/internals.d.ts.map +1 -0
- package/dist/cjs/defines/internals.js +3 -0
- package/dist/cjs/defines/internals.js.map +1 -0
- package/dist/cjs/defines/node.d.ts +27 -0
- package/dist/cjs/defines/node.d.ts.map +1 -0
- package/dist/cjs/defines/node.js +82 -0
- package/dist/cjs/defines/node.js.map +1 -0
- package/dist/cjs/defines/types.d.ts +9 -4
- package/dist/cjs/defines/types.d.ts.map +1 -1
- package/dist/cjs/defines/types.js +14 -8
- package/dist/cjs/defines/types.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/mjs/defines/callstack.d.ts +40 -0
- package/dist/mjs/defines/callstack.d.ts.map +1 -0
- package/dist/mjs/defines/callstack.js +94 -0
- package/dist/mjs/defines/callstack.js.map +1 -0
- package/dist/mjs/defines/classes.d.ts +9 -0
- package/dist/mjs/defines/classes.d.ts.map +1 -0
- package/dist/mjs/defines/classes.js.map +1 -1
- package/dist/mjs/defines/core.d.ts +18 -0
- package/dist/mjs/defines/core.d.ts.map +1 -0
- package/dist/mjs/defines/core.js +28 -155
- package/dist/mjs/defines/core.js.map +1 -1
- package/dist/mjs/defines/functions.d.ts +3 -0
- package/dist/mjs/defines/functions.d.ts.map +1 -0
- package/dist/mjs/defines/functions.js +0 -3
- package/dist/mjs/defines/functions.js.map +1 -1
- package/dist/mjs/defines/index.d.ts +5 -0
- package/dist/mjs/defines/index.d.ts.map +1 -0
- package/dist/mjs/defines/index.js +4 -4
- package/dist/mjs/defines/internals.d.ts +14 -0
- package/dist/mjs/defines/internals.d.ts.map +1 -0
- package/dist/mjs/defines/internals.js +2 -0
- package/dist/mjs/defines/internals.js.map +1 -0
- package/dist/mjs/defines/node.d.ts +27 -0
- package/dist/mjs/defines/node.d.ts.map +1 -0
- package/dist/mjs/defines/node.js +78 -0
- package/dist/mjs/defines/node.js.map +1 -0
- package/dist/mjs/defines/types.d.ts +17 -0
- package/dist/mjs/defines/types.d.ts.map +1 -0
- package/dist/mjs/defines/types.js +13 -7
- package/dist/mjs/defines/types.js.map +1 -1
- package/dist/mjs/index.d.ts +2 -0
- package/dist/mjs/index.d.ts.map +1 -0
- package/dist/mjs/index.js +1 -1
- package/dist/types/defines/callstack.d.ts +39 -0
- package/dist/types/defines/classes.d.ts +1 -1
- package/dist/types/defines/core.d.ts +11 -70
- package/dist/types/defines/functions.d.ts +1 -2
- package/dist/types/defines/index.d.ts +4 -4
- package/dist/types/defines/internals.d.ts +13 -0
- package/dist/types/defines/node.d.ts +26 -0
- package/dist/types/defines/types.d.ts +9 -4
- package/dist/types/index.d.ts +1 -1
- package/package.json +14 -9
- package/readme.md +6 -2
- package/dist/cjs/constants/errors.d.ts +0 -3
- package/dist/cjs/constants/errors.d.ts.map +0 -1
- package/dist/cjs/constants/errors.js +0 -6
- package/dist/cjs/constants/errors.js.map +0 -1
- package/dist/cjs/constants/index.d.ts +0 -2
- package/dist/cjs/constants/index.d.ts.map +0 -1
- package/dist/cjs/constants/index.js +0 -18
- package/dist/cjs/constants/index.js.map +0 -1
- package/dist/mjs/constants/errors.js +0 -3
- package/dist/mjs/constants/errors.js.map +0 -1
- package/dist/mjs/constants/index.js +0 -2
- package/dist/mjs/constants/index.js.map +0 -1
- package/dist/types/constants/errors.d.ts +0 -2
- package/dist/types/constants/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/defines/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/defines/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,cAAc,GAGf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AA0CjC,MAAM,OAAO,OAAO;IAIlB,YACE,IAAmB,EACnB,MAAwB,EACxB,QAAmB,EACnB,MAAyB;QAEzB,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,CAAO,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAGO,MAAM,CAAC,YAAY;QAIzB,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAGrD,IAAI,CAAE,IAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAE7B,IAAY,CAAC,SAAS,CAAC,GAAG,IAAI,OAAO,EAAY,CAAC;QACrD,CAAC;QAGD,MAAM,GAAG,GAAuB,IAAY,CAAC,SAAS,CAAC,CAAC;QAExD,OAAO,GAAG,CAAC;IACb,CAAC;IAYO,MAAM,CAAC,WAAW,CAExB,MAAS,EACT,QAAmB;QAGnB,MAAM,WAAW,GAAG,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EAAE,QAAQ,CAAC,CAAC;YAEvD,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAC5B,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAC1D,SAAS,CACV,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/defines/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAuBzC,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,WAI5C"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export function isClass(value) {
|
|
2
2
|
return (typeof value === "function" && /^class[\s\{]/.test(Function.prototype.toString.call(value)));
|
|
3
3
|
}
|
|
4
|
-
export function hasOwnProperty(target, property) {
|
|
5
|
-
return Object.prototype.hasOwnProperty.call(target, property);
|
|
6
|
-
}
|
|
7
4
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/defines/functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/defines/functions.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,OAAO,CAAC,KAAqB;IAC3C,OAAO,CACL,OAAO,KAAK,KAAK,UAAU,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAC5F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/defines/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./functions";
|
|
2
|
-
export * from "./types";
|
|
3
|
-
export * from "./classes";
|
|
4
|
-
export * from "./core";
|
|
1
|
+
export * from "./functions.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./classes.js";
|
|
4
|
+
export * from "./core.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClassConstructor, InstanceTarget, Property } from "./types.js";
|
|
2
|
+
import type { AomCore } from "./core.js";
|
|
3
|
+
export declare type AomHandler<T extends AomCore> = ($: T) => void;
|
|
4
|
+
export declare type AomCombinedHandler<T extends AomCore> = ($: T, descriptor?: PropertyDescriptor) => void;
|
|
5
|
+
export declare type AomMethodHandler<T extends AomCore> = ($: T, descriptor: PropertyDescriptor) => void;
|
|
6
|
+
export declare type AomPropertyHandler<T extends AomCore> = ($: T) => void;
|
|
7
|
+
export declare type AomParameterHandler<T extends AomCore> = ($: T, parameterIndex: number) => void;
|
|
8
|
+
export type AomClass<T extends AomCore> = ClassConstructor<T> & typeof AomCore;
|
|
9
|
+
export type OriginDescriptor = {
|
|
10
|
+
target: InstanceTarget;
|
|
11
|
+
property: Property;
|
|
12
|
+
descriptor?: PropertyDescriptor;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=internals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../../../src/defines/internals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,CAAC,OAAO,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;AAGnE,MAAM,CAAC,OAAO,MAAM,kBAAkB,CAAC,CAAC,SAAS,OAAO,IAAI,CAC1D,CAAC,EAAE,CAAC,EACJ,UAAU,CAAC,EAAE,kBAAkB,KAC5B,IAAI,CAAC;AAKV,MAAM,CAAC,OAAO,MAAM,gBAAgB,CAAC,CAAC,SAAS,OAAO,IAAI,CACxD,CAAC,EAAE,CAAC,EACJ,UAAU,EAAE,kBAAkB,KAC3B,IAAI,CAAC;AAGV,MAAM,CAAC,OAAO,MAAM,kBAAkB,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;AAG3E,MAAM,CAAC,OAAO,MAAM,mBAAmB,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;AAIpG,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,CAAC;AAG/E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internals.js","sourceRoot":"","sources":["../../../src/defines/internals.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClassConstructor, ClassType, Property, InstanceTarget } from "./types.js";
|
|
2
|
+
import type { AomCore } from "./core.js";
|
|
3
|
+
import { AomCallstack } from "./callstack.js";
|
|
4
|
+
import type { AomClass, OriginDescriptor } from "./internals.js";
|
|
5
|
+
type NodeOriginDescriptor<T extends AomCore> = {
|
|
6
|
+
_: AomNode<T>;
|
|
7
|
+
self: T;
|
|
8
|
+
} & OriginDescriptor;
|
|
9
|
+
export declare class AomNode<T extends AomCore> {
|
|
10
|
+
private readonly __nominal?;
|
|
11
|
+
base: AomClass<T>;
|
|
12
|
+
target: ClassConstructor;
|
|
13
|
+
property?: Property;
|
|
14
|
+
root: T;
|
|
15
|
+
self: T;
|
|
16
|
+
originInstance: InstanceTarget;
|
|
17
|
+
origins: NodeOriginDescriptor<T>[];
|
|
18
|
+
private inherited;
|
|
19
|
+
properties: Map<Property, T>;
|
|
20
|
+
statics: Map<Property, T>;
|
|
21
|
+
callstack: AomCallstack<T>;
|
|
22
|
+
constructor(self: T, base: AomClass<any>, target: ClassConstructor, property?: Property, origin?: OriginDescriptor);
|
|
23
|
+
apply(): void;
|
|
24
|
+
inherit(parent: ClassType): T;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/defines/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG9D,KAAK,oBAAoB,CAAC,CAAC,SAAS,OAAO,IAAI;IAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG,gBAAgB,CAAC;AAY7F,qBAAa,OAAO,CAAC,CAAC,SAAS,OAAO;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAI;IAG/B,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAGlB,MAAM,EAAE,gBAAgB,CAAC;IAGzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAIpB,IAAI,EAAE,CAAC,CAAC;IAGR,IAAI,EAAE,CAAC,CAAC;IAGR,cAAc,EAAE,cAAc,CAAC;IAS/B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IAInC,OAAO,CAAC,SAAS,CAAqB;IAGtC,UAAU,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAG7B,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAI1B,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAE3B,YACE,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,EACnB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,CAAC,EAAE,QAAQ,EACnB,MAAM,CAAC,EAAE,gBAAgB,EA0B1B;IAyBD,KAAK,SAmBJ;IA2CD,OAAO,CAAC,MAAM,EAAE,SAAS,KA+ExB;CACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { AomCallstack } from "./callstack.js";
|
|
2
|
+
export class AomNode {
|
|
3
|
+
constructor(self, base, target, property, origin) {
|
|
4
|
+
this.self = self;
|
|
5
|
+
this.base = base;
|
|
6
|
+
this.target = target;
|
|
7
|
+
this.property = property;
|
|
8
|
+
this.properties = new Map();
|
|
9
|
+
this.statics = new Map();
|
|
10
|
+
this.origins = [];
|
|
11
|
+
this.inherited = new WeakSet();
|
|
12
|
+
this.callstack = new AomCallstack(this);
|
|
13
|
+
if (property) {
|
|
14
|
+
this.root = this.base.instance(target);
|
|
15
|
+
if (origin) {
|
|
16
|
+
this.originInstance = origin.target;
|
|
17
|
+
if (!origin.descriptor?.enumerable) {
|
|
18
|
+
this.root._.origins.push({ _: this, self, ...origin });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.root = this.self;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
apply() {
|
|
27
|
+
this.properties.forEach(($) => {
|
|
28
|
+
$._.callstack.apply();
|
|
29
|
+
});
|
|
30
|
+
this.statics.forEach(($) => {
|
|
31
|
+
$._.callstack.apply();
|
|
32
|
+
});
|
|
33
|
+
this.origins.forEach(({ _ }) => {
|
|
34
|
+
_.callstack.apply();
|
|
35
|
+
});
|
|
36
|
+
this.callstack.apply();
|
|
37
|
+
}
|
|
38
|
+
inherit(parent) {
|
|
39
|
+
const $parent = this.base.instance(parent);
|
|
40
|
+
if (this.inherited.has(parent)) {
|
|
41
|
+
return $parent;
|
|
42
|
+
}
|
|
43
|
+
this.inherited.add(parent);
|
|
44
|
+
$parent._.callstack.transferTo(this.self);
|
|
45
|
+
const transferDescritorWithDecorators = (target, property, source, descriptor) => {
|
|
46
|
+
if (descriptor && descriptor.value) {
|
|
47
|
+
const curriedDescriptor = function (...args) {
|
|
48
|
+
return Reflect.apply(descriptor.value, this, args);
|
|
49
|
+
};
|
|
50
|
+
Reflect.defineProperty(target, property, {
|
|
51
|
+
...descriptor,
|
|
52
|
+
value: curriedDescriptor,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const $childInstance = this.base.instance(target, property);
|
|
56
|
+
source._.callstack.transferTo($childInstance);
|
|
57
|
+
};
|
|
58
|
+
$parent._.origins.forEach((origin) => {
|
|
59
|
+
const $origin = origin.descriptor ? this.base.instance(origin.descriptor.value) : origin.self;
|
|
60
|
+
const isClassOrigin = origin.target === $origin._.target;
|
|
61
|
+
const property = $origin._.property;
|
|
62
|
+
if (isClassOrigin &&
|
|
63
|
+
!Object.hasOwn(this.target, property) &&
|
|
64
|
+
!this.root._.statics.get(property)) {
|
|
65
|
+
transferDescritorWithDecorators(this.target, property, $origin, origin.descriptor);
|
|
66
|
+
}
|
|
67
|
+
else if (!isClassOrigin &&
|
|
68
|
+
!Object.hasOwn(this.target.prototype, property) &&
|
|
69
|
+
!this.root._.properties.get(property)) {
|
|
70
|
+
transferDescritorWithDecorators(this.target.prototype, property, $origin, origin.descriptor);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return $parent;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/defines/node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgB3C,MAAM,OAAO,OAAO;IA6ClB,YACE,IAAO,EACP,IAAmB,EACnB,MAAwB,EACxB,QAAmB,EACnB,MAAyB;QAEzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QAGxC,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;gBACpC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;oBACnC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EACrC,CAAC;gBAED,+BAA+B,CAC7B,IAAI,CAAC,MAAM,CAAC,SAAS,EACrB,QAAQ,EACR,OAAO,EACP,MAAM,CAAC,UAAU,CAClB,CAAC;YACJ,CAAC;iBAAM,CAAC;YAKR,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare type ClassConstructor<T extends any = {}> = new (...args: any[]) => T;
|
|
2
|
+
export declare type ClassType = ClassConstructor | Function;
|
|
3
|
+
export declare type Property = string | symbol;
|
|
4
|
+
export declare type InstanceTarget = ClassType | InstanceType<ClassConstructor>;
|
|
5
|
+
export declare type CombinedDecorator = <T>(target: ClassType, propertyKey?: Property, descriptor?: TypedPropertyDescriptor<T>) => void;
|
|
6
|
+
export declare enum ExecutionPhase {
|
|
7
|
+
INSTANT = "instant",
|
|
8
|
+
FIRST = "first",
|
|
9
|
+
LAST = "last",
|
|
10
|
+
DELAY = "delay"
|
|
11
|
+
}
|
|
12
|
+
export declare enum InheritPlacement {
|
|
13
|
+
APPEND = "append",
|
|
14
|
+
PREPEND = "prepend",
|
|
15
|
+
SKIP = "skip"
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,MAAM,gBAAgB,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAGrF,MAAM,CAAC,OAAO,MAAM,SAAS,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAG5D,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAO/C,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG,SAAS,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAmBhF,MAAM,CAAC,OAAO,MAAM,iBAAiB,GAAG,CAAC,CAAC,EACxC,MAAM,EAAE,SAAS,EACjB,WAAW,CAAC,EAAE,QAAQ,EACtB,UAAU,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,KACpC,IAAI,CAAC;AAoCV,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAEhB;AA2BD,oBAAY,gBAAgB;IAE1B,MAAM,WAAW;IAQjB,OAAO,YAAY;IAEnB,IAAI,SAAS;CACd"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})(
|
|
1
|
+
export var ExecutionPhase;
|
|
2
|
+
(function (ExecutionPhase) {
|
|
3
|
+
ExecutionPhase["INSTANT"] = "instant";
|
|
4
|
+
ExecutionPhase["FIRST"] = "first";
|
|
5
|
+
ExecutionPhase["LAST"] = "last";
|
|
6
|
+
ExecutionPhase["DELAY"] = "delay";
|
|
7
|
+
})(ExecutionPhase || (ExecutionPhase = {}));
|
|
8
|
+
export var InheritPlacement;
|
|
9
|
+
(function (InheritPlacement) {
|
|
10
|
+
InheritPlacement["APPEND"] = "append";
|
|
11
|
+
InheritPlacement["PREPEND"] = "prepend";
|
|
12
|
+
InheritPlacement["SKIP"] = "skip";
|
|
13
|
+
})(InheritPlacement || (InheritPlacement = {}));
|
|
8
14
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,iCAAe,CAAA;AAEjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AA2BD,MAAM,CAAN,IAAY,gBAaX;AAbD,WAAY,gBAAgB;IAE1B,qCAAiB,CAAA;IAQjB,uCAAmB,CAAA;IAEnB,iCAAa,CAAA;AACf,CAAC,EAbW,gBAAgB,KAAhB,gBAAgB,QAa3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/mjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./defines";
|
|
1
|
+
export * from "./defines/index.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ExecutionPhase, InheritPlacement } from "./types.js";
|
|
2
|
+
import type { AomCore } from "./core.js";
|
|
3
|
+
import type { AomNode } from "./node.js";
|
|
4
|
+
import type { AomHandler, AomCombinedHandler, AomMethodHandler, AomPropertyHandler, AomParameterHandler } from "./internals.js";
|
|
5
|
+
type LazyCallHandler<T extends AomCore> = AomHandler<T> | AomCombinedHandler<T> | AomMethodHandler<T> | AomPropertyHandler<T> | AomParameterHandler<T>;
|
|
6
|
+
type LazyCall<T extends AomCore> = [
|
|
7
|
+
LazyCallHandler<T>,
|
|
8
|
+
args: [T, ...any],
|
|
9
|
+
inherit?: InheritPlacement,
|
|
10
|
+
parameter?: boolean
|
|
11
|
+
];
|
|
12
|
+
export declare class AomCallstackQueue<T extends AomCore> {
|
|
13
|
+
private readonly __nominal?;
|
|
14
|
+
private queue;
|
|
15
|
+
private fired;
|
|
16
|
+
private callstack;
|
|
17
|
+
private type;
|
|
18
|
+
private async;
|
|
19
|
+
private deferred;
|
|
20
|
+
constructor(callstack: AomCallstack<T>, type: ExecutionPhase);
|
|
21
|
+
prependBatch(values: Array<LazyCall<any>>): void;
|
|
22
|
+
add<U extends T>(value: LazyCall<U>): any;
|
|
23
|
+
exec(): void;
|
|
24
|
+
run<U extends T>([handler, args]: LazyCall<U>): any;
|
|
25
|
+
hasParameters(): boolean;
|
|
26
|
+
transferTo<U extends T>(target: U, skipParameters?: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class AomCallstack<T extends AomCore> {
|
|
29
|
+
private readonly __nominal?;
|
|
30
|
+
_: AomNode<T>;
|
|
31
|
+
stores: {
|
|
32
|
+
[key in ExecutionPhase]: AomCallstackQueue<T>;
|
|
33
|
+
};
|
|
34
|
+
constructor(_: AomNode<T>);
|
|
35
|
+
add<U extends T>(value: LazyCall<U>, storeFlag: ExecutionPhase): void;
|
|
36
|
+
apply(): void;
|
|
37
|
+
transferTo<U extends T>(target: U): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -1,76 +1,17 @@
|
|
|
1
|
-
import { ClassConstructor, CombinedDecorator, Property,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare type AomMethodHandler<T extends AomCore> = ($: T, descriptor: PropertyDescriptor) => PropertyDescriptor | void;
|
|
5
|
-
declare type AomPropertyHandler<T extends AomCore> = ($: T) => void;
|
|
6
|
-
declare type AomParameterHandler<T extends AomCore> = ($: T, parameterIndex: number) => void;
|
|
7
|
-
type AomClass<T extends AomCore> = ClassConstructor<T> & typeof AomCore;
|
|
8
|
-
type LazyCallHandler<T extends AomCore> = AomHandler<T> | AomСombinedHandler<T> | AomMethodHandler<T> | AomPropertyHandler<T> | AomParameterHandler<T>;
|
|
9
|
-
type LazyCall<T extends AomCore> = [LazyCallHandler<T>, args: [T, ...any]];
|
|
10
|
-
type OriginDescriptor = {
|
|
11
|
-
target: InstanceTarget;
|
|
12
|
-
property: Property;
|
|
13
|
-
descriptor: PropertyDescriptor;
|
|
14
|
-
};
|
|
15
|
-
type NodeOriginDescriptor<T extends AomCore> = {
|
|
16
|
-
_: AomNode<T>;
|
|
17
|
-
self: T;
|
|
18
|
-
} & OriginDescriptor;
|
|
19
|
-
declare class AomCallstackQueue<T extends AomCore> {
|
|
20
|
-
private readonly __nominal?;
|
|
21
|
-
private queue;
|
|
22
|
-
private fired;
|
|
23
|
-
private callstack;
|
|
24
|
-
private type?;
|
|
25
|
-
private async;
|
|
26
|
-
private indexed;
|
|
27
|
-
constructor(callstack: AomCallstack<T>, type: DecoratorsQueueStore, indexed?: boolean);
|
|
28
|
-
add<U extends T>(value: LazyCall<U>, index?: number): any;
|
|
29
|
-
exec(): void;
|
|
30
|
-
run<U extends T>([handler, args]: LazyCall<U>): any;
|
|
31
|
-
transferTo<U extends T>(target: U): void;
|
|
32
|
-
}
|
|
33
|
-
declare class AomCallstack<T extends AomCore> {
|
|
34
|
-
private readonly __nominal?;
|
|
35
|
-
_: AomNode<T>;
|
|
36
|
-
stores: {
|
|
37
|
-
[key in DecoratorsQueueStore]: AomCallstackQueue<T>;
|
|
38
|
-
};
|
|
39
|
-
indexes: {
|
|
40
|
-
[key in DecoratorsQueueStore]: AomCallstackQueue<T>;
|
|
41
|
-
};
|
|
42
|
-
constructor(_: AomNode<T>);
|
|
43
|
-
add<U extends T>(value: LazyCall<U>, storeFlag: DecoratorsQueueStore, index?: number): void;
|
|
44
|
-
apply(): void;
|
|
45
|
-
transferTo<U extends T>(target: U): void;
|
|
46
|
-
}
|
|
47
|
-
declare class AomNode<T extends AomCore> {
|
|
48
|
-
private readonly __nominal?;
|
|
49
|
-
base: AomClass<T>;
|
|
50
|
-
target: ClassConstructor;
|
|
51
|
-
property?: Property;
|
|
52
|
-
currentProperty: T | undefined;
|
|
53
|
-
root: T;
|
|
54
|
-
self: T;
|
|
55
|
-
originInstance: InstanceTarget;
|
|
56
|
-
origins: NodeOriginDescriptor<T>[];
|
|
57
|
-
properties: Map<Property, T>;
|
|
58
|
-
statics: Map<Property, T>;
|
|
59
|
-
callstack: AomCallstack<T>;
|
|
60
|
-
constructor(self: T, base: AomClass<any>, target: ClassConstructor, property?: Property, origin?: OriginDescriptor);
|
|
61
|
-
apply(): void;
|
|
62
|
-
}
|
|
1
|
+
import { ClassConstructor, CombinedDecorator, Property, ExecutionPhase, InheritPlacement, InstanceTarget } from "./types.js";
|
|
2
|
+
import { AomNode } from "./node.js";
|
|
3
|
+
import type { AomClass, OriginDescriptor, AomHandler, AomCombinedHandler, AomMethodHandler, AomPropertyHandler, AomParameterHandler } from "./internals.js";
|
|
63
4
|
export declare class AomCore {
|
|
64
5
|
_: AomNode<this>;
|
|
65
6
|
constructor(base: AomClass<any>, target: ClassConstructor, property?: Property, origin?: OriginDescriptor);
|
|
66
7
|
private static instancesMap;
|
|
67
8
|
private static instanceKey;
|
|
68
|
-
static checkExists<T extends AomCore, E extends InstanceTarget
|
|
69
|
-
static instance<T extends AomCore, E extends InstanceTarget
|
|
70
|
-
static
|
|
71
|
-
static
|
|
72
|
-
static
|
|
73
|
-
static
|
|
74
|
-
static
|
|
9
|
+
static checkExists<T extends AomCore, E extends InstanceTarget>(this: AomClass<T>, target: E, property?: Property): T | undefined;
|
|
10
|
+
static instance<T extends AomCore, E extends InstanceTarget>(this: AomClass<T>, target: E, property?: Property): T;
|
|
11
|
+
static resolveFor<T extends AomCore>(this: AomClass<T>, $: T, context: ClassConstructor): T;
|
|
12
|
+
static classDecorator<T extends AomCore>(this: AomClass<T>, handler: AomHandler<T>, storeFlag?: ExecutionPhase, inherit?: InheritPlacement): ClassDecorator;
|
|
13
|
+
static combinedDecorator<T extends AomCore>(this: AomClass<T>, handler: AomCombinedHandler<T>, storeFlag?: ExecutionPhase, inherit?: InheritPlacement): CombinedDecorator;
|
|
14
|
+
static methodDecorator<T extends AomCore>(this: AomClass<T>, handler: AomMethodHandler<T>, storeFlag?: ExecutionPhase, inherit?: InheritPlacement): MethodDecorator;
|
|
15
|
+
static propertyDecorator<T extends AomCore>(this: AomClass<T>, handler: AomPropertyHandler<T>, storeFlag?: ExecutionPhase, inherit?: InheritPlacement): PropertyDecorator;
|
|
16
|
+
static parameterDecorator<T extends AomCore>(this: AomClass<T>, handler: AomParameterHandler<T>, storeFlag?: ExecutionPhase, inherit?: InheritPlacement): ParameterDecorator;
|
|
75
17
|
}
|
|
76
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./functions";
|
|
2
|
-
export * from "./types";
|
|
3
|
-
export * from "./classes";
|
|
4
|
-
export * from "./core";
|
|
1
|
+
export * from "./functions.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./classes.js";
|
|
4
|
+
export * from "./core.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClassConstructor, InstanceTarget, Property } from "./types.js";
|
|
2
|
+
import type { AomCore } from "./core.js";
|
|
3
|
+
export declare type AomHandler<T extends AomCore> = ($: T) => void;
|
|
4
|
+
export declare type AomCombinedHandler<T extends AomCore> = ($: T, descriptor?: PropertyDescriptor) => void;
|
|
5
|
+
export declare type AomMethodHandler<T extends AomCore> = ($: T, descriptor: PropertyDescriptor) => void;
|
|
6
|
+
export declare type AomPropertyHandler<T extends AomCore> = ($: T) => void;
|
|
7
|
+
export declare type AomParameterHandler<T extends AomCore> = ($: T, parameterIndex: number) => void;
|
|
8
|
+
export type AomClass<T extends AomCore> = ClassConstructor<T> & typeof AomCore;
|
|
9
|
+
export type OriginDescriptor = {
|
|
10
|
+
target: InstanceTarget;
|
|
11
|
+
property: Property;
|
|
12
|
+
descriptor?: PropertyDescriptor;
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ClassConstructor, ClassType, Property, InstanceTarget } from "./types.js";
|
|
2
|
+
import type { AomCore } from "./core.js";
|
|
3
|
+
import { AomCallstack } from "./callstack.js";
|
|
4
|
+
import type { AomClass, OriginDescriptor } from "./internals.js";
|
|
5
|
+
type NodeOriginDescriptor<T extends AomCore> = {
|
|
6
|
+
_: AomNode<T>;
|
|
7
|
+
self: T;
|
|
8
|
+
} & OriginDescriptor;
|
|
9
|
+
export declare class AomNode<T extends AomCore> {
|
|
10
|
+
private readonly __nominal?;
|
|
11
|
+
base: AomClass<T>;
|
|
12
|
+
target: ClassConstructor;
|
|
13
|
+
property?: Property;
|
|
14
|
+
root: T;
|
|
15
|
+
self: T;
|
|
16
|
+
originInstance: InstanceTarget;
|
|
17
|
+
origins: NodeOriginDescriptor<T>[];
|
|
18
|
+
private inherited;
|
|
19
|
+
properties: Map<Property, T>;
|
|
20
|
+
statics: Map<Property, T>;
|
|
21
|
+
callstack: AomCallstack<T>;
|
|
22
|
+
constructor(self: T, base: AomClass<any>, target: ClassConstructor, property?: Property, origin?: OriginDescriptor);
|
|
23
|
+
apply(): void;
|
|
24
|
+
inherit(parent: ClassType): T;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export declare type ClassConstructor<T extends any = {}> = new (...args: any[]) => T;
|
|
2
|
-
export declare type
|
|
2
|
+
export declare type ClassType = ClassConstructor | Function;
|
|
3
3
|
export declare type Property = string | symbol;
|
|
4
|
-
export declare type InstanceTarget =
|
|
5
|
-
export declare type CombinedDecorator = <T>(target:
|
|
6
|
-
export declare enum
|
|
4
|
+
export declare type InstanceTarget = ClassType | InstanceType<ClassConstructor>;
|
|
5
|
+
export declare type CombinedDecorator = <T>(target: ClassType, propertyKey?: Property, descriptor?: TypedPropertyDescriptor<T>) => void;
|
|
6
|
+
export declare enum ExecutionPhase {
|
|
7
7
|
INSTANT = "instant",
|
|
8
8
|
FIRST = "first",
|
|
9
9
|
LAST = "last",
|
|
10
10
|
DELAY = "delay"
|
|
11
11
|
}
|
|
12
|
+
export declare enum InheritPlacement {
|
|
13
|
+
APPEND = "append",
|
|
14
|
+
PREPEND = "prepend",
|
|
15
|
+
SKIP = "skip"
|
|
16
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./defines";
|
|
1
|
+
export * from "./defines/index.js";
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.1.1",
|
|
3
3
|
"name": "@aom-js/core",
|
|
4
4
|
"description": "`@aom` meta-framework core code",
|
|
5
|
-
"homepage": "https://
|
|
5
|
+
"homepage": "https://aom.js.org/packages/core/",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/aom-js/main/issues"
|
|
8
8
|
},
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"author": "Grigory B. Kholstinnikov (scarych)",
|
|
16
16
|
"dependencies": {},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/node": "^
|
|
18
|
+
"@types/node": "^26.1.2",
|
|
19
19
|
"tslib": "^2.8.1",
|
|
20
|
-
"typescript": "^
|
|
20
|
+
"typescript": "^7.0.2"
|
|
21
21
|
},
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"publishConfig": {
|
|
@@ -33,16 +33,21 @@
|
|
|
33
33
|
],
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
|
-
"import":
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/types/index.d.ts",
|
|
38
|
+
"default": "./dist/mjs/index.js"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/cjs/index.d.ts",
|
|
42
|
+
"default": "./dist/cjs/index.js"
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
"scripts": {
|
|
42
47
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
43
48
|
"clean": "rm -rf dist/",
|
|
44
49
|
"prebuild": "rm -rf dist/",
|
|
45
|
-
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.mjs.json && tsc --project tsconfig.build.types.json ",
|
|
46
|
-
"prepare": "
|
|
50
|
+
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.mjs.json && tsc --project tsconfig.build.types.json && node ../../scripts/post-build.js",
|
|
51
|
+
"prepare": ""
|
|
47
52
|
}
|
|
48
53
|
}
|
package/readme.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# `@aom-js/core`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Механика декораторной фабрики aom: реестр мета-инстансов, узел, фазы исполнения, наследование метаданных, `resolveFor`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Документация: https://aom.js.org/packages/core/
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @aom-js/core
|
|
9
|
+
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/constants/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,+BAA+B,oCAAoC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONSTRUCTOR_PROPERTY_TYPE_ERROR = exports.CONSTRUCTOR_TYPE_ERROR = void 0;
|
|
4
|
-
exports.CONSTRUCTOR_TYPE_ERROR = "CONSTRUCTOR_TYPE_ERROR";
|
|
5
|
-
exports.CONSTRUCTOR_PROPERTY_TYPE_ERROR = "CONSTRUCTOR_PROPERTY_TYPE_ERROR";
|
|
6
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/constants/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,+BAA+B,GAAG,iCAAiC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|