@prostojs/mate 0.3.3 → 0.5.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/README.md CHANGED
@@ -19,27 +19,27 @@ npm install @prostojs/mate
19
19
  After installation, you can start using Mate to define and handle metadata in your TypeScript project. Below is an example that showcases different levels of metadata usage.
20
20
 
21
21
  ```ts
22
- import { TMateParamMeta } from '@prostojs/mate';
23
- import { Mate } from '@prostojs/mate';
22
+ import { TMateParamMeta } from '@prostojs/mate'
23
+ import { Mate } from '@prostojs/mate'
24
24
 
25
25
  // Define your metadata interfaces
26
26
  interface TClassMeta {
27
- name: string;
28
- model: string;
29
- fromParam: string;
30
- manufacturer: string;
31
- data: string[];
32
- inherit?: bolean;
27
+ name: string
28
+ model: string
29
+ fromParam: string
30
+ manufacturer: string
31
+ data: string[]
32
+ inherit?: bolean
33
33
  }
34
34
 
35
35
  interface TPropMeta<TParamMeta> {
36
- description: string;
37
- params: (TMateParamMeta & TParamMeta)[];
36
+ description: string
37
+ params: (TMateParamMeta & TParamMeta)[]
38
38
  inherit?: bolean
39
39
  }
40
40
 
41
41
  interface TParamMeta {
42
- required: boolean;
42
+ required: boolean
43
43
  }
44
44
 
45
45
  const mate = new Mate<TClassMeta, TPropMeta<TParamMeta>>('robot-meta', {
@@ -47,32 +47,32 @@ const mate = new Mate<TClassMeta, TPropMeta<TParamMeta>>('robot-meta', {
47
47
  readType: true,
48
48
  collectPropKeys: true,
49
49
  inherit(classMeta, targetMeta, level, prop) {
50
- return !!targetMeta?.inherit || !!classMeta?.inherit;
50
+ return !!targetMeta?.inherit || !!classMeta?.inherit
51
51
  },
52
- });
52
+ })
53
53
 
54
54
  // Annotate your class
55
- @mate.decorate('name', 'NXT')
56
- @mate.decorate('model', 'EV3')
55
+ @mate.decorate('name', 'NXT')
56
+ @mate.decorate('model', 'EV3')
57
57
  @mate.decorate('manufacturer', 'LEGO')
58
- @mate.decorate('data', 'NXT-0001', true)
58
+ @mate.decorate('data', 'NXT-0001', true)
59
59
  class Robot {
60
60
  @mate.decorate('description', 'Robotic arm for grabbing objects')
61
- arm: string;
61
+ arm: string
62
62
 
63
- @mate.decorate('description', 'Sensors to detect objects')
63
+ @mate.decorate('description', 'Sensors to detect objects')
64
64
  sensors(
65
- @mate.decorateClass('fromParam', 'hoised value')
66
- @mate.decorate('required', true)
67
- input: string
65
+ @mate.decorateClass('fromParam', 'hoised value')
66
+ @mate.decorate('required', true)
67
+ input: string,
68
68
  ): string {
69
- return 'Activated sensors with input: ' + input;
69
+ return 'Activated sensors with input: ' + input
70
70
  }
71
71
  }
72
72
 
73
73
  // Read the metadata
74
- let classMeta = mate.read(Robot);
75
- console.log(classMeta);
74
+ let classMeta = mate.read(Robot)
75
+ console.log(classMeta)
76
76
  // Expected Output:
77
77
  // {
78
78
  // name: 'NXT',
@@ -86,8 +86,8 @@ console.log(classMeta);
86
86
  // }
87
87
 
88
88
  // read the property metadata
89
- let armMeta = mate.read(Robot, 'arm');
90
- console.log(armMeta);
89
+ let armMeta = mate.read(Robot, 'arm')
90
+ console.log(armMeta)
91
91
  // Expected Output:
92
92
  // {
93
93
  // description: 'Robotic arm for grabbing objects',
@@ -97,8 +97,8 @@ console.log(armMeta);
97
97
  // }
98
98
 
99
99
  // read the method metadata
100
- let sensorsMeta = mate.read(Robot, 'sensors');
101
- console.log(sensorsMeta);
100
+ let sensorsMeta = mate.read(Robot, 'sensors')
101
+ console.log(sensorsMeta)
102
102
  // Expected Output:
103
103
  // {
104
104
  // description: 'Sensors to detect objects',
@@ -132,12 +132,14 @@ const mate = new Mate<MyMeta>('my-metadata-key', {
132
132
  if (prop) {
133
133
  // if it is a method metadata
134
134
  // we require a key `inherit` to be true for inheritance
135
- return !!methodMeta?.inherit || !!(classMeta?.inherit && !methodMeta)
135
+ return (
136
+ !!methodMeta?.inherit || !!(classMeta?.inherit && !methodMeta)
137
+ )
136
138
  }
137
139
  // otherwise (in case of class metadata) we require a key `inherit`
138
140
  // to be true for inheritance on class metadata
139
141
  return !!classMeta?.inherit
140
- }
142
+ },
141
143
  })
142
144
  ```
143
145
 
package/dist/index.cjs ADDED
@@ -0,0 +1,242 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/module-identity.ts
4
+ const MATE_MODULE_IDENTITY_KEY = Symbol.for("prostojs:mate:module-identity");
5
+ function getModulePath() {
6
+ try {
7
+ return require("url").pathToFileURL(__filename).href;
8
+ } catch {
9
+ return;
10
+ }
11
+ }
12
+ function formatIdentity(identity) {
13
+ const version = identity.version ? `v${identity.version}` : "unknown version";
14
+ return identity.path ? `${version} at ${identity.path}` : version;
15
+ }
16
+ /**
17
+ * Stamps `globalThis` with this copy's identity and warns if another
18
+ * copy of @prostojs/mate was already loaded.
19
+ *
20
+ * Invoked once at module scope from index.ts, so importing the package
21
+ * performs the check.
22
+ */
23
+ function warnOnDuplicateMate() {
24
+ const g = globalThis;
25
+ const identity = {};
26
+ identity.version = "0.4.0";
27
+ const path = getModulePath();
28
+ if (path) identity.path = path;
29
+ const first = g[MATE_MODULE_IDENTITY_KEY];
30
+ if (first) console.warn(`[mate] A second copy of @prostojs/mate was loaded (${formatIdentity(first)}, now ${formatIdentity(identity)}). Decorator metadata is stored per-copy and will NOT be visible across copies. Check your bundler/dedupe settings.`);
31
+ else g[MATE_MODULE_IDENTITY_KEY] = identity;
32
+ }
33
+
34
+ //#endregion
35
+ //#region src/utils/helpers.ts
36
+ function getConstructor(instance) {
37
+ return isConstructor(instance) ? instance : instance.constructor ? instance.constructor : Object.getPrototypeOf(instance).constructor;
38
+ }
39
+ function isConstructor(v) {
40
+ return typeof v === "function" && Object.getOwnPropertyDescriptor(v, "prototype") !== void 0 && Object.getOwnPropertyDescriptor(v, "caller") === void 0 && !!v.name;
41
+ }
42
+
43
+ //#endregion
44
+ //#region src/reflect.ts
45
+ let classMetadata = /* @__PURE__ */ new WeakMap();
46
+ let paramMetadata = /* @__PURE__ */ new WeakMap();
47
+ const root = typeof global === "object" ? global : typeof self === "object" ? self : {};
48
+ function getMetaObject(target, prop) {
49
+ const isParam = typeof prop !== "undefined";
50
+ const metadata = isParam ? paramMetadata : classMetadata;
51
+ const targetKey = getConstructor(target);
52
+ let meta = metadata.get(targetKey);
53
+ if (!meta) {
54
+ meta = {};
55
+ metadata.set(targetKey, meta);
56
+ }
57
+ if (isParam) meta = meta[prop] = meta[prop] || {};
58
+ return meta;
59
+ }
60
+ const _reflect = {
61
+ getOwnMetadata(key, target, prop) {
62
+ return getMetaObject(target, prop)[key];
63
+ },
64
+ defineMetadata(key, data, target, prop) {
65
+ const meta = getMetaObject(target, prop);
66
+ meta[key] = data;
67
+ },
68
+ metadata(key, data) {
69
+ return ((target, propKey) => {
70
+ Reflect$1.defineMetadata(key, data, target, propKey);
71
+ });
72
+ },
73
+ _cleanup: (() => {
74
+ classMetadata = /* @__PURE__ */ new WeakMap();
75
+ paramMetadata = /* @__PURE__ */ new WeakMap();
76
+ })
77
+ };
78
+ if (!root.Reflect) root.Reflect = _reflect;
79
+ else {
80
+ const funcs = [
81
+ "getOwnMetadata",
82
+ "defineMetadata",
83
+ "metadata"
84
+ ];
85
+ const target = root.Reflect;
86
+ for (const func of funcs) if (typeof target[func] !== "function") Object.defineProperty(target, func, {
87
+ configurable: true,
88
+ writable: true,
89
+ value: _reflect[func]
90
+ });
91
+ }
92
+ const Reflect$1 = _reflect;
93
+
94
+ //#endregion
95
+ //#region src/mate.ts
96
+ const Reflect = global?.Reflect || self?.Reflect || Reflect$1;
97
+ var Mate = class {
98
+ constructor(workspace, options = {}) {
99
+ this.workspace = workspace;
100
+ this.options = options;
101
+ this.logger = options.logger || console;
102
+ }
103
+ /**
104
+ * Cleanup function to reset metadata
105
+ *
106
+ * It is usefull in dev mode when server restarts
107
+ */
108
+ _cleanup() {
109
+ Reflect._cleanup?.call(Reflect);
110
+ this._readCache = void 0;
111
+ }
112
+ set(args, key, value, isArray) {
113
+ this._readCache = void 0;
114
+ let level = "CLASS";
115
+ const newArgs = args.level === "CLASS" ? { target: getConstructor(args.target) } : args.level === "PROP" ? {
116
+ target: args.target,
117
+ propKey: args.propKey
118
+ } : args;
119
+ let meta = Reflect.getOwnMetadata(this.workspace, newArgs.target, newArgs.propKey) || {};
120
+ if (newArgs.propKey && this.options.readReturnType && !meta.returnType && args.descriptor) meta.returnType = Reflect.getOwnMetadata("design:returntype", newArgs.target, newArgs.propKey);
121
+ if (newArgs.propKey && this.options.readType && !meta.type) meta.type = Reflect.getOwnMetadata("design:type", newArgs.target, newArgs.propKey);
122
+ const { index } = newArgs;
123
+ const cb = typeof key === "function" ? key : void 0;
124
+ let data = meta;
125
+ if (!data.params) {
126
+ const paramTypes = Reflect.getOwnMetadata("design:paramtypes", newArgs.target, newArgs.propKey);
127
+ if (paramTypes) {
128
+ data.params = new Array(paramTypes.length);
129
+ for (let i = 0; i < paramTypes.length; i++) data.params[i] = { type: paramTypes[i] };
130
+ }
131
+ }
132
+ if (typeof index === "number") {
133
+ level = "PARAM";
134
+ data.params = data.params || [];
135
+ data.params[index] = data.params[index] || { type: void 0 };
136
+ if (cb) data.params[index] = cb(data.params[index], level, args.propKey, typeof args.index === "number" ? args.index : void 0);
137
+ else data = data.params[index];
138
+ } else if (!index && !args.descriptor && args.propKey && this.options.collectPropKeys && args.level !== "CLASS") this.set({
139
+ ...args,
140
+ level: "CLASS"
141
+ }, (meta) => {
142
+ if (!meta.properties) meta.properties = [args.propKey];
143
+ else if (!meta.properties.includes(args.propKey)) meta.properties.push(args.propKey);
144
+ return meta;
145
+ });
146
+ level = typeof index === "number" ? "PARAM" : newArgs.propKey && newArgs.descriptor ? "METHOD" : newArgs.propKey ? "PROP" : "CLASS";
147
+ if (typeof key !== "function") if (isArray) {
148
+ const newArray = data[key] || [];
149
+ if (!Array.isArray(newArray))
150
+ /* istanbul ignore next line */
151
+ this.logger.error("Mate.add (isArray=true) called for non-array metadata");
152
+ newArray.unshift(value);
153
+ data[key] = newArray;
154
+ } else data[key] = value;
155
+ else if (cb && typeof index !== "number") meta = cb(data, level, args.propKey, typeof args.index === "number" ? args.index : void 0);
156
+ Reflect.defineMetadata(this.workspace, meta, newArgs.target, newArgs.propKey);
157
+ }
158
+ read(target, propKey) {
159
+ const constructor = isConstructor(target) ? target : getConstructor(target);
160
+ const proto = constructor.prototype;
161
+ const propKeyStr = propKey;
162
+ const ctorCache = this._readCache?.get(constructor);
163
+ if (ctorCache?.has(propKeyStr)) return ctorCache.get(propKeyStr);
164
+ let ownMeta = Reflect.getOwnMetadata(this.workspace, typeof propKey === "string" ? proto : constructor, propKey);
165
+ if (ownMeta && propKey === void 0 && ownMeta.params === void 0) {
166
+ const parent = Object.getPrototypeOf(constructor);
167
+ if (typeof parent === "function" && parent !== fnProto && parent !== constructor) ownMeta.params = this.read(parent)?.params;
168
+ }
169
+ if (this.options.inherit) {
170
+ const inheritFn = typeof this.options.inherit === "function" ? this.options.inherit : void 0;
171
+ let shouldInherit = this.options.inherit;
172
+ if (inheritFn) if (typeof propKey === "string") shouldInherit = inheritFn(Reflect.getOwnMetadata(this.workspace, constructor), ownMeta, "PROP", propKey);
173
+ else shouldInherit = inheritFn(ownMeta, ownMeta, "CLASS");
174
+ if (shouldInherit) {
175
+ const parent = Object.getPrototypeOf(constructor);
176
+ if (typeof parent === "function" && parent !== fnProto && parent !== constructor) {
177
+ const inheritedMeta = this.read(parent, propKey) || {};
178
+ const ownParams = ownMeta?.params;
179
+ ownMeta = {
180
+ ...inheritedMeta,
181
+ ...ownMeta
182
+ };
183
+ if (typeof propKey === "string" && ownParams && inheritedMeta?.params) {
184
+ for (let i = 0; i < ownParams.length; i++) if (typeof inheritedMeta?.params[i] !== "undefined") {
185
+ const ownParam = ownParams[i];
186
+ if (ownMeta.params && inheritFn && inheritFn(ownMeta, ownParam, "PARAM", typeof propKey === "string" ? propKey : void 0)) ownMeta.params[i] = {
187
+ ...inheritedMeta?.params[i],
188
+ ...ownParams[i]
189
+ };
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+ const cache = this._readCache ??= /* @__PURE__ */ new WeakMap();
196
+ let tc = cache.get(constructor);
197
+ if (!tc) {
198
+ tc = /* @__PURE__ */ new Map();
199
+ cache.set(constructor, tc);
200
+ }
201
+ tc.set(propKeyStr, ownMeta);
202
+ return ownMeta;
203
+ }
204
+ apply(...decorators) {
205
+ return ((target, propKey, descriptor) => {
206
+ for (const d of decorators) d(target, propKey, descriptor);
207
+ });
208
+ }
209
+ decorate(key, value, isArray, level) {
210
+ return ((target, propKey, descriptor) => {
211
+ const args = {
212
+ target,
213
+ propKey,
214
+ descriptor: typeof descriptor === "number" ? void 0 : descriptor,
215
+ index: typeof descriptor === "number" ? descriptor : void 0,
216
+ level
217
+ };
218
+ this.set(args, key, value, isArray);
219
+ });
220
+ }
221
+ decorateConditional(ccb) {
222
+ return ((target, propKey, descriptor) => {
223
+ const d = ccb(typeof descriptor === "number" ? "PARAM" : propKey && descriptor ? "METHOD" : propKey ? "PROP" : "CLASS");
224
+ if (d) d(target, propKey, descriptor);
225
+ });
226
+ }
227
+ decorateClass(key, value, isArray) {
228
+ return this.decorate(key, value, isArray, "CLASS");
229
+ }
230
+ };
231
+ const fnProto = Object.getPrototypeOf(Function);
232
+
233
+ //#endregion
234
+ //#region src/index.ts
235
+ warnOnDuplicateMate();
236
+
237
+ //#endregion
238
+ exports.MATE_MODULE_IDENTITY_KEY = MATE_MODULE_IDENTITY_KEY;
239
+ exports.Mate = Mate;
240
+ exports.getConstructor = getConstructor;
241
+ exports.isConstructor = isConstructor;
242
+ exports.warnOnDuplicateMate = warnOnDuplicateMate;
@@ -0,0 +1,102 @@
1
+ //#region dts-build/types.d.ts
2
+ type TAny = any;
3
+ type TObject = object;
4
+ type TFunction = Function;
5
+ type TClassConstructor<T = unknown> = new (...args: TAny[]) => T;
6
+ //#endregion
7
+ //#region dts-build/mate.d.ts
8
+ type TLevels = 'CLASS' | 'METHOD' | 'PROP' | 'PARAM';
9
+ interface TMergedDecoratorArgs {
10
+ target: TFunction | TObject;
11
+ propKey?: string;
12
+ descriptor?: TypedPropertyDescriptor<TAny>;
13
+ index?: number;
14
+ level?: TLevels;
15
+ }
16
+ interface TMateParamMeta {
17
+ type?: TFunction;
18
+ }
19
+ interface TMatePropMeta<TParam extends TObject = TEmpty> {
20
+ params?: (TParam & TMateParamMeta)[];
21
+ }
22
+ interface TMateClassMeta<TParam> {
23
+ properties?: string[];
24
+ type?: TFunction;
25
+ returnType?: TFunction;
26
+ params?: (TParam & TMateParamMeta)[];
27
+ }
28
+ type TCommonMate<TParam extends TObject> = TMateClassMeta<TParam> & TMatePropMeta<TParam>;
29
+ type TCommonMateWithParam<TParam extends TObject> = TMateClassMeta<TParam> & TMatePropMeta<TParam> & TParam;
30
+ interface TConsoleBase {
31
+ error: (...args: any) => void;
32
+ }
33
+ interface TMateOptions<TClass extends TObject = TMateClassMeta<TMateParamMeta>, TProp extends {
34
+ params: TMateParamMeta[];
35
+ } = Required<TMatePropMeta<TMateParamMeta>>> {
36
+ logger?: TConsoleBase;
37
+ readReturnType?: boolean;
38
+ readType?: boolean;
39
+ collectPropKeys?: boolean;
40
+ inherit?: boolean | ((classMeta: TClass & TMateClassMeta<TMateParamMeta>, targetMeta: (TMatePropMeta<TProp['params'][0]> & TProp) | (TMateParamMeta & TProp['params'][0]), level: 'CLASS' | 'PROP' | 'PARAM', key?: string) => boolean);
41
+ }
42
+ interface TEmpty {}
43
+ declare class Mate<TClass extends TObject = TMateClassMeta<TMateParamMeta>, TProp extends {
44
+ params: TMateParamMeta[];
45
+ } = Required<TMatePropMeta<TMateParamMeta>>> {
46
+ protected workspace: string;
47
+ protected options: TMateOptions<TClass, TProp>;
48
+ protected logger: TConsoleBase;
49
+ protected _readCache?: WeakMap<object, Map<string | undefined, unknown>>;
50
+ constructor(workspace: string, options?: TMateOptions<TClass, TProp>);
51
+ /**
52
+ * Cleanup function to reset metadata
53
+ *
54
+ * It is usefull in dev mode when server restarts
55
+ */
56
+ _cleanup(): void;
57
+ set<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>>(args: TMergedDecoratorArgs, cb: (meta: T, level: TLevels, propKey?: string, index?: number) => T): void;
58
+ set<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>, K extends keyof T = keyof T>(args: TMergedDecoratorArgs, key: keyof T, value: T[K]): void;
59
+ set<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>, K extends keyof T = keyof T>(args: TMergedDecoratorArgs, key: keyof T, value: T[K], isArray: boolean | undefined): void;
60
+ read<PK>(target: TFunction | TObject, propKey?: PK): PK extends string ? (TClass & TProp & TCommonMate<TProp['params'][0]>) | undefined : TClass | undefined;
61
+ apply(...decorators: (MethodDecorator | ClassDecorator | ParameterDecorator | PropertyDecorator)[]): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
62
+ decorate<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>>(cb: (meta: T, level: TLevels, propKey?: string, index?: number) => T): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
63
+ decorate<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>, K extends keyof T = keyof T>(key: K, value: T[K]): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
64
+ decorate<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>, K extends keyof T = keyof T, TIsArray extends boolean = false>(key: K, value: TIsArray extends true ? ArrayElementType<T[K]> : T[K], isArray: TIsArray): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
65
+ decorate<T = TClass & TProp & TCommonMateWithParam<TProp['params'][0]>, K extends keyof T = keyof T, TIsArray extends boolean = false>(key: K | ((meta: T, level: TLevels, propKey?: string, index?: number) => T), value: TIsArray extends true ? ArrayElementType<T[K]> : T[K], isArray: TIsArray, level: TMergedDecoratorArgs['level']): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
66
+ decorateConditional(ccb: (level: TLevels) => (MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator) | void | undefined): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
67
+ decorateClass<T = TClass>(cb: (meta: T, level: TLevels, propKey?: string, index?: number) => T): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
68
+ decorateClass<T = TClass, K extends keyof T = keyof T, TIsArray extends boolean = false>(key: K, value: TIsArray extends true ? ArrayElementType<T[K]> : T[K]): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
69
+ decorateClass<T = TClass, K extends keyof T = keyof T, TIsArray extends boolean = false>(key: K, value: TIsArray extends true ? ArrayElementType<T[K]> : T[K], isArray: boolean | undefined): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
70
+ }
71
+ type ArrayElementType<T> = T extends (infer E)[] ? E : never;
72
+ //#endregion
73
+ //#region dts-build/module-identity.d.ts
74
+ /**
75
+ * Duplicate-copy detection for @prostojs/mate
76
+ *
77
+ * Mate stores class metadata in WeakMaps keyed by constructor reference.
78
+ * If a bundler loads two copies of mate (or of a decorated class),
79
+ * decorators run against one copy while lookups hit the other, and
80
+ * metadata silently "disappears". The first loaded copy stamps
81
+ * `globalThis` under a global symbol; any subsequent copy finds the
82
+ * stamp and warns.
83
+ */
84
+ interface TMateModuleIdentity {
85
+ version?: string;
86
+ path?: string;
87
+ }
88
+ declare const MATE_MODULE_IDENTITY_KEY: unique symbol;
89
+ /**
90
+ * Stamps `globalThis` with this copy's identity and warns if another
91
+ * copy of @prostojs/mate was already loaded.
92
+ *
93
+ * Invoked once at module scope from index.ts, so importing the package
94
+ * performs the check.
95
+ */
96
+ declare function warnOnDuplicateMate(): void;
97
+ //#endregion
98
+ //#region dts-build/utils/helpers.d.ts
99
+ declare function getConstructor<T = TAny>(instance: T): TFunction;
100
+ declare function isConstructor<T = TAny>(v: T): v is T & TClassConstructor;
101
+ //#endregion
102
+ export { MATE_MODULE_IDENTITY_KEY, Mate, TMateClassMeta, TMateModuleIdentity, TMateOptions, TMateParamMeta, TMatePropMeta, TMergedDecoratorArgs, getConstructor, isConstructor, warnOnDuplicateMate };