@formspec/build 0.1.0-alpha.7 → 0.1.0-alpha.9
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 +14 -14
- package/dist/__tests__/analyzer-edge-cases.test.d.ts +13 -0
- package/dist/__tests__/analyzer-edge-cases.test.d.ts.map +1 -0
- package/dist/__tests__/analyzer-edge-cases.test.js +376 -0
- package/dist/__tests__/analyzer-edge-cases.test.js.map +1 -0
- package/dist/__tests__/analyzer.test.d.ts +5 -0
- package/dist/__tests__/analyzer.test.d.ts.map +1 -0
- package/dist/__tests__/analyzer.test.js +190 -0
- package/dist/__tests__/analyzer.test.js.map +1 -0
- package/dist/__tests__/cli.test.js.map +1 -1
- package/dist/__tests__/codegen.test.d.ts +5 -0
- package/dist/__tests__/codegen.test.d.ts.map +1 -0
- package/dist/__tests__/codegen.test.js +506 -0
- package/dist/__tests__/codegen.test.js.map +1 -0
- package/dist/__tests__/decorator-pipeline.test.d.ts +11 -0
- package/dist/__tests__/decorator-pipeline.test.d.ts.map +1 -0
- package/dist/__tests__/decorator-pipeline.test.js +460 -0
- package/dist/__tests__/decorator-pipeline.test.js.map +1 -0
- package/dist/__tests__/edge-cases.test.js +2 -4
- package/dist/__tests__/edge-cases.test.js.map +1 -1
- package/dist/__tests__/fixtures/edge-cases.d.ts +110 -0
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +1 -0
- package/dist/__tests__/fixtures/edge-cases.js +137 -0
- package/dist/__tests__/fixtures/edge-cases.js.map +1 -0
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +12 -0
- package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-a-builtins.js +100 -0
- package/dist/__tests__/fixtures/example-a-builtins.js.map +1 -0
- package/dist/__tests__/fixtures/example-b-decorators.d.ts +5 -0
- package/dist/__tests__/fixtures/example-b-decorators.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-b-decorators.js +5 -0
- package/dist/__tests__/fixtures/example-b-decorators.js.map +1 -0
- package/dist/__tests__/fixtures/example-b-extended.d.ts +5 -0
- package/dist/__tests__/fixtures/example-b-extended.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-b-extended.js +60 -0
- package/dist/__tests__/fixtures/example-b-extended.js.map +1 -0
- package/dist/__tests__/fixtures/example-c-custom.d.ts +5 -0
- package/dist/__tests__/fixtures/example-c-custom.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-c-custom.js +61 -0
- package/dist/__tests__/fixtures/example-c-custom.js.map +1 -0
- package/dist/__tests__/fixtures/example-c-decorators.d.ts +5 -0
- package/dist/__tests__/fixtures/example-c-decorators.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-c-decorators.js +4 -0
- package/dist/__tests__/fixtures/example-c-decorators.js.map +1 -0
- package/dist/__tests__/fixtures/example-d-mixed-decorators.d.ts +6 -0
- package/dist/__tests__/fixtures/example-d-mixed-decorators.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-d-mixed-decorators.js +75 -0
- package/dist/__tests__/fixtures/example-d-mixed-decorators.js.map +1 -0
- package/dist/__tests__/fixtures/example-e-decorators.d.ts +11 -0
- package/dist/__tests__/fixtures/example-e-decorators.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-e-decorators.js +10 -0
- package/dist/__tests__/fixtures/example-e-decorators.js.map +1 -0
- package/dist/__tests__/fixtures/example-e-no-namespace.d.ts +5 -0
- package/dist/__tests__/fixtures/example-e-no-namespace.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-e-no-namespace.js +61 -0
- package/dist/__tests__/fixtures/example-e-no-namespace.js.map +1 -0
- package/dist/__tests__/fixtures/example-jsdoc-constraints.d.ts +16 -0
- package/dist/__tests__/fixtures/example-jsdoc-constraints.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-jsdoc-constraints.js +98 -0
- package/dist/__tests__/fixtures/example-jsdoc-constraints.js.map +1 -0
- package/dist/__tests__/fixtures/example-nested-class.d.ts +45 -0
- package/dist/__tests__/fixtures/example-nested-class.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-nested-class.js +248 -0
- package/dist/__tests__/fixtures/example-nested-class.js.map +1 -0
- package/dist/__tests__/fixtures/sample-forms.d.ts +55 -0
- package/dist/__tests__/fixtures/sample-forms.d.ts.map +1 -0
- package/dist/__tests__/fixtures/sample-forms.js +78 -0
- package/dist/__tests__/fixtures/sample-forms.js.map +1 -0
- package/dist/__tests__/generator.test.js +6 -6
- package/dist/__tests__/generator.test.js.map +1 -1
- package/dist/__tests__/integration.test.js +1 -3
- package/dist/__tests__/integration.test.js.map +1 -1
- package/dist/__tests__/jsdoc-constraints.test.d.ts +10 -0
- package/dist/__tests__/jsdoc-constraints.test.d.ts.map +1 -0
- package/dist/__tests__/jsdoc-constraints.test.js +199 -0
- package/dist/__tests__/jsdoc-constraints.test.js.map +1 -0
- package/dist/__tests__/write-schemas.test.js +10 -8
- package/dist/__tests__/write-schemas.test.js.map +1 -1
- package/dist/analyzer/class-analyzer.d.ts +85 -0
- package/dist/analyzer/class-analyzer.d.ts.map +1 -0
- package/dist/analyzer/class-analyzer.js +215 -0
- package/dist/analyzer/class-analyzer.js.map +1 -0
- package/dist/analyzer/decorator-extractor.d.ts +78 -0
- package/dist/analyzer/decorator-extractor.d.ts.map +1 -0
- package/dist/analyzer/decorator-extractor.js +336 -0
- package/dist/analyzer/decorator-extractor.js.map +1 -0
- package/dist/analyzer/jsdoc-constraints.d.ts +27 -0
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -0
- package/dist/analyzer/jsdoc-constraints.js +91 -0
- package/dist/analyzer/jsdoc-constraints.js.map +1 -0
- package/dist/analyzer/program.d.ts +37 -0
- package/dist/analyzer/program.d.ts.map +1 -0
- package/dist/analyzer/program.js +87 -0
- package/dist/analyzer/program.js.map +1 -0
- package/dist/analyzer/type-converter.d.ts +75 -0
- package/dist/analyzer/type-converter.d.ts.map +1 -0
- package/dist/analyzer/type-converter.js +436 -0
- package/dist/analyzer/type-converter.js.map +1 -0
- package/dist/browser.d.ts +3 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -0
- package/dist/browser.js.map +1 -1
- package/dist/build.d.ts +196 -2
- package/dist/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/codegen/index.d.ts +75 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +597 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/generators/class-schema.d.ts +84 -0
- package/dist/generators/class-schema.d.ts.map +1 -0
- package/dist/generators/class-schema.js +91 -0
- package/dist/generators/class-schema.js.map +1 -0
- package/dist/generators/method-schema.d.ts +67 -0
- package/dist/generators/method-schema.d.ts.map +1 -0
- package/dist/generators/method-schema.js +108 -0
- package/dist/generators/method-schema.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +19 -0
- package/dist/internals.d.ts.map +1 -0
- package/dist/internals.js +22 -0
- package/dist/internals.js.map +1 -0
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/generator.js +2 -3
- package/dist/json-schema/generator.js.map +1 -1
- package/dist/json-schema/types.d.ts +28 -0
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/json-schema/types.js +27 -1
- package/dist/json-schema/types.js.map +1 -1
- package/dist/ui-schema/generator.d.ts.map +1 -1
- package/dist/ui-schema/generator.js +1 -3
- package/dist/ui-schema/generator.js.map +1 -1
- package/dist/ui-schema/types.d.ts.map +1 -1
- package/package.json +11 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Field, Minimum } from "@formspec/decorators";
|
|
36
|
+
/**
|
|
37
|
+
* Simulates a non-FormSpec decorator (e.g., from class-validator, typeorm, etc.).
|
|
38
|
+
* The pipeline should silently ignore it.
|
|
39
|
+
*/
|
|
40
|
+
function ExternalValidator(_message) {
|
|
41
|
+
return (_value, _context) => {
|
|
42
|
+
// no-op
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
let ExampleDForm = (() => {
|
|
46
|
+
let _username_decorators;
|
|
47
|
+
let _username_initializers = [];
|
|
48
|
+
let _username_extraInitializers = [];
|
|
49
|
+
let _score_decorators;
|
|
50
|
+
let _score_initializers = [];
|
|
51
|
+
let _score_extraInitializers = [];
|
|
52
|
+
let _plain_decorators;
|
|
53
|
+
let _plain_initializers = [];
|
|
54
|
+
let _plain_extraInitializers = [];
|
|
55
|
+
return class ExampleDForm {
|
|
56
|
+
static {
|
|
57
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
58
|
+
_username_decorators = [ExternalValidator("must be a valid name"), Field({ displayName: "Username" })];
|
|
59
|
+
_score_decorators = [Minimum(0), ExternalValidator("must be positive")];
|
|
60
|
+
_plain_decorators = [ExternalValidator("required field")];
|
|
61
|
+
__esDecorate(null, null, _username_decorators, { kind: "field", name: "username", static: false, private: false, access: { has: obj => "username" in obj, get: obj => obj.username, set: (obj, value) => { obj.username = value; } }, metadata: _metadata }, _username_initializers, _username_extraInitializers);
|
|
62
|
+
__esDecorate(null, null, _score_decorators, { kind: "field", name: "score", static: false, private: false, access: { has: obj => "score" in obj, get: obj => obj.score, set: (obj, value) => { obj.score = value; } }, metadata: _metadata }, _score_initializers, _score_extraInitializers);
|
|
63
|
+
__esDecorate(null, null, _plain_decorators, { kind: "field", name: "plain", static: false, private: false, access: { has: obj => "plain" in obj, get: obj => obj.plain, set: (obj, value) => { obj.plain = value; } }, metadata: _metadata }, _plain_initializers, _plain_extraInitializers);
|
|
64
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
65
|
+
}
|
|
66
|
+
username = __runInitializers(this, _username_initializers, void 0);
|
|
67
|
+
score = (__runInitializers(this, _username_extraInitializers), __runInitializers(this, _score_initializers, void 0));
|
|
68
|
+
plain = (__runInitializers(this, _score_extraInitializers), __runInitializers(this, _plain_initializers, void 0));
|
|
69
|
+
constructor() {
|
|
70
|
+
__runInitializers(this, _plain_extraInitializers);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
})();
|
|
74
|
+
export { ExampleDForm };
|
|
75
|
+
//# sourceMappingURL=example-d-mixed-decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-d-mixed-decorators.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-d-mixed-decorators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;GAGG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,CAAC,MAAiB,EAAE,QAAoC,EAAQ,EAAE;QACvE,QAAQ;IACV,CAAC,CAAC;AACJ,CAAC;IAEY,YAAY;;;;;;;;;;iBAAZ,YAAY;;;oCACtB,iBAAiB,CAAC,sBAAsB,CAAC,EACzC,KAAK,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;iCAGlC,OAAO,CAAC,CAAC,CAAC,EACV,iBAAiB,CAAC,kBAAkB,CAAC;iCAGrC,iBAAiB,CAAC,gBAAgB,CAAC;YANpC,0KAAA,QAAQ,6BAAR,QAAQ,2FAAU;YAIlB,iKAAA,KAAK,6BAAL,KAAK,qFAAU;YAGf,iKAAA,KAAK,6BAAL,KAAK,qFAAU;;;QAPf,QAAQ,2DAAU;QAIlB,KAAK,gHAAU;QAGf,KAAK,6GAAU;;;;;;SAVJ,YAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom decorator created without an extension namespace.
|
|
3
|
+
* The `customDecorator()` no-arg overload produces decorators
|
|
4
|
+
* that are recognized as FormSpec but have no extensionName,
|
|
5
|
+
* so no x-formspec-* keys should be emitted.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Highlight: ((value: undefined, context: ClassFieldDecoratorContext) => void) & import("@formspec/decorators").FormSpecMarkerBrand;
|
|
8
|
+
export declare const Metadata: (_args: {
|
|
9
|
+
key: string;
|
|
10
|
+
}) => (value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
11
|
+
//# sourceMappingURL=example-e-decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-e-decorators.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-e-decorators.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,SAAS,wHAAwC,CAAC;AAC/D,eAAO,MAAM,QAAQ;SAA+B,MAAM;qEAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { customDecorator } from "@formspec/decorators";
|
|
2
|
+
/**
|
|
3
|
+
* Custom decorator created without an extension namespace.
|
|
4
|
+
* The `customDecorator()` no-arg overload produces decorators
|
|
5
|
+
* that are recognized as FormSpec but have no extensionName,
|
|
6
|
+
* so no x-formspec-* keys should be emitted.
|
|
7
|
+
*/
|
|
8
|
+
export const Highlight = customDecorator().marker("Highlight");
|
|
9
|
+
export const Metadata = customDecorator().as("Metadata");
|
|
10
|
+
//# sourceMappingURL=example-e-decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-e-decorators.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-e-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC,EAAE,CAAkB,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-e-no-namespace.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-e-no-namespace.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAGvB,KAAK,EAAG,MAAM,CAAC;IAIf,KAAK,EAAG,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Field } from "@formspec/decorators";
|
|
36
|
+
import { Highlight, Metadata } from "./example-e-decorators.js";
|
|
37
|
+
let ExampleEForm = (() => {
|
|
38
|
+
let _title_decorators;
|
|
39
|
+
let _title_initializers = [];
|
|
40
|
+
let _title_extraInitializers = [];
|
|
41
|
+
let _notes_decorators;
|
|
42
|
+
let _notes_initializers = [];
|
|
43
|
+
let _notes_extraInitializers = [];
|
|
44
|
+
return class ExampleEForm {
|
|
45
|
+
static {
|
|
46
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
47
|
+
_title_decorators = [Highlight, Field({ displayName: "Featured Title" })];
|
|
48
|
+
_notes_decorators = [Metadata({ key: "priority" }), Field({ displayName: "Notes" })];
|
|
49
|
+
__esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
50
|
+
__esDecorate(null, null, _notes_decorators, { kind: "field", name: "notes", static: false, private: false, access: { has: obj => "notes" in obj, get: obj => obj.notes, set: (obj, value) => { obj.notes = value; } }, metadata: _metadata }, _notes_initializers, _notes_extraInitializers);
|
|
51
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
}
|
|
53
|
+
title = __runInitializers(this, _title_initializers, void 0);
|
|
54
|
+
notes = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _notes_initializers, void 0));
|
|
55
|
+
constructor() {
|
|
56
|
+
__runInitializers(this, _notes_extraInitializers);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
})();
|
|
60
|
+
export { ExampleEForm };
|
|
61
|
+
//# sourceMappingURL=example-e-no-namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-e-no-namespace.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-e-no-namespace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;IAEnD,YAAY;;;;;;;iBAAZ,YAAY;;;iCACtB,SAAS,EACT,KAAK,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;iCAGxC,QAAQ,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAC7B,KAAK,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;YAHhC,iKAAA,KAAK,6BAAL,KAAK,qFAAU;YAIf,iKAAA,KAAK,6BAAL,KAAK,qFAAU;;;QAJf,KAAK,wDAAU;QAIf,KAAK,6GAAU;;;;;;SAPJ,YAAY"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class JSDocConstraintsForm {
|
|
2
|
+
/** @MinLength 1 @MaxLength 200 */
|
|
3
|
+
name: string;
|
|
4
|
+
/** @Minimum 0 @Maximum 150 */
|
|
5
|
+
age: number;
|
|
6
|
+
/** @Minimum 0.01 @Maximum 1000 */
|
|
7
|
+
weight: number;
|
|
8
|
+
/** @Minimum -273.15 */
|
|
9
|
+
temperature: number;
|
|
10
|
+
/** @Pattern ^[A-Z]{3}-\d{4}$ */
|
|
11
|
+
sku: string;
|
|
12
|
+
/** @ExclusiveMaximum 10000 */
|
|
13
|
+
stock: number;
|
|
14
|
+
notes?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=example-jsdoc-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-jsdoc-constraints.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-jsdoc-constraints.ts"],"names":[],"mappings":"AAEA,qBAAa,oBAAoB;IAC/B,kCAAkC;IAElC,IAAI,EAAG,MAAM,CAAC;IAEd,8BAA8B;IAE9B,GAAG,EAAG,MAAM,CAAC;IAEb,kCAAkC;IAElC,MAAM,EAAG,MAAM,CAAC;IAEhB,uBAAuB;IAEvB,WAAW,EAAG,MAAM,CAAC;IAErB,gCAAgC;IAEhC,GAAG,EAAG,MAAM,CAAC;IAGb,8BAA8B;IAG9B,KAAK,EAAG,MAAM,CAAC;IAIf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Field, Minimum } from "@formspec/decorators";
|
|
36
|
+
let JSDocConstraintsForm = (() => {
|
|
37
|
+
let _name_decorators;
|
|
38
|
+
let _name_initializers = [];
|
|
39
|
+
let _name_extraInitializers = [];
|
|
40
|
+
let _age_decorators;
|
|
41
|
+
let _age_initializers = [];
|
|
42
|
+
let _age_extraInitializers = [];
|
|
43
|
+
let _weight_decorators;
|
|
44
|
+
let _weight_initializers = [];
|
|
45
|
+
let _weight_extraInitializers = [];
|
|
46
|
+
let _temperature_decorators;
|
|
47
|
+
let _temperature_initializers = [];
|
|
48
|
+
let _temperature_extraInitializers = [];
|
|
49
|
+
let _sku_decorators;
|
|
50
|
+
let _sku_initializers = [];
|
|
51
|
+
let _sku_extraInitializers = [];
|
|
52
|
+
let _stock_decorators;
|
|
53
|
+
let _stock_initializers = [];
|
|
54
|
+
let _stock_extraInitializers = [];
|
|
55
|
+
let _notes_decorators;
|
|
56
|
+
let _notes_initializers = [];
|
|
57
|
+
let _notes_extraInitializers = [];
|
|
58
|
+
return class JSDocConstraintsForm {
|
|
59
|
+
static {
|
|
60
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
61
|
+
_name_decorators = [Field({ displayName: "Name" })];
|
|
62
|
+
_age_decorators = [Field({ displayName: "Age" })];
|
|
63
|
+
_weight_decorators = [Field({ displayName: "Weight" })];
|
|
64
|
+
_temperature_decorators = [Field({ displayName: "Temperature" })];
|
|
65
|
+
_sku_decorators = [Field({ displayName: "SKU" })];
|
|
66
|
+
_stock_decorators = [Field({ displayName: "Stock" }), Minimum(0)];
|
|
67
|
+
_notes_decorators = [Field({ displayName: "Notes" })];
|
|
68
|
+
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
69
|
+
__esDecorate(null, null, _age_decorators, { kind: "field", name: "age", static: false, private: false, access: { has: obj => "age" in obj, get: obj => obj.age, set: (obj, value) => { obj.age = value; } }, metadata: _metadata }, _age_initializers, _age_extraInitializers);
|
|
70
|
+
__esDecorate(null, null, _weight_decorators, { kind: "field", name: "weight", static: false, private: false, access: { has: obj => "weight" in obj, get: obj => obj.weight, set: (obj, value) => { obj.weight = value; } }, metadata: _metadata }, _weight_initializers, _weight_extraInitializers);
|
|
71
|
+
__esDecorate(null, null, _temperature_decorators, { kind: "field", name: "temperature", static: false, private: false, access: { has: obj => "temperature" in obj, get: obj => obj.temperature, set: (obj, value) => { obj.temperature = value; } }, metadata: _metadata }, _temperature_initializers, _temperature_extraInitializers);
|
|
72
|
+
__esDecorate(null, null, _sku_decorators, { kind: "field", name: "sku", static: false, private: false, access: { has: obj => "sku" in obj, get: obj => obj.sku, set: (obj, value) => { obj.sku = value; } }, metadata: _metadata }, _sku_initializers, _sku_extraInitializers);
|
|
73
|
+
__esDecorate(null, null, _stock_decorators, { kind: "field", name: "stock", static: false, private: false, access: { has: obj => "stock" in obj, get: obj => obj.stock, set: (obj, value) => { obj.stock = value; } }, metadata: _metadata }, _stock_initializers, _stock_extraInitializers);
|
|
74
|
+
__esDecorate(null, null, _notes_decorators, { kind: "field", name: "notes", static: false, private: false, access: { has: obj => "notes" in obj, get: obj => obj.notes, set: (obj, value) => { obj.notes = value; } }, metadata: _metadata }, _notes_initializers, _notes_extraInitializers);
|
|
75
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
76
|
+
}
|
|
77
|
+
/** @MinLength 1 @MaxLength 200 */
|
|
78
|
+
name = __runInitializers(this, _name_initializers, void 0);
|
|
79
|
+
/** @Minimum 0 @Maximum 150 */
|
|
80
|
+
age = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _age_initializers, void 0));
|
|
81
|
+
/** @Minimum 0.01 @Maximum 1000 */
|
|
82
|
+
weight = (__runInitializers(this, _age_extraInitializers), __runInitializers(this, _weight_initializers, void 0));
|
|
83
|
+
/** @Minimum -273.15 */
|
|
84
|
+
temperature = (__runInitializers(this, _weight_extraInitializers), __runInitializers(this, _temperature_initializers, void 0));
|
|
85
|
+
/** @Pattern ^[A-Z]{3}-\d{4}$ */
|
|
86
|
+
sku = (__runInitializers(this, _temperature_extraInitializers), __runInitializers(this, _sku_initializers, void 0));
|
|
87
|
+
// Cross-source: decorator for one, JSDoc for another
|
|
88
|
+
/** @ExclusiveMaximum 10000 */
|
|
89
|
+
stock = (__runInitializers(this, _sku_extraInitializers), __runInitializers(this, _stock_initializers, void 0));
|
|
90
|
+
// No constraints
|
|
91
|
+
notes = (__runInitializers(this, _stock_extraInitializers), __runInitializers(this, _notes_initializers, void 0));
|
|
92
|
+
constructor() {
|
|
93
|
+
__runInitializers(this, _notes_extraInitializers);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
})();
|
|
97
|
+
export { JSDocConstraintsForm };
|
|
98
|
+
//# sourceMappingURL=example-jsdoc-constraints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-jsdoc-constraints.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-jsdoc-constraints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;IAEzC,oBAAoB;;;;;;;;;;;;;;;;;;;;;;iBAApB,oBAAoB;;;gCAE9B,KAAK,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;+BAI9B,KAAK,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;kCAI7B,KAAK,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;uCAIhC,KAAK,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;+BAIrC,KAAK,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;iCAK7B,KAAK,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAC/B,OAAO,CAAC,CAAC,CAAC;iCAIV,KAAK,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;YAzBhC,8JAAA,IAAI,6BAAJ,IAAI,mFAAU;YAId,2JAAA,GAAG,6BAAH,GAAG,iFAAU;YAIb,oKAAA,MAAM,6BAAN,MAAM,uFAAU;YAIhB,mLAAA,WAAW,6BAAX,WAAW,iGAAU;YAIrB,2JAAA,GAAG,6BAAH,GAAG,iFAAU;YAMb,iKAAA,KAAK,6BAAL,KAAK,qFAAU;YAIf,iKAAA,KAAK,6BAAL,KAAK,qFAAU;;;QA5Bf,kCAAkC;QAElC,IAAI,uDAAU;QAEd,8BAA8B;QAE9B,GAAG,0GAAU;QAEb,kCAAkC;QAElC,MAAM,4GAAU;QAEhB,uBAAuB;QAEvB,WAAW,oHAAU;QAErB,gCAAgC;QAEhC,GAAG,iHAAU;QAEb,qDAAqD;QACrD,8BAA8B;QAG9B,KAAK,2GAAU;QAEf,iBAAiB;QAEjB,KAAK,6GAAU;;;;;;SA7BJ,oBAAoB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare class Address {
|
|
2
|
+
street: string;
|
|
3
|
+
city: string;
|
|
4
|
+
zip?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class Dimensions {
|
|
7
|
+
/** @Minimum 0 @Maximum 10000 */
|
|
8
|
+
width: number;
|
|
9
|
+
/** @Minimum 0 @Maximum 10000 */
|
|
10
|
+
height: number;
|
|
11
|
+
/** @Minimum 0 */
|
|
12
|
+
depth: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class UserWithAddress {
|
|
15
|
+
username: string;
|
|
16
|
+
address: Address;
|
|
17
|
+
}
|
|
18
|
+
export declare class ProductWithDimensions {
|
|
19
|
+
name: string;
|
|
20
|
+
dimensions: Dimensions;
|
|
21
|
+
}
|
|
22
|
+
export declare class Customer {
|
|
23
|
+
name: string;
|
|
24
|
+
address: Address;
|
|
25
|
+
}
|
|
26
|
+
export declare class Order {
|
|
27
|
+
orderId: string;
|
|
28
|
+
customer: Customer;
|
|
29
|
+
}
|
|
30
|
+
export declare class NodeA {
|
|
31
|
+
name: string;
|
|
32
|
+
sibling?: NodeB;
|
|
33
|
+
}
|
|
34
|
+
export declare class NodeB {
|
|
35
|
+
label: string;
|
|
36
|
+
sibling?: NodeA;
|
|
37
|
+
}
|
|
38
|
+
export declare class WithInlineObject {
|
|
39
|
+
title: string;
|
|
40
|
+
metadata: {
|
|
41
|
+
key: string;
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=example-nested-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-nested-class.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-nested-class.ts"],"names":[],"mappings":"AAIA,qBAAa,OAAO;IAIlB,MAAM,EAAG,MAAM,CAAC;IAIhB,IAAI,EAAG,MAAM,CAAC;IAId,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,UAAU;IACrB,gCAAgC;IAEhC,KAAK,EAAG,MAAM,CAAC;IAEf,gCAAgC;IAEhC,MAAM,EAAG,MAAM,CAAC;IAEhB,iBAAiB;IAEjB,KAAK,EAAG,MAAM,CAAC;CAChB;AAID,qBAAa,eAAe;IAG1B,QAAQ,EAAG,MAAM,CAAC;IAGlB,OAAO,EAAG,OAAO,CAAC;CACnB;AAED,qBAAa,qBAAqB;IAEhC,IAAI,EAAG,MAAM,CAAC;IAGd,UAAU,EAAG,UAAU,CAAC;CACzB;AAID,qBAAa,QAAQ;IAGnB,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,EAAG,OAAO,CAAC;CACnB;AAED,qBAAa,KAAK;IAEhB,OAAO,EAAG,MAAM,CAAC;IAGjB,QAAQ,EAAG,QAAQ,CAAC;CACrB;AAID,qBAAa,KAAK;IAGhB,IAAI,EAAG,MAAM,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,qBAAa,KAAK;IAEhB,KAAK,EAAG,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAID,qBAAa,gBAAgB;IAE3B,KAAK,EAAG,MAAM,CAAC;IAEf,QAAQ,EAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Field, MinLength, MaxLength, Pattern } from "@formspec/decorators";
|
|
36
|
+
// --- Leaf classes ---
|
|
37
|
+
let Address = (() => {
|
|
38
|
+
let _street_decorators;
|
|
39
|
+
let _street_initializers = [];
|
|
40
|
+
let _street_extraInitializers = [];
|
|
41
|
+
let _city_decorators;
|
|
42
|
+
let _city_initializers = [];
|
|
43
|
+
let _city_extraInitializers = [];
|
|
44
|
+
let _zip_decorators;
|
|
45
|
+
let _zip_initializers = [];
|
|
46
|
+
let _zip_extraInitializers = [];
|
|
47
|
+
return class Address {
|
|
48
|
+
static {
|
|
49
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
50
|
+
_street_decorators = [Field({ displayName: "Street" }), MinLength(1), MaxLength(200)];
|
|
51
|
+
_city_decorators = [Field({ displayName: "City" }), MinLength(1)];
|
|
52
|
+
_zip_decorators = [Field({ displayName: "Zip Code" }), Pattern("^\\d{5}(-\\d{4})?$")];
|
|
53
|
+
__esDecorate(null, null, _street_decorators, { kind: "field", name: "street", static: false, private: false, access: { has: obj => "street" in obj, get: obj => obj.street, set: (obj, value) => { obj.street = value; } }, metadata: _metadata }, _street_initializers, _street_extraInitializers);
|
|
54
|
+
__esDecorate(null, null, _city_decorators, { kind: "field", name: "city", static: false, private: false, access: { has: obj => "city" in obj, get: obj => obj.city, set: (obj, value) => { obj.city = value; } }, metadata: _metadata }, _city_initializers, _city_extraInitializers);
|
|
55
|
+
__esDecorate(null, null, _zip_decorators, { kind: "field", name: "zip", static: false, private: false, access: { has: obj => "zip" in obj, get: obj => obj.zip, set: (obj, value) => { obj.zip = value; } }, metadata: _metadata }, _zip_initializers, _zip_extraInitializers);
|
|
56
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
|
+
}
|
|
58
|
+
street = __runInitializers(this, _street_initializers, void 0);
|
|
59
|
+
city = (__runInitializers(this, _street_extraInitializers), __runInitializers(this, _city_initializers, void 0));
|
|
60
|
+
zip = (__runInitializers(this, _city_extraInitializers), __runInitializers(this, _zip_initializers, void 0));
|
|
61
|
+
constructor() {
|
|
62
|
+
__runInitializers(this, _zip_extraInitializers);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
})();
|
|
66
|
+
export { Address };
|
|
67
|
+
let Dimensions = (() => {
|
|
68
|
+
let _width_decorators;
|
|
69
|
+
let _width_initializers = [];
|
|
70
|
+
let _width_extraInitializers = [];
|
|
71
|
+
let _height_decorators;
|
|
72
|
+
let _height_initializers = [];
|
|
73
|
+
let _height_extraInitializers = [];
|
|
74
|
+
let _depth_decorators;
|
|
75
|
+
let _depth_initializers = [];
|
|
76
|
+
let _depth_extraInitializers = [];
|
|
77
|
+
return class Dimensions {
|
|
78
|
+
static {
|
|
79
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
80
|
+
_width_decorators = [Field({ displayName: "Width" })];
|
|
81
|
+
_height_decorators = [Field({ displayName: "Height" })];
|
|
82
|
+
_depth_decorators = [Field({ displayName: "Depth" })];
|
|
83
|
+
__esDecorate(null, null, _width_decorators, { kind: "field", name: "width", static: false, private: false, access: { has: obj => "width" in obj, get: obj => obj.width, set: (obj, value) => { obj.width = value; } }, metadata: _metadata }, _width_initializers, _width_extraInitializers);
|
|
84
|
+
__esDecorate(null, null, _height_decorators, { kind: "field", name: "height", static: false, private: false, access: { has: obj => "height" in obj, get: obj => obj.height, set: (obj, value) => { obj.height = value; } }, metadata: _metadata }, _height_initializers, _height_extraInitializers);
|
|
85
|
+
__esDecorate(null, null, _depth_decorators, { kind: "field", name: "depth", static: false, private: false, access: { has: obj => "depth" in obj, get: obj => obj.depth, set: (obj, value) => { obj.depth = value; } }, metadata: _metadata }, _depth_initializers, _depth_extraInitializers);
|
|
86
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
87
|
+
}
|
|
88
|
+
/** @Minimum 0 @Maximum 10000 */
|
|
89
|
+
width = __runInitializers(this, _width_initializers, void 0);
|
|
90
|
+
/** @Minimum 0 @Maximum 10000 */
|
|
91
|
+
height = (__runInitializers(this, _width_extraInitializers), __runInitializers(this, _height_initializers, void 0));
|
|
92
|
+
/** @Minimum 0 */
|
|
93
|
+
depth = (__runInitializers(this, _height_extraInitializers), __runInitializers(this, _depth_initializers, void 0));
|
|
94
|
+
constructor() {
|
|
95
|
+
__runInitializers(this, _depth_extraInitializers);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
})();
|
|
99
|
+
export { Dimensions };
|
|
100
|
+
// --- Single nesting level ---
|
|
101
|
+
let UserWithAddress = (() => {
|
|
102
|
+
let _username_decorators;
|
|
103
|
+
let _username_initializers = [];
|
|
104
|
+
let _username_extraInitializers = [];
|
|
105
|
+
let _address_decorators;
|
|
106
|
+
let _address_initializers = [];
|
|
107
|
+
let _address_extraInitializers = [];
|
|
108
|
+
return class UserWithAddress {
|
|
109
|
+
static {
|
|
110
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
111
|
+
_username_decorators = [Field({ displayName: "Username" }), MinLength(1)];
|
|
112
|
+
_address_decorators = [Field({ displayName: "Address" })];
|
|
113
|
+
__esDecorate(null, null, _username_decorators, { kind: "field", name: "username", static: false, private: false, access: { has: obj => "username" in obj, get: obj => obj.username, set: (obj, value) => { obj.username = value; } }, metadata: _metadata }, _username_initializers, _username_extraInitializers);
|
|
114
|
+
__esDecorate(null, null, _address_decorators, { kind: "field", name: "address", static: false, private: false, access: { has: obj => "address" in obj, get: obj => obj.address, set: (obj, value) => { obj.address = value; } }, metadata: _metadata }, _address_initializers, _address_extraInitializers);
|
|
115
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
116
|
+
}
|
|
117
|
+
username = __runInitializers(this, _username_initializers, void 0);
|
|
118
|
+
address = (__runInitializers(this, _username_extraInitializers), __runInitializers(this, _address_initializers, void 0));
|
|
119
|
+
constructor() {
|
|
120
|
+
__runInitializers(this, _address_extraInitializers);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
})();
|
|
124
|
+
export { UserWithAddress };
|
|
125
|
+
let ProductWithDimensions = (() => {
|
|
126
|
+
let _name_decorators;
|
|
127
|
+
let _name_initializers = [];
|
|
128
|
+
let _name_extraInitializers = [];
|
|
129
|
+
let _dimensions_decorators;
|
|
130
|
+
let _dimensions_initializers = [];
|
|
131
|
+
let _dimensions_extraInitializers = [];
|
|
132
|
+
return class ProductWithDimensions {
|
|
133
|
+
static {
|
|
134
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
135
|
+
_name_decorators = [Field({ displayName: "Product Name" })];
|
|
136
|
+
_dimensions_decorators = [Field({ displayName: "Dimensions" })];
|
|
137
|
+
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
138
|
+
__esDecorate(null, null, _dimensions_decorators, { kind: "field", name: "dimensions", static: false, private: false, access: { has: obj => "dimensions" in obj, get: obj => obj.dimensions, set: (obj, value) => { obj.dimensions = value; } }, metadata: _metadata }, _dimensions_initializers, _dimensions_extraInitializers);
|
|
139
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
140
|
+
}
|
|
141
|
+
name = __runInitializers(this, _name_initializers, void 0);
|
|
142
|
+
dimensions = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _dimensions_initializers, void 0));
|
|
143
|
+
constructor() {
|
|
144
|
+
__runInitializers(this, _dimensions_extraInitializers);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
})();
|
|
148
|
+
export { ProductWithDimensions };
|
|
149
|
+
// --- Three levels deep: Order → Customer → Address ---
|
|
150
|
+
let Customer = (() => {
|
|
151
|
+
let _name_decorators;
|
|
152
|
+
let _name_initializers = [];
|
|
153
|
+
let _name_extraInitializers = [];
|
|
154
|
+
let _address_decorators;
|
|
155
|
+
let _address_initializers = [];
|
|
156
|
+
let _address_extraInitializers = [];
|
|
157
|
+
return class Customer {
|
|
158
|
+
static {
|
|
159
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
160
|
+
_name_decorators = [Field({ displayName: "Customer Name" }), MinLength(1)];
|
|
161
|
+
_address_decorators = [Field({ displayName: "Customer Address" })];
|
|
162
|
+
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
163
|
+
__esDecorate(null, null, _address_decorators, { kind: "field", name: "address", static: false, private: false, access: { has: obj => "address" in obj, get: obj => obj.address, set: (obj, value) => { obj.address = value; } }, metadata: _metadata }, _address_initializers, _address_extraInitializers);
|
|
164
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
165
|
+
}
|
|
166
|
+
name = __runInitializers(this, _name_initializers, void 0);
|
|
167
|
+
address = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _address_initializers, void 0));
|
|
168
|
+
constructor() {
|
|
169
|
+
__runInitializers(this, _address_extraInitializers);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
})();
|
|
173
|
+
export { Customer };
|
|
174
|
+
let Order = (() => {
|
|
175
|
+
let _orderId_decorators;
|
|
176
|
+
let _orderId_initializers = [];
|
|
177
|
+
let _orderId_extraInitializers = [];
|
|
178
|
+
let _customer_decorators;
|
|
179
|
+
let _customer_initializers = [];
|
|
180
|
+
let _customer_extraInitializers = [];
|
|
181
|
+
return class Order {
|
|
182
|
+
static {
|
|
183
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
184
|
+
_orderId_decorators = [Field({ displayName: "Order ID" })];
|
|
185
|
+
_customer_decorators = [Field({ displayName: "Customer" })];
|
|
186
|
+
__esDecorate(null, null, _orderId_decorators, { kind: "field", name: "orderId", static: false, private: false, access: { has: obj => "orderId" in obj, get: obj => obj.orderId, set: (obj, value) => { obj.orderId = value; } }, metadata: _metadata }, _orderId_initializers, _orderId_extraInitializers);
|
|
187
|
+
__esDecorate(null, null, _customer_decorators, { kind: "field", name: "customer", static: false, private: false, access: { has: obj => "customer" in obj, get: obj => obj.customer, set: (obj, value) => { obj.customer = value; } }, metadata: _metadata }, _customer_initializers, _customer_extraInitializers);
|
|
188
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
189
|
+
}
|
|
190
|
+
orderId = __runInitializers(this, _orderId_initializers, void 0);
|
|
191
|
+
customer = (__runInitializers(this, _orderId_extraInitializers), __runInitializers(this, _customer_initializers, void 0));
|
|
192
|
+
constructor() {
|
|
193
|
+
__runInitializers(this, _customer_extraInitializers);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
})();
|
|
197
|
+
export { Order };
|
|
198
|
+
// --- Circular reference ---
|
|
199
|
+
let NodeA = (() => {
|
|
200
|
+
let _name_decorators;
|
|
201
|
+
let _name_initializers = [];
|
|
202
|
+
let _name_extraInitializers = [];
|
|
203
|
+
return class NodeA {
|
|
204
|
+
static {
|
|
205
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
206
|
+
_name_decorators = [Field({ displayName: "Name" }), MinLength(1)];
|
|
207
|
+
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
208
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
209
|
+
}
|
|
210
|
+
name = __runInitializers(this, _name_initializers, void 0);
|
|
211
|
+
sibling = __runInitializers(this, _name_extraInitializers);
|
|
212
|
+
};
|
|
213
|
+
})();
|
|
214
|
+
export { NodeA };
|
|
215
|
+
let NodeB = (() => {
|
|
216
|
+
let _label_decorators;
|
|
217
|
+
let _label_initializers = [];
|
|
218
|
+
let _label_extraInitializers = [];
|
|
219
|
+
return class NodeB {
|
|
220
|
+
static {
|
|
221
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
222
|
+
_label_decorators = [Field({ displayName: "Label" })];
|
|
223
|
+
__esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
224
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
225
|
+
}
|
|
226
|
+
label = __runInitializers(this, _label_initializers, void 0);
|
|
227
|
+
sibling = __runInitializers(this, _label_extraInitializers);
|
|
228
|
+
};
|
|
229
|
+
})();
|
|
230
|
+
export { NodeB };
|
|
231
|
+
// --- Non-class object type (regression guard) ---
|
|
232
|
+
let WithInlineObject = (() => {
|
|
233
|
+
let _title_decorators;
|
|
234
|
+
let _title_initializers = [];
|
|
235
|
+
let _title_extraInitializers = [];
|
|
236
|
+
return class WithInlineObject {
|
|
237
|
+
static {
|
|
238
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
239
|
+
_title_decorators = [Field({ displayName: "Title" })];
|
|
240
|
+
__esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
241
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
242
|
+
}
|
|
243
|
+
title = __runInitializers(this, _title_initializers, void 0);
|
|
244
|
+
metadata = __runInitializers(this, _title_extraInitializers);
|
|
245
|
+
};
|
|
246
|
+
})();
|
|
247
|
+
export { WithInlineObject };
|
|
248
|
+
//# sourceMappingURL=example-nested-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-nested-class.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/example-nested-class.ts"],"names":[],"mappings":"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"}
|