@formspec/build 0.1.0-alpha.31 → 0.1.0-alpha.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,gBAAgB,CAAC;AAMxB;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAEpD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAAC;IAC7D;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,MAAM,GACf;QAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAA;KAAE,GAAG,SAAS,CAAC;IAE/F;;;;;OAKG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,4BAA4B,GAAG,SAAS,CAAC;IAC/E;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAC7B;QACE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;KAClD,GACD,SAAS,CAAC;IACd;;OAEG;IACH,+BAA+B,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAEb;QACE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,YAAY,EAAE,uCAAuC,CAAC;KAChE,GACD,SAAS,CAAC;IAEd;;;;;OAKG;IACH,cAAc,CAAC,YAAY,EAA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AAc,CAAC,YAAY,EAAE,MAAM,GAAG,4BAA4B,GAAG,SAAS,CAAC;CAChF;AAuBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,mBAAmB,EAAE,GACzC,iBAAiB,CAkJnB"}
@@ -0,0 +1,112 @@
1
+ import * as ts from "typescript";
2
+ import type { UISchema } from "../ui-schema/types.js";
3
+ import type { StaticBuildContext } from "../static-build.js";
4
+ import { type StaticSchemaGenerationOptions } from "./class-schema.js";
5
+ import { type JsonSchema2020 } from "../json-schema/ir-generator.js";
6
+ /**
7
+ * Generated schemas for a discovered declaration or signature type.
8
+ *
9
+ * `uiSchema` is `null` when the discovered type does not have an object-shaped
10
+ * root that can be represented as a JSON Forms layout.
11
+ *
12
+ * @public
13
+ */
14
+ export interface DiscoveredTypeSchemas {
15
+ /** JSON Schema 2020-12 for the resolved type. */
16
+ readonly jsonSchema: JsonSchema2020;
17
+ /** UI Schema for object-shaped roots, or `null` when not applicable. */
18
+ readonly uiSchema: UISchema | null;
19
+ }
20
+ /**
21
+ * Supported declaration kinds for declaration-driven schema generation.
22
+ *
23
+ * @public
24
+ */
25
+ export type SchemaSourceDeclaration = ts.ClassDeclaration | ts.InterfaceDeclaration | ts.TypeAliasDeclaration;
26
+ /**
27
+ * Options for generating schemas from a resolved declaration.
28
+ *
29
+ * @public
30
+ */
31
+ export interface GenerateSchemasFromDeclarationOptions extends StaticSchemaGenerationOptions {
32
+ /** Supported build context used for checker access and related analysis. */
33
+ readonly context: StaticBuildContext;
34
+ /** Declaration to turn into schemas. */
35
+ readonly declaration: SchemaSourceDeclaration;
36
+ }
37
+ /**
38
+ * Options for generating schemas from a resolved TypeScript type.
39
+ *
40
+ * @public
41
+ */
42
+ export interface GenerateSchemasFromTypeOptions extends StaticSchemaGenerationOptions {
43
+ /** Supported build context used for checker access and related analysis. */
44
+ readonly context: StaticBuildContext;
45
+ /** TypeScript type to turn into schemas. */
46
+ readonly type: ts.Type;
47
+ /**
48
+ * Optional source node associated with the type.
49
+ *
50
+ * When provided, FormSpec uses it as the source location for provenance and
51
+ * inline-type analysis.
52
+ */
53
+ readonly sourceNode?: ts.Node | undefined;
54
+ /** Optional logical name used for anonymous roots. */
55
+ readonly name?: string | undefined;
56
+ }
57
+ /**
58
+ * Options for generating schemas from a method or function parameter type.
59
+ *
60
+ * @public
61
+ */
62
+ export interface GenerateSchemasFromParameterOptions extends StaticSchemaGenerationOptions {
63
+ /** Supported build context used for checker access and related analysis. */
64
+ readonly context: StaticBuildContext;
65
+ /** Parameter declaration whose type should be converted into schemas. */
66
+ readonly parameter: ts.ParameterDeclaration;
67
+ }
68
+ /**
69
+ * Options for generating schemas from a method or function return type.
70
+ *
71
+ * @public
72
+ */
73
+ export interface GenerateSchemasFromReturnTypeOptions extends StaticSchemaGenerationOptions {
74
+ /** Supported build context used for checker access and related analysis. */
75
+ readonly context: StaticBuildContext;
76
+ /** Signature declaration whose return type should be converted into schemas. */
77
+ readonly declaration: ts.SignatureDeclaration;
78
+ }
79
+ /**
80
+ * Generates schemas from a resolved declaration using the supported public
81
+ * static-build workflow.
82
+ *
83
+ * Named declarations reuse the same analyzer semantics as FormSpec's existing
84
+ * top-level generation APIs. Non-object type aliases fall back to the generic
85
+ * resolved-type entry point.
86
+ *
87
+ * @public
88
+ */
89
+ export declare function generateSchemasFromDeclaration(options: GenerateSchemasFromDeclarationOptions): DiscoveredTypeSchemas;
90
+ /**
91
+ * Generates schemas from a resolved TypeScript type.
92
+ *
93
+ * This is the advanced public entry point for build tooling that already uses
94
+ * the TypeScript compiler API to discover types before handing them to
95
+ * FormSpec.
96
+ *
97
+ * @public
98
+ */
99
+ export declare function generateSchemasFromType(options: GenerateSchemasFromTypeOptions): DiscoveredTypeSchemas;
100
+ /**
101
+ * Generates schemas for a method or function parameter type.
102
+ *
103
+ * @public
104
+ */
105
+ export declare function generateSchemasFromParameter(options: GenerateSchemasFromParameterOptions): DiscoveredTypeSchemas;
106
+ /**
107
+ * Generates schemas for a method or function return type.
108
+ *
109
+ * @public
110
+ */
111
+ export declare function generateSchemasFromReturnType(options: GenerateSchemasFromReturnTypeOptions): DiscoveredTypeSchemas;
112
+ //# sourceMappingURL=discovered-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovered-schema.d.ts","sourceRoot":"","sources":["../../src/generators/discovered-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAQjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAU7D,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAK/F;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAC/B,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,oBAAoB,GACvB,EAAE,CAAC,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,qCAAsC,SAAQ,6BAA6B;IAC1F,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,wCAAwC;IACxC,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,6BAA6B;IACnF,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IACvB;;;;;OAKG;IACH,Q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