@bpmnkit/core 0.0.8

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.
Files changed (104) hide show
  1. package/README.md +185 -0
  2. package/dist/bpmn/auto-layout.d.ts +10 -0
  3. package/dist/bpmn/auto-layout.js +203 -0
  4. package/dist/bpmn/bpmn-builder.d.ts +381 -0
  5. package/dist/bpmn/bpmn-builder.js +1223 -0
  6. package/dist/bpmn/bpmn-model.d.ts +403 -0
  7. package/dist/bpmn/bpmn-model.js +2 -0
  8. package/dist/bpmn/bpmn-parser.d.ts +4 -0
  9. package/dist/bpmn/bpmn-parser.js +642 -0
  10. package/dist/bpmn/bpmn-serializer.d.ts +4 -0
  11. package/dist/bpmn/bpmn-serializer.js +515 -0
  12. package/dist/bpmn/compact.d.ts +91 -0
  13. package/dist/bpmn/compact.js +349 -0
  14. package/dist/bpmn/di-color.d.ts +9 -0
  15. package/dist/bpmn/di-color.js +32 -0
  16. package/dist/bpmn/index.d.ts +105 -0
  17. package/dist/bpmn/index.js +176 -0
  18. package/dist/bpmn/optimize/feel.d.ts +4 -0
  19. package/dist/bpmn/optimize/feel.js +186 -0
  20. package/dist/bpmn/optimize/flow.d.ts +4 -0
  21. package/dist/bpmn/optimize/flow.js +323 -0
  22. package/dist/bpmn/optimize/index.d.ts +5 -0
  23. package/dist/bpmn/optimize/index.js +51 -0
  24. package/dist/bpmn/optimize/naming.d.ts +8 -0
  25. package/dist/bpmn/optimize/naming.js +145 -0
  26. package/dist/bpmn/optimize/tasks.d.ts +4 -0
  27. package/dist/bpmn/optimize/tasks.js +273 -0
  28. package/dist/bpmn/optimize/types.d.ts +44 -0
  29. package/dist/bpmn/optimize/types.js +2 -0
  30. package/dist/bpmn/optimize/utils.d.ts +23 -0
  31. package/dist/bpmn/optimize/utils.js +129 -0
  32. package/dist/bpmn/rest-connector.d.ts +48 -0
  33. package/dist/bpmn/rest-connector.js +69 -0
  34. package/dist/bpmn/svg.d.ts +35 -0
  35. package/dist/bpmn/svg.js +557 -0
  36. package/dist/bpmn/type-guards.d.ts +136 -0
  37. package/dist/bpmn/type-guards.js +211 -0
  38. package/dist/bpmn/utils.d.ts +88 -0
  39. package/dist/bpmn/utils.js +207 -0
  40. package/dist/bpmn/zeebe-extensions.d.ts +72 -0
  41. package/dist/bpmn/zeebe-extensions.js +96 -0
  42. package/dist/dmn/compact.d.ts +44 -0
  43. package/dist/dmn/compact.js +125 -0
  44. package/dist/dmn/dmn-builder.d.ts +59 -0
  45. package/dist/dmn/dmn-builder.js +144 -0
  46. package/dist/dmn/dmn-layout.d.ts +57 -0
  47. package/dist/dmn/dmn-layout.js +256 -0
  48. package/dist/dmn/dmn-model.d.ts +158 -0
  49. package/dist/dmn/dmn-model.js +2 -0
  50. package/dist/dmn/dmn-parser.d.ts +4 -0
  51. package/dist/dmn/dmn-parser.js +275 -0
  52. package/dist/dmn/dmn-serializer.d.ts +4 -0
  53. package/dist/dmn/dmn-serializer.js +296 -0
  54. package/dist/dmn/index.d.ts +28 -0
  55. package/dist/dmn/index.js +51 -0
  56. package/dist/errors.d.ts +77 -0
  57. package/dist/errors.js +66 -0
  58. package/dist/form/compact.d.ts +20 -0
  59. package/dist/form/compact.js +146 -0
  60. package/dist/form/form-builder.d.ts +111 -0
  61. package/dist/form/form-builder.js +347 -0
  62. package/dist/form/form-model.d.ts +221 -0
  63. package/dist/form/form-model.js +2 -0
  64. package/dist/form/form-parser.d.ts +4 -0
  65. package/dist/form/form-parser.js +514 -0
  66. package/dist/form/form-serializer.d.ts +4 -0
  67. package/dist/form/form-serializer.js +240 -0
  68. package/dist/form/index.d.ts +27 -0
  69. package/dist/form/index.js +43 -0
  70. package/dist/index.d.ts +37 -0
  71. package/dist/index.js +19 -0
  72. package/dist/layout/bench.d.ts +86 -0
  73. package/dist/layout/bench.js +225 -0
  74. package/dist/layout/coordinates.d.ts +62 -0
  75. package/dist/layout/coordinates.js +868 -0
  76. package/dist/layout/crossing.d.ts +8 -0
  77. package/dist/layout/crossing.js +60 -0
  78. package/dist/layout/graph.d.ts +28 -0
  79. package/dist/layout/graph.js +126 -0
  80. package/dist/layout/index.d.ts +7 -0
  81. package/dist/layout/index.js +5 -0
  82. package/dist/layout/layers.d.ts +13 -0
  83. package/dist/layout/layers.js +49 -0
  84. package/dist/layout/layout-engine.d.ts +21 -0
  85. package/dist/layout/layout-engine.js +191 -0
  86. package/dist/layout/overlap.d.ts +10 -0
  87. package/dist/layout/overlap.js +70 -0
  88. package/dist/layout/routing.d.ts +26 -0
  89. package/dist/layout/routing.js +439 -0
  90. package/dist/layout/subprocess.d.ts +14 -0
  91. package/dist/layout/subprocess.js +77 -0
  92. package/dist/layout/types.d.ts +72 -0
  93. package/dist/layout/types.js +37 -0
  94. package/dist/types/id-generator.d.ts +8 -0
  95. package/dist/types/id-generator.js +31 -0
  96. package/dist/types/index.d.ts +3 -0
  97. package/dist/types/index.js +2 -0
  98. package/dist/types/xml-element.d.ts +12 -0
  99. package/dist/types/xml-element.js +2 -0
  100. package/dist/xml/index.d.ts +2 -0
  101. package/dist/xml/index.js +2 -0
  102. package/dist/xml/xml-parser.d.ts +13 -0
  103. package/dist/xml/xml-parser.js +271 -0
  104. package/package.json +38 -0
@@ -0,0 +1,111 @@
1
+ import type { FormComponent, FormDefinition, FormLayout, FormValidation, FormValueOption } from "./form-model.js";
2
+ /** Builder for constructing Camunda Forms programmatically. */
3
+ export declare class FormBuilder {
4
+ private _id;
5
+ private _type;
6
+ private _executionPlatform;
7
+ private _executionPlatformVersion;
8
+ private _exporter?;
9
+ private _schemaVersion?;
10
+ private _generated?;
11
+ private readonly _components;
12
+ constructor(id?: string);
13
+ /** Sets the form ID. */
14
+ id(id: string): this;
15
+ /** Sets the execution platform. */
16
+ executionPlatform(platform: string): this;
17
+ /** Sets the execution platform version. */
18
+ executionPlatformVersion(version: string): this;
19
+ /** Sets the exporter metadata. */
20
+ exporter(name: string, version: string): this;
21
+ /** Sets the schema version. */
22
+ schemaVersion(version: number): this;
23
+ /** Marks this form as generated. */
24
+ generated(value: boolean): this;
25
+ /** Adds a static text component. */
26
+ text(text: string, options?: {
27
+ id?: string;
28
+ label?: string;
29
+ layout?: FormLayout;
30
+ }): this;
31
+ /** Adds a text field component. */
32
+ textfield(label: string, key: string, options?: TextFieldOptions): this;
33
+ /** Adds a textarea component. */
34
+ textarea(label: string, key: string, options?: TextFieldOptions): this;
35
+ /** Adds a select dropdown component. */
36
+ select(label: string, key: string, options?: SelectOptions): this;
37
+ /** Adds a radio button group component. */
38
+ radio(label: string, key: string, values: FormValueOption[], options?: RadioOptions): this;
39
+ /** Adds a checkbox component. */
40
+ checkbox(label: string, key: string, options?: CheckboxOptions): this;
41
+ /** Adds a checklist component. */
42
+ checklist(label: string, key: string, values: FormValueOption[], options?: ChecklistOptions): this;
43
+ /** Adds a group component with nested children built via a callback. */
44
+ group(label: string, builder: (group: GroupBuilder) => void, options?: GroupOptions): this;
45
+ /** Builds the final FormDefinition. */
46
+ build(): FormDefinition;
47
+ }
48
+ /** Sub-builder for group components. Supports the same component methods as FormBuilder. */
49
+ export declare class GroupBuilder {
50
+ /** @internal */
51
+ readonly _id: string;
52
+ /** @internal */
53
+ readonly _components: FormComponent[];
54
+ constructor(id?: string);
55
+ text(text: string, options?: {
56
+ id?: string;
57
+ label?: string;
58
+ layout?: FormLayout;
59
+ }): this;
60
+ textfield(label: string, key: string, options?: TextFieldOptions): this;
61
+ textarea(label: string, key: string, options?: TextFieldOptions): this;
62
+ select(label: string, key: string, options?: SelectOptions): this;
63
+ radio(label: string, key: string, values: FormValueOption[], options?: RadioOptions): this;
64
+ checkbox(label: string, key: string, options?: CheckboxOptions): this;
65
+ checklist(label: string, key: string, values: FormValueOption[], options?: ChecklistOptions): this;
66
+ group(label: string, builder: (group: GroupBuilder) => void, options?: GroupOptions): this;
67
+ }
68
+ /** Options for textfield/textarea components. */
69
+ export interface TextFieldOptions {
70
+ id?: string;
71
+ validate?: FormValidation;
72
+ defaultValue?: string;
73
+ layout?: FormLayout;
74
+ }
75
+ /** Options for select components. */
76
+ export interface SelectOptions {
77
+ id?: string;
78
+ values?: FormValueOption[];
79
+ valuesKey?: string;
80
+ validate?: FormValidation;
81
+ searchable?: boolean;
82
+ defaultValue?: string;
83
+ layout?: FormLayout;
84
+ }
85
+ /** Options for radio components. */
86
+ export interface RadioOptions {
87
+ id?: string;
88
+ validate?: FormValidation;
89
+ defaultValue?: string;
90
+ layout?: FormLayout;
91
+ }
92
+ /** Options for checkbox components. */
93
+ export interface CheckboxOptions {
94
+ id?: string;
95
+ validate?: FormValidation;
96
+ defaultValue?: boolean;
97
+ layout?: FormLayout;
98
+ }
99
+ /** Options for checklist components. */
100
+ export interface ChecklistOptions {
101
+ id?: string;
102
+ validate?: FormValidation;
103
+ layout?: FormLayout;
104
+ }
105
+ /** Options for group components. */
106
+ export interface GroupOptions {
107
+ id?: string;
108
+ showOutline?: boolean;
109
+ layout?: FormLayout;
110
+ }
111
+ //# sourceMappingURL=form-builder.d.ts.map
@@ -0,0 +1,347 @@
1
+ import { generateId } from "../types/id-generator.js";
2
+ /** Builder for constructing Camunda Forms programmatically. */
3
+ export class FormBuilder {
4
+ _id;
5
+ _type = "default";
6
+ _executionPlatform = "Camunda Cloud";
7
+ _executionPlatformVersion = "8.7.0";
8
+ _exporter;
9
+ _schemaVersion;
10
+ _generated;
11
+ _components = [];
12
+ constructor(id) {
13
+ this._id = id ?? generateId("Form");
14
+ }
15
+ /** Sets the form ID. */
16
+ id(id) {
17
+ this._id = id;
18
+ return this;
19
+ }
20
+ /** Sets the execution platform. */
21
+ executionPlatform(platform) {
22
+ this._executionPlatform = platform;
23
+ return this;
24
+ }
25
+ /** Sets the execution platform version. */
26
+ executionPlatformVersion(version) {
27
+ this._executionPlatformVersion = version;
28
+ return this;
29
+ }
30
+ /** Sets the exporter metadata. */
31
+ exporter(name, version) {
32
+ this._exporter = { name, version };
33
+ return this;
34
+ }
35
+ /** Sets the schema version. */
36
+ schemaVersion(version) {
37
+ this._schemaVersion = version;
38
+ return this;
39
+ }
40
+ /** Marks this form as generated. */
41
+ generated(value) {
42
+ this._generated = value;
43
+ return this;
44
+ }
45
+ /** Adds a static text component. */
46
+ text(text, options) {
47
+ const component = {
48
+ type: "text",
49
+ id: options?.id ?? generateId("Field"),
50
+ text,
51
+ };
52
+ if (options?.label !== undefined)
53
+ component.label = options.label;
54
+ if (options?.layout !== undefined)
55
+ component.layout = options.layout;
56
+ this._components.push(component);
57
+ return this;
58
+ }
59
+ /** Adds a text field component. */
60
+ textfield(label, key, options) {
61
+ const component = {
62
+ type: "textfield",
63
+ id: options?.id ?? generateId("Field"),
64
+ label,
65
+ key,
66
+ };
67
+ if (options?.validate !== undefined)
68
+ component.validate = options.validate;
69
+ if (options?.defaultValue !== undefined)
70
+ component.defaultValue = options.defaultValue;
71
+ if (options?.layout !== undefined)
72
+ component.layout = options.layout;
73
+ this._components.push(component);
74
+ return this;
75
+ }
76
+ /** Adds a textarea component. */
77
+ textarea(label, key, options) {
78
+ const component = {
79
+ type: "textarea",
80
+ id: options?.id ?? generateId("Field"),
81
+ label,
82
+ key,
83
+ };
84
+ if (options?.validate !== undefined)
85
+ component.validate = options.validate;
86
+ if (options?.defaultValue !== undefined)
87
+ component.defaultValue = options.defaultValue;
88
+ if (options?.layout !== undefined)
89
+ component.layout = options.layout;
90
+ this._components.push(component);
91
+ return this;
92
+ }
93
+ /** Adds a select dropdown component. */
94
+ select(label, key, options) {
95
+ const component = {
96
+ type: "select",
97
+ id: options?.id ?? generateId("Field"),
98
+ label,
99
+ key,
100
+ };
101
+ if (options?.values !== undefined)
102
+ component.values = options.values;
103
+ if (options?.valuesKey !== undefined)
104
+ component.valuesKey = options.valuesKey;
105
+ if (options?.validate !== undefined)
106
+ component.validate = options.validate;
107
+ if (options?.searchable !== undefined)
108
+ component.searchable = options.searchable;
109
+ if (options?.defaultValue !== undefined)
110
+ component.defaultValue = options.defaultValue;
111
+ if (options?.layout !== undefined)
112
+ component.layout = options.layout;
113
+ this._components.push(component);
114
+ return this;
115
+ }
116
+ /** Adds a radio button group component. */
117
+ radio(label, key, values, options) {
118
+ const component = {
119
+ type: "radio",
120
+ id: options?.id ?? generateId("Field"),
121
+ label,
122
+ key,
123
+ values,
124
+ };
125
+ if (options?.validate !== undefined)
126
+ component.validate = options.validate;
127
+ if (options?.defaultValue !== undefined)
128
+ component.defaultValue = options.defaultValue;
129
+ if (options?.layout !== undefined)
130
+ component.layout = options.layout;
131
+ this._components.push(component);
132
+ return this;
133
+ }
134
+ /** Adds a checkbox component. */
135
+ checkbox(label, key, options) {
136
+ const component = {
137
+ type: "checkbox",
138
+ id: options?.id ?? generateId("Field"),
139
+ label,
140
+ key,
141
+ };
142
+ if (options?.validate !== undefined)
143
+ component.validate = options.validate;
144
+ if (options?.defaultValue !== undefined)
145
+ component.defaultValue = options.defaultValue;
146
+ if (options?.layout !== undefined)
147
+ component.layout = options.layout;
148
+ this._components.push(component);
149
+ return this;
150
+ }
151
+ /** Adds a checklist component. */
152
+ checklist(label, key, values, options) {
153
+ const component = {
154
+ type: "checklist",
155
+ id: options?.id ?? generateId("Field"),
156
+ label,
157
+ key,
158
+ values,
159
+ };
160
+ if (options?.validate !== undefined)
161
+ component.validate = options.validate;
162
+ if (options?.layout !== undefined)
163
+ component.layout = options.layout;
164
+ this._components.push(component);
165
+ return this;
166
+ }
167
+ /** Adds a group component with nested children built via a callback. */
168
+ group(label, builder, options) {
169
+ const groupBuilder = new GroupBuilder(options?.id);
170
+ builder(groupBuilder);
171
+ const component = {
172
+ type: "group",
173
+ id: groupBuilder._id,
174
+ label,
175
+ components: groupBuilder._components,
176
+ };
177
+ if (options?.showOutline !== undefined)
178
+ component.showOutline = options.showOutline;
179
+ if (options?.layout !== undefined)
180
+ component.layout = options.layout;
181
+ this._components.push(component);
182
+ return this;
183
+ }
184
+ /** Builds the final FormDefinition. */
185
+ build() {
186
+ const definition = {
187
+ id: this._id,
188
+ type: this._type,
189
+ components: this._components,
190
+ };
191
+ if (this._executionPlatform !== undefined) {
192
+ definition.executionPlatform = this._executionPlatform;
193
+ }
194
+ if (this._executionPlatformVersion !== undefined) {
195
+ definition.executionPlatformVersion = this._executionPlatformVersion;
196
+ }
197
+ if (this._exporter !== undefined)
198
+ definition.exporter = this._exporter;
199
+ if (this._schemaVersion !== undefined)
200
+ definition.schemaVersion = this._schemaVersion;
201
+ if (this._generated !== undefined)
202
+ definition.generated = this._generated;
203
+ return definition;
204
+ }
205
+ }
206
+ /** Sub-builder for group components. Supports the same component methods as FormBuilder. */
207
+ export class GroupBuilder {
208
+ /** @internal */
209
+ _id;
210
+ /** @internal */
211
+ _components = [];
212
+ constructor(id) {
213
+ this._id = id ?? generateId("Field");
214
+ }
215
+ text(text, options) {
216
+ const component = {
217
+ type: "text",
218
+ id: options?.id ?? generateId("Field"),
219
+ text,
220
+ };
221
+ if (options?.label !== undefined)
222
+ component.label = options.label;
223
+ if (options?.layout !== undefined)
224
+ component.layout = options.layout;
225
+ this._components.push(component);
226
+ return this;
227
+ }
228
+ textfield(label, key, options) {
229
+ const component = {
230
+ type: "textfield",
231
+ id: options?.id ?? generateId("Field"),
232
+ label,
233
+ key,
234
+ };
235
+ if (options?.validate !== undefined)
236
+ component.validate = options.validate;
237
+ if (options?.defaultValue !== undefined)
238
+ component.defaultValue = options.defaultValue;
239
+ if (options?.layout !== undefined)
240
+ component.layout = options.layout;
241
+ this._components.push(component);
242
+ return this;
243
+ }
244
+ textarea(label, key, options) {
245
+ const component = {
246
+ type: "textarea",
247
+ id: options?.id ?? generateId("Field"),
248
+ label,
249
+ key,
250
+ };
251
+ if (options?.validate !== undefined)
252
+ component.validate = options.validate;
253
+ if (options?.defaultValue !== undefined)
254
+ component.defaultValue = options.defaultValue;
255
+ if (options?.layout !== undefined)
256
+ component.layout = options.layout;
257
+ this._components.push(component);
258
+ return this;
259
+ }
260
+ select(label, key, options) {
261
+ const component = {
262
+ type: "select",
263
+ id: options?.id ?? generateId("Field"),
264
+ label,
265
+ key,
266
+ };
267
+ if (options?.values !== undefined)
268
+ component.values = options.values;
269
+ if (options?.valuesKey !== undefined)
270
+ component.valuesKey = options.valuesKey;
271
+ if (options?.validate !== undefined)
272
+ component.validate = options.validate;
273
+ if (options?.searchable !== undefined)
274
+ component.searchable = options.searchable;
275
+ if (options?.defaultValue !== undefined)
276
+ component.defaultValue = options.defaultValue;
277
+ if (options?.layout !== undefined)
278
+ component.layout = options.layout;
279
+ this._components.push(component);
280
+ return this;
281
+ }
282
+ radio(label, key, values, options) {
283
+ const component = {
284
+ type: "radio",
285
+ id: options?.id ?? generateId("Field"),
286
+ label,
287
+ key,
288
+ values,
289
+ };
290
+ if (options?.validate !== undefined)
291
+ component.validate = options.validate;
292
+ if (options?.defaultValue !== undefined)
293
+ component.defaultValue = options.defaultValue;
294
+ if (options?.layout !== undefined)
295
+ component.layout = options.layout;
296
+ this._components.push(component);
297
+ return this;
298
+ }
299
+ checkbox(label, key, options) {
300
+ const component = {
301
+ type: "checkbox",
302
+ id: options?.id ?? generateId("Field"),
303
+ label,
304
+ key,
305
+ };
306
+ if (options?.validate !== undefined)
307
+ component.validate = options.validate;
308
+ if (options?.defaultValue !== undefined)
309
+ component.defaultValue = options.defaultValue;
310
+ if (options?.layout !== undefined)
311
+ component.layout = options.layout;
312
+ this._components.push(component);
313
+ return this;
314
+ }
315
+ checklist(label, key, values, options) {
316
+ const component = {
317
+ type: "checklist",
318
+ id: options?.id ?? generateId("Field"),
319
+ label,
320
+ key,
321
+ values,
322
+ };
323
+ if (options?.validate !== undefined)
324
+ component.validate = options.validate;
325
+ if (options?.layout !== undefined)
326
+ component.layout = options.layout;
327
+ this._components.push(component);
328
+ return this;
329
+ }
330
+ group(label, builder, options) {
331
+ const groupBuilder = new GroupBuilder(options?.id);
332
+ builder(groupBuilder);
333
+ const component = {
334
+ type: "group",
335
+ id: groupBuilder._id,
336
+ label,
337
+ components: groupBuilder._components,
338
+ };
339
+ if (options?.showOutline !== undefined)
340
+ component.showOutline = options.showOutline;
341
+ if (options?.layout !== undefined)
342
+ component.layout = options.layout;
343
+ this._components.push(component);
344
+ return this;
345
+ }
346
+ }
347
+ //# sourceMappingURL=form-builder.js.map
@@ -0,0 +1,221 @@
1
+ /** Layout positioning for a form component. */
2
+ export interface FormLayout {
3
+ row?: string;
4
+ columns?: number | null;
5
+ }
6
+ /** Validation constraints for a form field. */
7
+ export interface FormValidation {
8
+ required?: boolean;
9
+ minLength?: number;
10
+ maxLength?: number;
11
+ }
12
+ /** A label/value option used by select, radio, and checklist components. */
13
+ export interface FormValueOption {
14
+ label: string;
15
+ value: string;
16
+ }
17
+ /** Base properties shared by all form components. */
18
+ interface FormComponentBase {
19
+ id: string;
20
+ type: string;
21
+ layout?: FormLayout;
22
+ }
23
+ /** Static text/markdown display component. */
24
+ export interface FormTextComponent extends FormComponentBase {
25
+ type: "text";
26
+ text: string;
27
+ label?: string;
28
+ }
29
+ /** Single-line text input. */
30
+ export interface FormTextFieldComponent extends FormComponentBase {
31
+ type: "textfield";
32
+ label: string;
33
+ key: string;
34
+ validate?: FormValidation;
35
+ defaultValue?: string;
36
+ }
37
+ /** Multi-line text input. */
38
+ export interface FormTextAreaComponent extends FormComponentBase {
39
+ type: "textarea";
40
+ label: string;
41
+ key: string;
42
+ validate?: FormValidation;
43
+ defaultValue?: string;
44
+ }
45
+ /** Dropdown select input. */
46
+ export interface FormSelectComponent extends FormComponentBase {
47
+ type: "select";
48
+ label: string;
49
+ key: string;
50
+ values?: FormValueOption[];
51
+ valuesKey?: string;
52
+ validate?: FormValidation;
53
+ searchable?: boolean;
54
+ defaultValue?: string;
55
+ }
56
+ /** Radio button group. */
57
+ export interface FormRadioComponent extends FormComponentBase {
58
+ type: "radio";
59
+ label: string;
60
+ key: string;
61
+ values?: FormValueOption[];
62
+ valuesExpression?: string;
63
+ validate?: FormValidation;
64
+ defaultValue?: string;
65
+ }
66
+ /** Single checkbox. */
67
+ export interface FormCheckboxComponent extends FormComponentBase {
68
+ type: "checkbox";
69
+ label: string;
70
+ key: string;
71
+ validate?: FormValidation;
72
+ defaultValue?: boolean;
73
+ }
74
+ /** Multi-select checklist. */
75
+ export interface FormChecklistComponent extends FormComponentBase {
76
+ type: "checklist";
77
+ label: string;
78
+ key: string;
79
+ values?: FormValueOption[];
80
+ valuesExpression?: string;
81
+ validate?: FormValidation;
82
+ }
83
+ /** Container that groups nested components. */
84
+ export interface FormGroupComponent extends FormComponentBase {
85
+ type: "group";
86
+ label: string;
87
+ components: FormComponent[];
88
+ showOutline?: boolean;
89
+ }
90
+ /** Numeric input field. */
91
+ export interface FormNumberComponent extends FormComponentBase {
92
+ type: "number";
93
+ label: string;
94
+ key: string;
95
+ validate?: FormValidation;
96
+ defaultValue?: number;
97
+ }
98
+ /** Date and/or time picker. */
99
+ export interface FormDatetimeComponent extends FormComponentBase {
100
+ type: "datetime";
101
+ key: string;
102
+ /** Subtype: "date", "time", or "datetime". */
103
+ subtype?: string;
104
+ dateLabel?: string;
105
+ timeLabel?: string;
106
+ validate?: FormValidation;
107
+ }
108
+ /** Submit or action button. */
109
+ export interface FormButtonComponent extends FormComponentBase {
110
+ type: "button";
111
+ label: string;
112
+ /** Button action: "submit" or "reset". */
113
+ action?: string;
114
+ }
115
+ /** Multi-value tag list input. */
116
+ export interface FormTaglistComponent extends FormComponentBase {
117
+ type: "taglist";
118
+ label: string;
119
+ key: string;
120
+ values?: FormValueOption[];
121
+ valuesKey?: string;
122
+ validate?: FormValidation;
123
+ }
124
+ /** Read-only data table. */
125
+ export interface FormTableComponent extends FormComponentBase {
126
+ type: "table";
127
+ label?: string;
128
+ dataSource?: string;
129
+ rowCount?: number;
130
+ columns?: Array<{
131
+ label: string;
132
+ key: string;
133
+ }>;
134
+ }
135
+ /** Image display component. */
136
+ export interface FormImageComponent extends FormComponentBase {
137
+ type: "image";
138
+ /** URL or FEEL expression for the image source. */
139
+ source?: string;
140
+ alt?: string;
141
+ }
142
+ /** Repeating list of sub-components. */
143
+ export interface FormDynamicListComponent extends FormComponentBase {
144
+ type: "dynamiclist";
145
+ label?: string;
146
+ path?: string;
147
+ components: FormComponent[];
148
+ isRepeating?: boolean;
149
+ allowAddRemove?: boolean;
150
+ defaultRepetitions?: number;
151
+ showOutline?: boolean;
152
+ }
153
+ /** Embedded iframe component. */
154
+ export interface FormIframeComponent extends FormComponentBase {
155
+ type: "iframe";
156
+ label?: string;
157
+ url?: string;
158
+ height?: number;
159
+ security?: {
160
+ allowScripts?: boolean;
161
+ };
162
+ }
163
+ /** Visual separator line. */
164
+ export interface FormSeparatorComponent extends FormComponentBase {
165
+ type: "separator";
166
+ }
167
+ /** Blank spacer. */
168
+ export interface FormSpacerComponent extends FormComponentBase {
169
+ type: "spacer";
170
+ height?: number;
171
+ }
172
+ /** Document preview component. */
173
+ export interface FormDocumentPreviewComponent extends FormComponentBase {
174
+ type: "documentPreview";
175
+ label?: string;
176
+ }
177
+ /** Raw HTML content component. */
178
+ export interface FormHtmlComponent extends FormComponentBase {
179
+ type: "html";
180
+ content?: string;
181
+ }
182
+ /** FEEL expression component. */
183
+ export interface FormExpressionComponent extends FormComponentBase {
184
+ type: "expression";
185
+ key?: string;
186
+ expression?: string;
187
+ /** When to evaluate: "change" or "submit". */
188
+ computeOn?: string;
189
+ }
190
+ /** File upload picker component. */
191
+ export interface FormFilepickerComponent extends FormComponentBase {
192
+ type: "filepicker";
193
+ label?: string;
194
+ key?: string;
195
+ multiple?: boolean;
196
+ }
197
+ /** Passthrough for unknown/future component types — preserves roundtrip fidelity. */
198
+ export interface FormUnknownComponent extends FormComponentBase {
199
+ type: string;
200
+ [key: string]: unknown;
201
+ }
202
+ /** Discriminated union of all form component types. */
203
+ export type FormComponent = FormTextComponent | FormTextFieldComponent | FormTextAreaComponent | FormSelectComponent | FormRadioComponent | FormCheckboxComponent | FormChecklistComponent | FormGroupComponent | FormNumberComponent | FormDatetimeComponent | FormButtonComponent | FormTaglistComponent | FormTableComponent | FormImageComponent | FormDynamicListComponent | FormIframeComponent | FormSeparatorComponent | FormSpacerComponent | FormDocumentPreviewComponent | FormHtmlComponent | FormExpressionComponent | FormFilepickerComponent | FormUnknownComponent;
204
+ /** Exporter metadata. */
205
+ export interface FormExporter {
206
+ name: string;
207
+ version: string;
208
+ }
209
+ /** Root form definition model. */
210
+ export interface FormDefinition {
211
+ id: string;
212
+ type: string;
213
+ executionPlatform?: string;
214
+ executionPlatformVersion?: string;
215
+ exporter?: FormExporter;
216
+ schemaVersion?: number;
217
+ components: FormComponent[];
218
+ generated?: boolean;
219
+ }
220
+ export {};
221
+ //# sourceMappingURL=form-model.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=form-model.js.map
@@ -0,0 +1,4 @@
1
+ import type { FormDefinition } from "./form-model.js";
2
+ /** Parses a Camunda Form JSON string into a typed FormDefinition. */
3
+ export declare function parseForm(json: string): FormDefinition;
4
+ //# sourceMappingURL=form-parser.d.ts.map