scjson 0.1.7 → 0.2.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/scjsonProps.ts ADDED
@@ -0,0 +1,618 @@
1
+ /**
2
+ * scjsonProps.ts : Properties runtime file for scjson types
3
+ *
4
+ * Part of the scjson project.
5
+ * Developed by Softoboros Technology Inc.
6
+ * Licensed under the BSD 1-Clause License.
7
+ */
8
+
9
+ export interface AssignProps {
10
+ location: string;
11
+ expr: string | null;
12
+ typeValue: AssignTypeDatatypeProps;
13
+ attr: string | null;
14
+ otherAttributes: Record<string, object>;
15
+ content: Record<string, object>[];
16
+ }
17
+
18
+ export const defaultAssign = (): AssignProps => ({
19
+ location: "",
20
+ expr: null,
21
+ typeValue: AssignTypeDatatypeProps.Replacechildren,
22
+ attr: null,
23
+ otherAttributes: {},
24
+ content: [],
25
+ });
26
+ export const AssignTypeDatatypeProps = {
27
+ Addattribute: "addattribute",
28
+ Delete: "delete",
29
+ Firstchild: "firstchild",
30
+ Lastchild: "lastchild",
31
+ Nextsibling: "nextsibling",
32
+ Previoussibling: "previoussibling",
33
+ Replace: "replace",
34
+ Replacechildren: "replacechildren",
35
+ } as const;
36
+
37
+ export type AssignTypeDatatypeProps = typeof AssignTypeDatatypeProps[keyof typeof AssignTypeDatatypeProps];
38
+
39
+ export const BindingDatatypeProps = {
40
+ Early: "early",
41
+ Late: "late",
42
+ } as const;
43
+
44
+ export type BindingDatatypeProps = typeof BindingDatatypeProps[keyof typeof BindingDatatypeProps];
45
+
46
+ export const BooleanDatatypeProps = {
47
+ False: "false",
48
+ True: "true",
49
+ } as const;
50
+
51
+ export type BooleanDatatypeProps = typeof BooleanDatatypeProps[keyof typeof BooleanDatatypeProps];
52
+
53
+ export interface CancelProps {
54
+ otherElement: Record<string, object>[];
55
+ sendid: string | null;
56
+ sendidexpr: string | null;
57
+ otherAttributes: Record<string, object>;
58
+ }
59
+
60
+ export const defaultCancel = (): CancelProps => ({
61
+ otherElement: [],
62
+ sendid: null,
63
+ sendidexpr: null,
64
+ otherAttributes: {},
65
+ });
66
+ export interface ContentProps {
67
+ otherAttributes: Record<string, object>;
68
+ expr: string | null;
69
+ content: Record<string, object>[];
70
+ }
71
+
72
+ export const defaultContent = (): ContentProps => ({
73
+ otherAttributes: {},
74
+ expr: null,
75
+ content: [],
76
+ });
77
+ export interface DataProps {
78
+ id: string;
79
+ src: string | null;
80
+ expr: string | null;
81
+ otherAttributes: Record<string, object>;
82
+ content: Record<string, object>[];
83
+ }
84
+
85
+ export const defaultData = (): DataProps => ({
86
+ id: "",
87
+ src: null,
88
+ expr: null,
89
+ otherAttributes: {},
90
+ content: [],
91
+ });
92
+ export interface DatamodelProps {
93
+ data: DataProps[];
94
+ otherElement: Record<string, object>[];
95
+ otherAttributes: Record<string, object>;
96
+ }
97
+
98
+ export const defaultDatamodel = (): DatamodelProps => ({
99
+ data: [],
100
+ otherElement: [],
101
+ otherAttributes: {},
102
+ });
103
+ export interface DonedataProps {
104
+ content: ContentProps | null;
105
+ param: ParamProps[];
106
+ otherAttributes: Record<string, object>;
107
+ }
108
+
109
+ export const defaultDonedata = (): DonedataProps => ({
110
+ content: null,
111
+ param: [],
112
+ otherAttributes: {},
113
+ });
114
+ export interface ElseProps {
115
+ otherAttributes: Record<string, object>;
116
+ }
117
+
118
+ export const defaultElse = (): ElseProps => ({
119
+ otherAttributes: {},
120
+ });
121
+ export interface ElseifProps {
122
+ cond: string;
123
+ otherAttributes: Record<string, object>;
124
+ }
125
+
126
+ export const defaultElseif = (): ElseifProps => ({
127
+ cond: "",
128
+ otherAttributes: {},
129
+ });
130
+ export const ExmodeDatatypeProps = {
131
+ Lax: "lax",
132
+ Strict: "strict",
133
+ } as const;
134
+
135
+ export type ExmodeDatatypeProps = typeof ExmodeDatatypeProps[keyof typeof ExmodeDatatypeProps];
136
+
137
+ export interface FinalProps {
138
+ onentry: OnentryProps[];
139
+ onexit: OnexitProps[];
140
+ donedata: DonedataProps[];
141
+ otherElement: Record<string, object>[];
142
+ id: string | null;
143
+ otherAttributes: Record<string, object>;
144
+ }
145
+
146
+ export const defaultFinal = (): FinalProps => ({
147
+ onentry: [],
148
+ onexit: [],
149
+ donedata: [],
150
+ otherElement: [],
151
+ id: null,
152
+ otherAttributes: {},
153
+ });
154
+ export interface FinalizeProps {
155
+ otherElement: Record<string, object>[];
156
+ raiseValue: RaiseProps[];
157
+ ifValue: IfProps[];
158
+ foreach: ForeachProps[];
159
+ send: SendProps[];
160
+ script: ScriptProps[];
161
+ assign: AssignProps[];
162
+ log: LogProps[];
163
+ cancel: CancelProps[];
164
+ otherAttributes: Record<string, object>;
165
+ }
166
+
167
+ export const defaultFinalize = (): FinalizeProps => ({
168
+ otherElement: [],
169
+ raiseValue: [],
170
+ ifValue: [],
171
+ foreach: [],
172
+ send: [],
173
+ script: [],
174
+ assign: [],
175
+ log: [],
176
+ cancel: [],
177
+ otherAttributes: {},
178
+ });
179
+ export interface ForeachProps {
180
+ otherElement: Record<string, object>[];
181
+ raiseValue: RaiseProps[];
182
+ ifValue: IfProps[];
183
+ foreach: ForeachProps[];
184
+ send: SendProps[];
185
+ script: ScriptProps[];
186
+ assign: AssignProps[];
187
+ log: LogProps[];
188
+ cancel: CancelProps[];
189
+ array: string;
190
+ item: string;
191
+ index: string | null;
192
+ otherAttributes: Record<string, object>;
193
+ }
194
+
195
+ export const defaultForeach = (): ForeachProps => ({
196
+ otherElement: [],
197
+ raiseValue: [],
198
+ ifValue: [],
199
+ foreach: [],
200
+ send: [],
201
+ script: [],
202
+ assign: [],
203
+ log: [],
204
+ cancel: [],
205
+ array: "",
206
+ item: "",
207
+ index: null,
208
+ otherAttributes: {},
209
+ });
210
+ export interface HistoryProps {
211
+ otherElement: Record<string, object>[];
212
+ transition: TransitionProps;
213
+ id: string | null;
214
+ typeValue: HistoryTypeDatatypeProps | null;
215
+ otherAttributes: Record<string, object>;
216
+ }
217
+
218
+ export const defaultHistory = (): HistoryProps => ({
219
+ otherElement: [],
220
+ transition: defaultTransition(),
221
+ id: null,
222
+ typeValue: null,
223
+ otherAttributes: {},
224
+ });
225
+ export const HistoryTypeDatatypeProps = {
226
+ Deep: "deep",
227
+ Shallow: "shallow",
228
+ } as const;
229
+
230
+ export type HistoryTypeDatatypeProps = typeof HistoryTypeDatatypeProps[keyof typeof HistoryTypeDatatypeProps];
231
+
232
+ export interface IfProps {
233
+ otherElement: Record<string, object>[];
234
+ raiseValue: RaiseProps[];
235
+ ifValue: IfProps[];
236
+ foreach: ForeachProps[];
237
+ send: SendProps[];
238
+ script: ScriptProps[];
239
+ assign: AssignProps[];
240
+ log: LogProps[];
241
+ cancel: CancelProps[];
242
+ elseif: ElseifProps | null;
243
+ elseValue: ElseProps | null;
244
+ cond: string;
245
+ otherAttributes: Record<string, object>;
246
+ }
247
+
248
+ export const defaultIf = (): IfProps => ({
249
+ otherElement: [],
250
+ raiseValue: [],
251
+ ifValue: [],
252
+ foreach: [],
253
+ send: [],
254
+ script: [],
255
+ assign: [],
256
+ log: [],
257
+ cancel: [],
258
+ elseif: null,
259
+ elseValue: null,
260
+ cond: "",
261
+ otherAttributes: {},
262
+ });
263
+ export interface InitialProps {
264
+ otherElement: Record<string, object>[];
265
+ transition: TransitionProps;
266
+ otherAttributes: Record<string, object>;
267
+ }
268
+
269
+ export const defaultInitial = (): InitialProps => ({
270
+ otherElement: [],
271
+ transition: defaultTransition(),
272
+ otherAttributes: {},
273
+ });
274
+ export interface InvokeProps {
275
+ content: ContentProps[];
276
+ param: ParamProps[];
277
+ finalize: FinalizeProps[];
278
+ otherElement: Record<string, object>[];
279
+ typeValue: string;
280
+ typeexpr: string | null;
281
+ src: string | null;
282
+ srcexpr: string | null;
283
+ id: string | null;
284
+ idlocation: string | null;
285
+ namelist: string | null;
286
+ autoforward: BooleanDatatypeProps;
287
+ otherAttributes: Record<string, object>;
288
+ }
289
+
290
+ export const defaultInvoke = (): InvokeProps => ({
291
+ content: [],
292
+ param: [],
293
+ finalize: [],
294
+ otherElement: [],
295
+ typeValue: "scxml",
296
+ typeexpr: null,
297
+ src: null,
298
+ srcexpr: null,
299
+ id: null,
300
+ idlocation: null,
301
+ namelist: null,
302
+ autoforward: BooleanDatatypeProps.False,
303
+ otherAttributes: {},
304
+ });
305
+ export interface LogProps {
306
+ otherElement: Record<string, object>[];
307
+ label: string | null;
308
+ expr: string | null;
309
+ otherAttributes: Record<string, object>;
310
+ }
311
+
312
+ export const defaultLog = (): LogProps => ({
313
+ otherElement: [],
314
+ label: null,
315
+ expr: null,
316
+ otherAttributes: {},
317
+ });
318
+ export interface OnentryProps {
319
+ otherElement: Record<string, object>[];
320
+ raiseValue: RaiseProps[];
321
+ ifValue: IfProps[];
322
+ foreach: ForeachProps[];
323
+ send: SendProps[];
324
+ script: ScriptProps[];
325
+ assign: AssignProps[];
326
+ log: LogProps[];
327
+ cancel: CancelProps[];
328
+ otherAttributes: Record<string, object>;
329
+ }
330
+
331
+ export const defaultOnentry = (): OnentryProps => ({
332
+ otherElement: [],
333
+ raiseValue: [],
334
+ ifValue: [],
335
+ foreach: [],
336
+ send: [],
337
+ script: [],
338
+ assign: [],
339
+ log: [],
340
+ cancel: [],
341
+ otherAttributes: {},
342
+ });
343
+ export interface OnexitProps {
344
+ otherElement: Record<string, object>[];
345
+ raiseValue: RaiseProps[];
346
+ ifValue: IfProps[];
347
+ foreach: ForeachProps[];
348
+ send: SendProps[];
349
+ script: ScriptProps[];
350
+ assign: AssignProps[];
351
+ log: LogProps[];
352
+ cancel: CancelProps[];
353
+ otherAttributes: Record<string, object>;
354
+ }
355
+
356
+ export const defaultOnexit = (): OnexitProps => ({
357
+ otherElement: [],
358
+ raiseValue: [],
359
+ ifValue: [],
360
+ foreach: [],
361
+ send: [],
362
+ script: [],
363
+ assign: [],
364
+ log: [],
365
+ cancel: [],
366
+ otherAttributes: {},
367
+ });
368
+ export interface ParallelProps {
369
+ onentry: OnentryProps[];
370
+ onexit: OnexitProps[];
371
+ transition: TransitionProps[];
372
+ state: StateProps[];
373
+ parallel: ParallelProps[];
374
+ history: HistoryProps[];
375
+ datamodel: DatamodelProps[];
376
+ invoke: InvokeProps[];
377
+ otherElement: Record<string, object>[];
378
+ id: string | null;
379
+ otherAttributes: Record<string, object>;
380
+ }
381
+
382
+ export const defaultParallel = (): ParallelProps => ({
383
+ onentry: [],
384
+ onexit: [],
385
+ transition: [],
386
+ state: [],
387
+ parallel: [],
388
+ history: [],
389
+ datamodel: [],
390
+ invoke: [],
391
+ otherElement: [],
392
+ id: null,
393
+ otherAttributes: {},
394
+ });
395
+ export interface ParamProps {
396
+ otherElement: Record<string, object>[];
397
+ name: string;
398
+ expr: string | null;
399
+ location: string | null;
400
+ otherAttributes: Record<string, object>;
401
+ }
402
+
403
+ export const defaultParam = (): ParamProps => ({
404
+ otherElement: [],
405
+ name: "",
406
+ expr: null,
407
+ location: null,
408
+ otherAttributes: {},
409
+ });
410
+ export interface RaiseProps {
411
+ event: string;
412
+ otherAttributes: Record<string, object>;
413
+ }
414
+
415
+ export const defaultRaise = (): RaiseProps => ({
416
+ event: "",
417
+ otherAttributes: {},
418
+ });
419
+ export interface ScriptProps {
420
+ src: string | null;
421
+ otherAttributes: Record<string, object>;
422
+ content: Record<string, object>[];
423
+ }
424
+
425
+ export const defaultScript = (): ScriptProps => ({
426
+ src: null,
427
+ otherAttributes: {},
428
+ content: [],
429
+ });
430
+ export interface ScxmlProps {
431
+ state: StateProps[];
432
+ parallel: ParallelProps[];
433
+ final: FinalProps[];
434
+ datamodel: DatamodelProps[];
435
+ script: ScriptProps[];
436
+ otherElement: Record<string, object>[];
437
+ initial: string[];
438
+ name: string | null;
439
+ version: number | string;
440
+ datamodelAttribute: string;
441
+ binding: BindingDatatypeProps | null;
442
+ exmode: ExmodeDatatypeProps | null;
443
+ otherAttributes: Record<string, object>;
444
+ }
445
+
446
+ export const defaultScxml = (): ScxmlProps => ({
447
+ state: [],
448
+ parallel: [],
449
+ final: [],
450
+ datamodel: [],
451
+ script: [],
452
+ otherElement: [],
453
+ initial: [],
454
+ name: null,
455
+ version: 1.0,
456
+ datamodelAttribute: "null",
457
+ binding: null,
458
+ exmode: null,
459
+ otherAttributes: {},
460
+ });
461
+ export interface SendProps {
462
+ content: ContentProps[];
463
+ param: ParamProps[];
464
+ otherElement: Record<string, object>[];
465
+ event: string | null;
466
+ eventexpr: string | null;
467
+ target: string | null;
468
+ targetexpr: string | null;
469
+ typeValue: string;
470
+ typeexpr: string | null;
471
+ id: string | null;
472
+ idlocation: string | null;
473
+ delay: string;
474
+ delayexpr: string | null;
475
+ namelist: string | null;
476
+ otherAttributes: Record<string, object>;
477
+ }
478
+
479
+ export const defaultSend = (): SendProps => ({
480
+ content: [],
481
+ param: [],
482
+ otherElement: [],
483
+ event: null,
484
+ eventexpr: null,
485
+ target: null,
486
+ targetexpr: null,
487
+ typeValue: "scxml",
488
+ typeexpr: null,
489
+ id: null,
490
+ idlocation: null,
491
+ delay: "0s",
492
+ delayexpr: null,
493
+ namelist: null,
494
+ otherAttributes: {},
495
+ });
496
+ export interface StateProps {
497
+ onentry: OnentryProps[];
498
+ onexit: OnexitProps[];
499
+ transition: TransitionProps[];
500
+ initial: InitialProps[];
501
+ state: StateProps[];
502
+ parallel: ParallelProps[];
503
+ final: FinalProps[];
504
+ history: HistoryProps[];
505
+ datamodel: DatamodelProps[];
506
+ invoke: InvokeProps[];
507
+ otherElement: Record<string, object>[];
508
+ id: string | null;
509
+ initialAttribute: string[];
510
+ otherAttributes: Record<string, object>;
511
+ }
512
+
513
+ export const defaultState = (): StateProps => ({
514
+ onentry: [],
515
+ onexit: [],
516
+ transition: [],
517
+ initial: [],
518
+ state: [],
519
+ parallel: [],
520
+ final: [],
521
+ history: [],
522
+ datamodel: [],
523
+ invoke: [],
524
+ otherElement: [],
525
+ id: null,
526
+ initialAttribute: [],
527
+ otherAttributes: {},
528
+ });
529
+ export interface TransitionProps {
530
+ otherElement: Record<string, object>[];
531
+ raiseValue: RaiseProps[];
532
+ ifValue: IfProps[];
533
+ foreach: ForeachProps[];
534
+ send: SendProps[];
535
+ script: ScriptProps[];
536
+ assign: AssignProps[];
537
+ log: LogProps[];
538
+ cancel: CancelProps[];
539
+ event: string | null;
540
+ cond: string | null;
541
+ target: string[];
542
+ typeValue: TransitionTypeDatatypeProps | null;
543
+ otherAttributes: Record<string, object>;
544
+ }
545
+
546
+ export const defaultTransition = (): TransitionProps => ({
547
+ otherElement: [],
548
+ raiseValue: [],
549
+ ifValue: [],
550
+ foreach: [],
551
+ send: [],
552
+ script: [],
553
+ assign: [],
554
+ log: [],
555
+ cancel: [],
556
+ event: null,
557
+ cond: null,
558
+ target: [],
559
+ typeValue: null,
560
+ otherAttributes: {},
561
+ });
562
+ export const TransitionTypeDatatypeProps = {
563
+ External: "external",
564
+ Internal: "internal",
565
+ } as const;
566
+
567
+ export type TransitionTypeDatatypeProps = typeof TransitionTypeDatatypeProps[keyof typeof TransitionTypeDatatypeProps];
568
+
569
+ export type Kind = "number" | "string" | "record<string, object>" | "number[]" | "string[]"
570
+ | "record<string, object>[]" | "assign" | "assigntypedatatype" | "bindingdatatype" | "booleandatatype"
571
+ | "cancel" | "content" | "data" | "datamodel" | "donedata" | "else" | "elseif"
572
+ | "exmodedatatype" | "final" | "finalize" | "foreach" | "history" | "historytypedatatype" | "if"
573
+ | "initial" | "invoke" | "log" | "onentry" | "onexit" | "parallel" | "param" | "raise"
574
+ | "script" | "scxml" | "send" | "state" | "transition" | "transitiontypedatatype";
575
+
576
+ export type PropsUnion = null | string | number | Record<string, object> | string[] | number[]
577
+ | Record<string, object>[] | AssignProps | AssignTypeDatatypeProps | BindingDatatypeProps
578
+ | BooleanDatatypeProps | CancelProps | ContentProps | DataProps | DatamodelProps | DonedataProps
579
+ | ElseProps | ElseifProps | ExmodeDatatypeProps | FinalProps | FinalizeProps | ForeachProps
580
+ | HistoryProps | HistoryTypeDatatypeProps | IfProps | InitialProps | InvokeProps | LogProps
581
+ | OnentryProps | OnexitProps | ParallelProps | ParamProps | RaiseProps | ScriptProps
582
+ | ScxmlProps | SendProps | StateProps | TransitionProps | TransitionTypeDatatypeProps;
583
+
584
+ export type KindMap = {
585
+ assign: AssignProps
586
+ assigntypedatatype: AssignTypeDatatypeProps
587
+ bindingdatatype: BindingDatatypeProps
588
+ booleandatatype: BooleanDatatypeProps
589
+ cancel: CancelProps
590
+ content: ContentProps
591
+ data: DataProps
592
+ datamodel: DatamodelProps
593
+ donedata: DonedataProps
594
+ else: ElseProps
595
+ elseif: ElseifProps
596
+ exmodedatatype: ExmodeDatatypeProps
597
+ final: FinalProps
598
+ finalize: FinalizeProps
599
+ foreach: ForeachProps
600
+ history: HistoryProps
601
+ historytypedatatype: HistoryTypeDatatypeProps
602
+ if: IfProps
603
+ initial: InitialProps
604
+ invoke: InvokeProps
605
+ log: LogProps
606
+ onentry: OnentryProps
607
+ onexit: OnexitProps
608
+ parallel: ParallelProps
609
+ param: ParamProps
610
+ raise: RaiseProps
611
+ script: ScriptProps
612
+ scxml: ScxmlProps
613
+ send: SendProps
614
+ state: StateProps
615
+ transition: TransitionProps
616
+ transitiontypedatatype: TransitionTypeDatatypeProps
617
+ }
618
+