@fugood/bricks-project 2.22.0-beta.9 → 2.22.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.
Files changed (86) hide show
  1. package/compile/action-name-map.ts +108 -1
  2. package/compile/index.ts +10 -1
  3. package/package.json +3 -3
  4. package/tools/postinstall.ts +16 -9
  5. package/types/animation.ts +2 -1
  6. package/types/brick-base.ts +79 -0
  7. package/types/bricks/3DViewer.ts +200 -0
  8. package/types/bricks/Camera.ts +195 -0
  9. package/types/bricks/Chart.ts +362 -0
  10. package/types/bricks/GenerativeMedia.ts +240 -0
  11. package/types/bricks/Icon.ts +93 -0
  12. package/types/bricks/Image.ts +104 -0
  13. package/types/bricks/Items.ts +461 -0
  14. package/types/bricks/Lottie.ts +159 -0
  15. package/types/bricks/QrCode.ts +112 -0
  16. package/types/bricks/Rect.ts +110 -0
  17. package/types/bricks/RichText.ts +123 -0
  18. package/types/bricks/Rive.ts +209 -0
  19. package/types/bricks/Slideshow.ts +155 -0
  20. package/types/bricks/Svg.ts +94 -0
  21. package/types/bricks/Text.ts +143 -0
  22. package/types/bricks/TextInput.ts +231 -0
  23. package/types/bricks/Video.ts +170 -0
  24. package/types/bricks/VideoStreaming.ts +107 -0
  25. package/types/bricks/WebRtcStream.ts +60 -0
  26. package/types/bricks/WebView.ts +157 -0
  27. package/types/bricks/index.ts +20 -0
  28. package/types/common.ts +8 -3
  29. package/types/data.ts +6 -0
  30. package/types/generators/AlarmClock.ts +102 -0
  31. package/types/generators/Assistant.ts +546 -0
  32. package/types/generators/BleCentral.ts +225 -0
  33. package/types/generators/BlePeripheral.ts +202 -0
  34. package/types/generators/CanvasMap.ts +57 -0
  35. package/types/generators/CastlesPay.ts +77 -0
  36. package/types/generators/DataBank.ts +123 -0
  37. package/types/generators/File.ts +351 -0
  38. package/types/generators/GraphQl.ts +124 -0
  39. package/types/generators/Http.ts +117 -0
  40. package/types/generators/HttpServer.ts +164 -0
  41. package/types/generators/Information.ts +97 -0
  42. package/types/generators/Intent.ts +107 -0
  43. package/types/generators/Iterator.ts +95 -0
  44. package/types/generators/Keyboard.ts +85 -0
  45. package/types/generators/LlmAnthropicCompat.ts +188 -0
  46. package/types/generators/LlmGgml.ts +719 -0
  47. package/types/generators/LlmOnnx.ts +184 -0
  48. package/types/generators/LlmOpenAiCompat.ts +206 -0
  49. package/types/generators/LlmQualcommAiEngine.ts +213 -0
  50. package/types/generators/Mcp.ts +294 -0
  51. package/types/generators/McpServer.ts +248 -0
  52. package/types/generators/MediaFlow.ts +142 -0
  53. package/types/generators/MqttBroker.ts +121 -0
  54. package/types/generators/MqttClient.ts +129 -0
  55. package/types/generators/Question.ts +395 -0
  56. package/types/generators/RealtimeTranscription.ts +180 -0
  57. package/types/generators/RerankerGgml.ts +153 -0
  58. package/types/generators/SerialPort.ts +141 -0
  59. package/types/generators/SoundPlayer.ts +86 -0
  60. package/types/generators/SoundRecorder.ts +113 -0
  61. package/types/generators/SpeechToTextGgml.ts +462 -0
  62. package/types/generators/SpeechToTextOnnx.ts +227 -0
  63. package/types/generators/SpeechToTextPlatform.ts +75 -0
  64. package/types/generators/SqLite.ts +118 -0
  65. package/types/generators/Step.ts +101 -0
  66. package/types/generators/TapToPayOnIPhone.ts +175 -0
  67. package/types/generators/Tcp.ts +120 -0
  68. package/types/generators/TcpServer.ts +137 -0
  69. package/types/generators/TextToSpeechGgml.ts +182 -0
  70. package/types/generators/TextToSpeechOnnx.ts +169 -0
  71. package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
  72. package/types/generators/ThermalPrinter.ts +185 -0
  73. package/types/generators/Tick.ts +75 -0
  74. package/types/generators/Udp.ts +109 -0
  75. package/types/generators/VadGgml.ts +211 -0
  76. package/types/generators/VectorStore.ts +223 -0
  77. package/types/generators/Watchdog.ts +96 -0
  78. package/types/generators/WebCrawler.ts +97 -0
  79. package/types/generators/WebRtc.ts +165 -0
  80. package/types/generators/WebSocket.ts +142 -0
  81. package/types/generators/index.ts +51 -0
  82. package/types/system.ts +64 -0
  83. package/utils/data.ts +45 -0
  84. package/utils/event-props.ts +89 -0
  85. package/types/bricks.ts +0 -3168
  86. package/types/generators.ts +0 -7633
@@ -0,0 +1,121 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Start MQTT broker server */
13
+ export type GeneratorMQTTBrokerActionStart = Action & {
14
+ __actionName: 'GENERATOR_MQTT_BROKER_START'
15
+ }
16
+
17
+ /* Publish message to topic */
18
+ export type GeneratorMQTTBrokerActionPublish = ActionWithParams & {
19
+ __actionName: 'GENERATOR_MQTT_BROKER_PUBLISH'
20
+ params?: Array<
21
+ | {
22
+ input: 'topic'
23
+ value?: string | DataLink | EventProperty
24
+ mapping?: string
25
+ }
26
+ | {
27
+ input: 'payload'
28
+ value?: string | DataLink | EventProperty
29
+ mapping?: string
30
+ }
31
+ | {
32
+ input: 'messageId'
33
+ value?: number | DataLink | EventProperty
34
+ mapping?: string
35
+ }
36
+ >
37
+ }
38
+
39
+ /* Stop MQTT broker server */
40
+ export type GeneratorMQTTBrokerActionStop = Action & {
41
+ __actionName: 'GENERATOR_MQTT_BROKER_STOP'
42
+ }
43
+
44
+ interface GeneratorMQTTBrokerDef {
45
+ /*
46
+ Default property:
47
+ {
48
+ "init": false,
49
+ "port": 1883,
50
+ "retryInterval": 5,
51
+ "keepalive": 60,
52
+ "authenticate": false
53
+ }
54
+ */
55
+ property?: {
56
+ /* Start MQTT broker on generator initialized */
57
+ init?: boolean | DataLink
58
+ /* Bind port of MQTT server */
59
+ port?: number | DataLink
60
+ /* Retry interval when publish failed */
61
+ retryInterval?: number | DataLink
62
+ /* Keep-alive interval */
63
+ keepalive?: number | DataLink
64
+ /* Enable authentication */
65
+ authenticate?: boolean | DataLink
66
+ /* Authentication table */
67
+ authTable?:
68
+ | Array<
69
+ | DataLink
70
+ | {
71
+ username?: string | DataLink
72
+ password?: string | DataLink
73
+ }
74
+ >
75
+ | DataLink
76
+ }
77
+ events?: {
78
+ /* Event of MQTT server is ready */
79
+ onReady?: Array<EventAction>
80
+ /* Event of server or connection error */
81
+ onError?: Array<EventAction>
82
+ /* Event of client connected */
83
+ onClientConnected?: Array<EventAction>
84
+ /* Event of client disconnected */
85
+ onClientDisconnected?: Array<EventAction>
86
+ /* Event of message received */
87
+ onMessageReceived?: Array<EventAction>
88
+ /* Event of message published */
89
+ onMessagePublished?: Array<EventAction>
90
+ }
91
+ outlets?: {
92
+ /* Is server started */
93
+ started?: () => Data
94
+ /* Last received message */
95
+ lastMessage?: () => Data
96
+ /* Error message */
97
+ errorMessage?: () => Data
98
+ }
99
+ }
100
+
101
+ /* MQTT Broker server */
102
+ export type GeneratorMQTTBroker = Generator &
103
+ GeneratorMQTTBrokerDef & {
104
+ templateKey: 'GENERATOR_MQTT_BROKER'
105
+ switches: Array<
106
+ SwitchDef &
107
+ GeneratorMQTTBrokerDef & {
108
+ conds?: Array<{
109
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
110
+ cond:
111
+ | SwitchCondInnerStateCurrentCanvas
112
+ | SwitchCondData
113
+ | {
114
+ __typename: 'SwitchCondInnerStateOutlet'
115
+ outlet: 'started' | 'lastMessage' | 'errorMessage'
116
+ value: any
117
+ }
118
+ }>
119
+ }
120
+ >
121
+ }
@@ -0,0 +1,129 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Connect to MQTT broker */
13
+ export type GeneratorMQTTActionConnect = Action & {
14
+ __actionName: 'GENERATOR_MQTT_CONNECT'
15
+ }
16
+
17
+ /* Disconnect from MQTT broker */
18
+ export type GeneratorMQTTActionDisconnect = Action & {
19
+ __actionName: 'GENERATOR_MQTT_DISCONNECT'
20
+ }
21
+
22
+ /* Send message to MQTT broker */
23
+ export type GeneratorMQTTActionPublish = ActionWithParams & {
24
+ __actionName: 'GENERATOR_MQTT_PUBLISH'
25
+ params?: Array<
26
+ | {
27
+ input: 'topic'
28
+ value?: string | DataLink | EventProperty
29
+ mapping?: string
30
+ }
31
+ | {
32
+ input: 'payload'
33
+ value?: any | EventProperty
34
+ mapping?: string
35
+ }
36
+ | {
37
+ input: 'qos'
38
+ value?: '0' | '1' | '2' | DataLink | EventProperty
39
+ mapping?: string
40
+ }
41
+ | {
42
+ input: 'retain'
43
+ value?: boolean | DataLink | EventProperty
44
+ mapping?: string
45
+ }
46
+ >
47
+ }
48
+
49
+ interface GeneratorMQTTDef {
50
+ /*
51
+ Default property:
52
+ {
53
+ "init": false,
54
+ "auth": false,
55
+ "autoReconnect": true,
56
+ "autoReconnectAttemptTime": 1000,
57
+ "qos": "0",
58
+ "messageType": "text"
59
+ }
60
+ */
61
+ property?: {
62
+ /* Auto connect when generator start */
63
+ init?: boolean | DataLink
64
+ /* Broker endpoint (mqtt://) */
65
+ uri?: string | DataLink
66
+ /* Broker need auth or not, if set false will ignore username and password setting */
67
+ auth?: boolean | DataLink
68
+ /* Username */
69
+ username?: string | DataLink
70
+ /* Password */
71
+ password?: string | DataLink
72
+ /* Client ID */
73
+ clientId?: string | DataLink
74
+ /* Second */
75
+ keepAlive?: number | DataLink
76
+ /* If true, BRICKS will auto reconnect when connection lose */
77
+ autoReconnect?: boolean | DataLink
78
+ /* How many times BRICKS will try to reconnect */
79
+ autoReconnectAttemptTime?: number | DataLink
80
+ /* Topic name to subscribe */
81
+ topic?: string | DataLink
82
+ /* Setting the mode of quality of service mode */
83
+ qos?: '0' | '1' | '2' | DataLink
84
+ /* If set to text the outlet and event property will be string, if set to json will parse to object */
85
+ messageType?: 'text' | 'json' | DataLink
86
+ }
87
+ events?: {
88
+ /* When connected to MQTT broker */
89
+ onConnected?: Array<EventAction>
90
+ /* When disconnected from MQTT broker */
91
+ onDisconnected?: Array<EventAction>
92
+ /* When error occurred */
93
+ onError?: Array<EventAction>
94
+ /* When received message from MQTT broker within subscribe topic */
95
+ onMessage?: Array<EventAction>
96
+ }
97
+ outlets?: {
98
+ /* Connected or not */
99
+ connected?: () => Data
100
+ /* Error Message */
101
+ error?: () => Data
102
+ /* The receive message */
103
+ message?: () => Data
104
+ /* The receive message (payload only) */
105
+ messagePayload?: () => Data
106
+ }
107
+ }
108
+
109
+ /* MQTT protocol messaging */
110
+ export type GeneratorMQTT = Generator &
111
+ GeneratorMQTTDef & {
112
+ templateKey: 'GENERATOR_MQTT'
113
+ switches: Array<
114
+ SwitchDef &
115
+ GeneratorMQTTDef & {
116
+ conds?: Array<{
117
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
118
+ cond:
119
+ | SwitchCondInnerStateCurrentCanvas
120
+ | SwitchCondData
121
+ | {
122
+ __typename: 'SwitchCondInnerStateOutlet'
123
+ outlet: 'connected' | 'error' | 'message' | 'messagePayload'
124
+ value: any
125
+ }
126
+ }>
127
+ }
128
+ >
129
+ }
@@ -0,0 +1,395 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Start inquire */
13
+ export type GeneratorQuestionActionStart = Action & {
14
+ __actionName: 'GENERATOR_QUESTION_START'
15
+ }
16
+
17
+ /* Stop inquire */
18
+ export type GeneratorQuestionActionStop = Action & {
19
+ __actionName: 'GENERATOR_QUESTION_STOP'
20
+ }
21
+
22
+ /* Pause inquire */
23
+ export type GeneratorQuestionActionPause = Action & {
24
+ __actionName: 'GENERATOR_QUESTION_PAUSE'
25
+ }
26
+
27
+ interface GeneratorQuestionDef {
28
+ /*
29
+ Default property:
30
+ {
31
+ "modalMode": "root",
32
+ "showClose": true,
33
+ "showBack": true,
34
+ "cameraType": "back",
35
+ "cameraPosition": "top",
36
+ "selectColumns": 3,
37
+ "selectAutoColumns": true,
38
+ "sizeFactor": 1,
39
+ "containerBackgroundColor": "#ffffff",
40
+ "titleColor": "#000000",
41
+ "descriptionColor": "#2e2e2e",
42
+ "fieldBackgroundColor": "#E2E2E2",
43
+ "fieldTextColor": "#1e1e1e",
44
+ "fieldPlaceholderColor": "#333333",
45
+ "fieldActiveBackgroundColor": "#FDCB8F",
46
+ "fieldActiveTextColor": "#7D7D7D",
47
+ "fieldControlColor": "#f08400",
48
+ "primaryControlBtnBackgroundColor": "#1e1e1e",
49
+ "primaryControlBtnTextColor": "#ffffff",
50
+ "primaryControlBtnBorderColor": "#1e1e1e",
51
+ "secondaryControlBtnBackgroundColor": "#ffffff",
52
+ "secondaryControlBtnTextColor": "#1e1e1e",
53
+ "secondaryControlBtnBorderColor": "#1e1e1e",
54
+ "warnColor": "#ff4f00",
55
+ "errorColor": "#ff0000"
56
+ }
57
+ */
58
+ property?: {
59
+ /* Modal mode */
60
+ modalMode?: 'root' | 'in-subspace' | DataLink
61
+ /* Inquirer schema
62
+ `key`: Field key (unique, required)
63
+ `kind`: Field type (required)
64
+ `title`: Field or message title
65
+ `description`: Field or message description
66
+ `required`: Whether the field is required
67
+ `defaultValue`: Default value of the field
68
+ `[kind]Options`: Field configuration
69
+ `condition`: Condition to show field */
70
+ schema?:
71
+ | Array<
72
+ | DataLink
73
+ | {
74
+ key?: string | DataLink
75
+ title?: string | DataLink
76
+ description?: string | DataLink
77
+ kind?:
78
+ | 'language'
79
+ | 'number'
80
+ | 'numeric-string'
81
+ | 'text'
82
+ | 'phone'
83
+ | 'email'
84
+ | 'color'
85
+ | 'uri'
86
+ | 'select'
87
+ | 'multi-select'
88
+ | 'yesno'
89
+ | 'qty-list'
90
+ | 'cart'
91
+ | 'preference'
92
+ | 'voice-record'
93
+ | 'video-record'
94
+ | 'code-scan'
95
+ | 'message'
96
+ | DataLink
97
+ required?: boolean | DataLink
98
+ defaultValue?:
99
+ | string
100
+ | DataLink
101
+ | number
102
+ | DataLink
103
+ | boolean
104
+ | DataLink
105
+ | Array<string | DataLink>
106
+ | DataLink
107
+ | DataLink
108
+ languageOptions?:
109
+ | DataLink
110
+ | {
111
+ availableLangs?: Array<string | DataLink> | DataLink
112
+ }
113
+ numberOptions?:
114
+ | DataLink
115
+ | {
116
+ min?: number | DataLink
117
+ max?: number | DataLink
118
+ step?: number | DataLink
119
+ }
120
+ textOptions?:
121
+ | DataLink
122
+ | {
123
+ placeholder?: string | DataLink
124
+ }
125
+ phoneOptions?:
126
+ | DataLink
127
+ | {
128
+ placeholder?: string | DataLink
129
+ usePhysicalKeyboard?: boolean | DataLink
130
+ }
131
+ emailOptions?:
132
+ | DataLink
133
+ | {
134
+ placeholder?: string | DataLink
135
+ }
136
+ uriOptions?:
137
+ | DataLink
138
+ | {
139
+ placeholder?: string | DataLink
140
+ }
141
+ selectOptions?:
142
+ | DataLink
143
+ | {
144
+ withConfirmButton?: boolean | DataLink
145
+ options?:
146
+ | Array<
147
+ | DataLink
148
+ | {
149
+ value?: string | DataLink
150
+ image_uri?: string | DataLink
151
+ label?: string | DataLink
152
+ icon?: string | DataLink
153
+ }
154
+ >
155
+ | DataLink
156
+ }
157
+ multiSelectOptions?:
158
+ | DataLink
159
+ | {
160
+ options?:
161
+ | Array<
162
+ | DataLink
163
+ | {
164
+ value?: string | DataLink
165
+ image_uri?: string | DataLink
166
+ label?: string | DataLink
167
+ icon?: string | DataLink
168
+ }
169
+ >
170
+ | DataLink
171
+ minimum?: number | DataLink
172
+ maximum?: number | DataLink
173
+ }
174
+ yesnoOptions?:
175
+ | DataLink
176
+ | {
177
+ imageUri?: string | DataLink
178
+ withConfirmButton?: boolean | DataLink
179
+ yesBtnText?: string | DataLink
180
+ noBtnText?: string | DataLink
181
+ }
182
+ qtyListOptions?:
183
+ | DataLink
184
+ | {
185
+ items?:
186
+ | Array<
187
+ | DataLink
188
+ | {
189
+ id?: string | DataLink
190
+ title?: string | DataLink
191
+ description?: string | DataLink
192
+ imageUri?: string | DataLink
193
+ price?: number | DataLink
194
+ }
195
+ >
196
+ | DataLink
197
+ }
198
+ cartOptions?:
199
+ | DataLink
200
+ | {
201
+ items?:
202
+ | Array<
203
+ | DataLink
204
+ | {
205
+ id?: string | DataLink
206
+ title?: string | DataLink
207
+ description?: string | DataLink
208
+ imageUri?: string | DataLink
209
+ price?: number | DataLink
210
+ qty?: number | DataLink
211
+ }
212
+ >
213
+ | DataLink
214
+ }
215
+ preferenceOptions?:
216
+ | DataLink
217
+ | {
218
+ settings?:
219
+ | Array<
220
+ | DataLink
221
+ | {
222
+ key?: string | DataLink
223
+ title?: string | DataLink
224
+ options?:
225
+ | Array<
226
+ | DataLink
227
+ | {
228
+ label?: string | DataLink
229
+ value?: string | DataLink
230
+ }
231
+ >
232
+ | DataLink
233
+ multiple?: boolean | DataLink
234
+ required?: boolean | DataLink
235
+ maximum?: number | DataLink
236
+ minimum?: number | DataLink
237
+ }
238
+ >
239
+ | DataLink
240
+ }
241
+ voiceRecordOptions?:
242
+ | DataLink
243
+ | {
244
+ sampleRate?: number | DataLink
245
+ bitDepth?: '8bit' | '16bit' | DataLink
246
+ channels?: 'mono' | 'stereo' | DataLink
247
+ maxDuration?: number | DataLink
248
+ }
249
+ videoRecordOptions?:
250
+ | DataLink
251
+ | {
252
+ manuallyStart?: boolean | DataLink
253
+ recordDuration?: number | DataLink
254
+ }
255
+ messageOptions?:
256
+ | DataLink
257
+ | {
258
+ symbol?: 'success' | DataLink
259
+ duration?: number | DataLink
260
+ }
261
+ condition?:
262
+ | DataLink
263
+ | {
264
+ key?: string | DataLink
265
+ operator?:
266
+ | 'eq'
267
+ | 'neq'
268
+ | 'contains'
269
+ | 'notContains'
270
+ | 'isTrue'
271
+ | 'isFalse'
272
+ | DataLink
273
+ value?: string | DataLink
274
+ }
275
+ }
276
+ >
277
+ | DataLink
278
+ /* Display language (RFC 3066) */
279
+ displayLang?: string | DataLink
280
+ /* Banner image */
281
+ bannerImage?: string | DataLink
282
+ /* Banner image md5 */
283
+ bannerImageMd5?: string | DataLink
284
+ /* Show AI transcribe tip on the bottom of the modal */
285
+ aiTranscribeTip?: boolean | DataLink
286
+ /* Show close button */
287
+ showClose?: boolean | DataLink
288
+ /* Show back button */
289
+ showBack?: boolean | DataLink
290
+ /* Camera type */
291
+ cameraType?: 'front' | 'back' | DataLink
292
+ /* Camera position */
293
+ cameraPosition?: 'top' | 'left' | 'bottom' | 'right' | DataLink
294
+ /* "Next" button text */
295
+ nextButtonText?: string | DataLink
296
+ /* "Skip" button text */
297
+ skipButtonText?: string | DataLink
298
+ /* "Done" button text */
299
+ doneButtonText?: string | DataLink
300
+ /* Select columns */
301
+ selectColumns?: number | DataLink
302
+ /* Select auto calculate columns */
303
+ selectAutoColumns?: boolean | DataLink
304
+ /* Fixed model width, default is auto */
305
+ fixedModelWidth?: number | DataLink
306
+ /* Fixed model height, default is auto */
307
+ fixedModelHeight?: number | DataLink
308
+ /* Size factor */
309
+ sizeFactor?: number | DataLink
310
+ /* Background color */
311
+ backgroundColor?: string | DataLink
312
+ /* Container background color */
313
+ containerBackgroundColor?: string | DataLink
314
+ /* Title color */
315
+ titleColor?: string | DataLink
316
+ /* Description color */
317
+ descriptionColor?: string | DataLink
318
+ /* Input field background color */
319
+ fieldBackgroundColor?: string | DataLink
320
+ /* Input field text color */
321
+ fieldTextColor?: string | DataLink
322
+ /* Input field placeholder color */
323
+ fieldPlaceholderColor?: string | DataLink
324
+ /* Selected option background color */
325
+ fieldActiveBackgroundColor?: string | DataLink
326
+ /* Selected option text color */
327
+ fieldActiveTextColor?: string | DataLink
328
+ /* Field control button color */
329
+ fieldControlColor?: string | DataLink
330
+ /* Primary control button background color */
331
+ primaryControlBtnBackgroundColor?: string | DataLink
332
+ /* Primary control button text color */
333
+ primaryControlBtnTextColor?: string | DataLink
334
+ /* Primary control button border color */
335
+ primaryControlBtnBorderColor?: string | DataLink
336
+ /* Secondary control button background color */
337
+ secondaryControlBtnBackgroundColor?: string | DataLink
338
+ /* Secondary control button text color */
339
+ secondaryControlBtnTextColor?: string | DataLink
340
+ /* Secondary control button border color */
341
+ secondaryControlBtnBorderColor?: string | DataLink
342
+ /* Warn color */
343
+ warnColor?: string | DataLink
344
+ /* Error color */
345
+ errorColor?: string | DataLink
346
+ }
347
+ events?: {
348
+ /* Event of go next */
349
+ onNextQuestion?: Array<EventAction>
350
+ /* Event of go back */
351
+ onBackQuestion?: Array<EventAction>
352
+ /* Event of change question */
353
+ onQuestionChange?: Array<EventAction>
354
+ /* Event of user close question modal */
355
+ onClose?: Array<EventAction>
356
+ /* Event of warning showed */
357
+ onWarning?: Array<EventAction>
358
+ /* Event of completed inquire */
359
+ onCompleted?: Array<EventAction>
360
+ /* Event of error occured */
361
+ onError?: Array<EventAction>
362
+ }
363
+ outlets?: {
364
+ /* Result data */
365
+ data?: () => Data
366
+ /* Currnet question */
367
+ currectKey?: () => Data
368
+ /* Currnet input value */
369
+ currectValue?: () => Data
370
+ /* Error message */
371
+ errorMessage?: () => Data
372
+ }
373
+ }
374
+
375
+ /* Question inquirer */
376
+ export type GeneratorQuestion = Generator &
377
+ GeneratorQuestionDef & {
378
+ templateKey: 'GENERATOR_QUESTION'
379
+ switches: Array<
380
+ SwitchDef &
381
+ GeneratorQuestionDef & {
382
+ conds?: Array<{
383
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
384
+ cond:
385
+ | SwitchCondInnerStateCurrentCanvas
386
+ | SwitchCondData
387
+ | {
388
+ __typename: 'SwitchCondInnerStateOutlet'
389
+ outlet: 'data' | 'currectKey' | 'currectValue' | 'errorMessage'
390
+ value: any
391
+ }
392
+ }>
393
+ }
394
+ >
395
+ }