@fugood/bricks-project 2.22.0-beta.9 → 2.22.1

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 (85) hide show
  1. package/compile/action-name-map.ts +108 -17
  2. package/compile/index.ts +10 -1
  3. package/package.json +3 -4
  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 +19 -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/Tcp.ts +120 -0
  67. package/types/generators/TcpServer.ts +137 -0
  68. package/types/generators/TextToSpeechGgml.ts +182 -0
  69. package/types/generators/TextToSpeechOnnx.ts +169 -0
  70. package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
  71. package/types/generators/ThermalPrinter.ts +185 -0
  72. package/types/generators/Tick.ts +75 -0
  73. package/types/generators/Udp.ts +109 -0
  74. package/types/generators/VadGgml.ts +211 -0
  75. package/types/generators/VectorStore.ts +223 -0
  76. package/types/generators/Watchdog.ts +96 -0
  77. package/types/generators/WebCrawler.ts +97 -0
  78. package/types/generators/WebRtc.ts +165 -0
  79. package/types/generators/WebSocket.ts +142 -0
  80. package/types/generators/index.ts +50 -0
  81. package/types/system.ts +64 -0
  82. package/utils/data.ts +45 -0
  83. package/utils/event-props.ts +89 -13
  84. package/types/bricks.ts +0 -3168
  85. package/types/generators.ts +0 -7633
package/types/bricks.ts DELETED
@@ -1,3168 +0,0 @@
1
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'
2
- import type { Data, DataLink } from './data'
3
- import type { Animation, AnimationBasicEvents } from './animation'
4
- import type {
5
- Brick,
6
- EventAction,
7
- EventActionForItem,
8
- ActionWithDataParams,
9
- ActionWithParams,
10
- Action,
11
- EventProperty,
12
- } from './common'
13
-
14
- interface BrickBasicProperty {
15
- /* The brick opacity (0 ~ 1) */
16
- opacity?: number | DataLink
17
- /* The brick background color */
18
- backgroundColor?: string | DataLink
19
- /* The brick border style */
20
- borderStyle?: 'solid' | 'dotted' | 'dashed' | DataLink
21
- /* The brick border width (top) */
22
- borderTopSize?: number | DataLink
23
- /* The brick border color (top) */
24
- borderTopColor?: string | DataLink
25
- /* The brick border radius (top left) */
26
- borderTopLeftRadius?: number | DataLink
27
- /* The brick border radius (top right) */
28
- borderTopRightRadius?: number | DataLink
29
- /* The brick border width (bottom) */
30
- borderBottomSize?: number | DataLink
31
- /* The brick border color (bottom) */
32
- borderBottomColor?: string | DataLink
33
- /* The brick border radius (bottom left) */
34
- borderBottomLeftRadius?: number | DataLink
35
- /* The brick border radius (bottom right) */
36
- borderBottomRightRadius?: number | DataLink
37
- /* The brick border width (left) */
38
- borderLeftSize?: number | DataLink
39
- /* The brick border color (bottom) */
40
- borderLeftColor?: string | DataLink
41
- /* The brick border width (right) */
42
- borderRightSize?: number | DataLink
43
- /* The brick border color (right) */
44
- borderRightColor?: string | DataLink
45
- /* The brick rotate (deg) */
46
- rotate?: number | DataLink
47
- /* The brick rotateX (deg) */
48
- rotateX?: number | DataLink
49
- /* The brick rotateY (deg) */
50
- rotateY?: number | DataLink
51
- /* The brick shadow color */
52
- shadowColor?: string | DataLink
53
- /* The brick shadow opacity (0 ~ 1) */
54
- shadowOpacity?: number | DataLink
55
- /* The brick shadow radius */
56
- shadowRadius?: number | DataLink
57
- /* The brick shadow offset width */
58
- shadowOffsetWidth?: number | DataLink
59
- /* The brick shadow offset height */
60
- shadowOffsetHeight?: number | DataLink
61
- /* Brick pressable.
62
- Disabled: Disabled even if event or animation is set.
63
- Bypass: Disable and bypass the touch event on the brick. */
64
- pressable?: 'enabled' | 'disabled' | 'bypass' | DataLink
65
- }
66
-
67
- interface BrickBasicEvents {
68
- showStart?: Array<EventAction>
69
- switchUpdate?: Array<EventAction>
70
- standby?: Array<EventAction>
71
- }
72
-
73
- interface BrickBasicEventsForItem {
74
- showStart?: Array<EventActionForItem>
75
- switchUpdate?: Array<EventActionForItem>
76
- standby?: Array<EventActionForItem>
77
- }
78
-
79
- interface BrickRectDef {
80
- /*
81
- Default property:
82
- {
83
- "linearGradientEnabled": false,
84
- "linearGradientColors": [
85
- "#000000",
86
- "#FFFFFF"
87
- ],
88
- "linearGradientStart": {
89
- "x": 0,
90
- "y": 0
91
- },
92
- "linearGradientEnd": {
93
- "x": 1,
94
- "y": 1
95
- },
96
- "linearGradientLocations": [
97
- 0,
98
- 1
99
- ]
100
- }
101
- */
102
- property?: BrickBasicProperty & {
103
- /* Enables or disables linear gradient */
104
- linearGradientEnabled?: boolean | DataLink
105
- /* An array of at least two color values that represent gradient colors */
106
- linearGradientColors?: Array<string | DataLink> | DataLink
107
- /* An optional object of the following type: { x: number, y: number } */
108
- linearGradientStart?:
109
- | DataLink
110
- | {
111
- x?: number | DataLink
112
- y?: number | DataLink
113
- }
114
- /* Same as start, but for the end of the gradient */
115
- linearGradientEnd?:
116
- | DataLink
117
- | {
118
- x?: number | DataLink
119
- y?: number | DataLink
120
- }
121
- /* An optional array of numbers defining the location of each gradient color stop */
122
- linearGradientLocations?: Array<number | DataLink> | DataLink
123
- }
124
- events?: BrickBasicEvents & {
125
- /* Event of the brick press */
126
- onPress?: Array<EventAction>
127
- /* Event of the brick press in */
128
- onPressIn?: Array<EventAction>
129
- /* Event of the brick press out */
130
- onPressOut?: Array<EventAction>
131
- /* Event of the brick focus (Use TV Device with controller) */
132
- onFocus?: Array<EventAction>
133
- /* Event of the brick blur (Use TV Device with controller) */
134
- onBlur?: Array<EventAction>
135
- }
136
- outlets?: {
137
- /* Brick is pressing */
138
- brickPressing?: () => Data
139
- /* Brick is focusing (Use TV Device with controller) */
140
- brickFocusing?: () => Data
141
- }
142
- animation?: AnimationBasicEvents & {
143
- onPress?: Animation
144
- onPressIn?: Animation
145
- onPressOut?: Animation
146
- onFocus?: Animation
147
- onBlur?: Animation
148
- }
149
- }
150
-
151
- /* Rect brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378573-rect)) */
152
- export type BrickRect = Brick &
153
- BrickRectDef & {
154
- templateKey: 'BRICK_RECT'
155
- switches: Array<
156
- SwitchDef &
157
- BrickRectDef & {
158
- conds?: Array<{
159
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
160
- cond:
161
- | SwitchCondInnerStateCurrentCanvas
162
- | SwitchCondData
163
- | {
164
- __typename: 'SwitchCondInnerStateOutlet'
165
- outlet: 'brickPressing' | 'brickFocusing'
166
- value: any
167
- }
168
- }>
169
- }
170
- >
171
- }
172
-
173
- interface BrickTextDef {
174
- /*
175
- Default property:
176
- {
177
- "text": "",
178
- "templateType": "${}",
179
- "color": "#000",
180
- "fontWeight": "normal",
181
- "fontStyle": "normal",
182
- "fontPadding": true,
183
- "fontSizeVector": 0.5,
184
- "lineNumber": 1,
185
- "textAlign": "center",
186
- "textAlignVertical": "center"
187
- }
188
- */
189
- property?: BrickBasicProperty & {
190
- /* The text content */
191
- text?: string | DataLink | number | DataLink | boolean | DataLink | string | DataLink | DataLink
192
- /* Data to be used in the text template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
193
- templateData?: {} | DataLink
194
- /* The text template type */
195
- templateType?: '${}' | '{{}}' | DataLink
196
- /* The text replacement (Regular Expression), can be multiple. */
197
- replace?:
198
- | Array<
199
- | DataLink
200
- | {
201
- regex?: string | DataLink
202
- replaceWith?: string | DataLink
203
- }
204
- >
205
- | DataLink
206
- /* The text color */
207
- color?: string | DataLink
208
- /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */
209
- fontWeight?:
210
- | 'normal'
211
- | 'bold'
212
- | '100'
213
- | '200'
214
- | '300'
215
- | '400'
216
- | '500'
217
- | '600'
218
- | '700'
219
- | '800'
220
- | '900'
221
- | DataLink
222
- /* The text font style */
223
- fontStyle?: 'normal' | 'italic' | DataLink
224
- /* The text font family */
225
- fontFamily?: string | DataLink
226
- /* [Android only] Set to No to remove extra font padding intended to make space for certain ascenders / descenders. */
227
- fontPadding?: boolean | DataLink
228
- /* The text font size (grid) */
229
- fontSize?: number | DataLink
230
- /* The text font size vector. If the font size is not specified, the font size will be calculated by the height of the text box. */
231
- fontSizeVector?: number | DataLink
232
- /* The text letter spacing (grid) */
233
- letterSpacing?: number | DataLink
234
- /* The line height of text content (grid) */
235
- lineHeight?: number | DataLink
236
- /* The line number limit of text content */
237
- lineNumber?: number | DataLink
238
- /* The text align */
239
- textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink
240
- /* The text align vertical */
241
- textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink
242
- /* Enable vertical rendering */
243
- verticalRendering?: boolean | DataLink
244
- }
245
- events?: BrickBasicEvents & {
246
- /* Event of the brick press */
247
- onPress?: Array<EventAction>
248
- /* Event of the brick press in */
249
- onPressIn?: Array<EventAction>
250
- /* Event of the brick press out */
251
- onPressOut?: Array<EventAction>
252
- /* Event of the brick focus (Use TV Device with controller) */
253
- onFocus?: Array<EventAction>
254
- /* Event of the brick blur (Use TV Device with controller) */
255
- onBlur?: Array<EventAction>
256
- /* Event of the text content on change start */
257
- beforeValueChange?: Array<EventAction>
258
- /* Event of the text content on change end */
259
- valueChange?: Array<EventAction>
260
- }
261
- outlets?: {
262
- /* Brick is pressing */
263
- brickPressing?: () => Data
264
- /* Brick is focusing (Use TV Device with controller) */
265
- brickFocusing?: () => Data
266
- }
267
- animation?: AnimationBasicEvents & {
268
- onPress?: Animation
269
- onPressIn?: Animation
270
- onPressOut?: Animation
271
- onFocus?: Animation
272
- onBlur?: Animation
273
- beforeValueChange?: Animation
274
- valueChange?: Animation
275
- }
276
- }
277
-
278
- /* Text brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378574-text)) */
279
- export type BrickText = Brick &
280
- BrickTextDef & {
281
- templateKey: 'BRICK_TEXT'
282
- switches: Array<
283
- SwitchDef &
284
- BrickTextDef & {
285
- conds?: Array<{
286
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
287
- cond:
288
- | SwitchCondInnerStateCurrentCanvas
289
- | SwitchCondData
290
- | {
291
- __typename: 'SwitchCondInnerStateOutlet'
292
- outlet: 'brickPressing' | 'brickFocusing'
293
- value: any
294
- }
295
- }>
296
- }
297
- >
298
- }
299
-
300
- /* Focus TextInput */
301
- export type BrickTextInputActionFocus = Action & {
302
- __actionName: 'BRICK_TEXT_INPUT_FOCUS'
303
- }
304
-
305
- /* Blur TextInput */
306
- export type BrickTextInputActionBlur = Action & {
307
- __actionName: 'BRICK_TEXT_INPUT_BLUR'
308
- }
309
-
310
- /* Clear TextInput */
311
- export type BrickTextInputActionClear = Action & {
312
- __actionName: 'BRICK_TEXT_INPUT_CLEAR'
313
- }
314
-
315
- /* Reset TextInput to default value */
316
- export type BrickTextInputActionResetToDefault = Action & {
317
- __actionName: 'BRICK_TEXT_INPUT_RESET_TO_DEFAULT'
318
- }
319
-
320
- /* Focus the input and select text with regex or start/end */
321
- export type BrickTextInputActionSelectText = ActionWithParams & {
322
- __actionName: 'BRICK_TEXT_INPUT_SELECT_TEXT'
323
- params?: Array<
324
- | {
325
- input: 'regex'
326
- value?: string | DataLink | EventProperty
327
- mapping?: string
328
- }
329
- | {
330
- input: 'start'
331
- value?: number | DataLink | EventProperty
332
- mapping?: string
333
- }
334
- | {
335
- input: 'end'
336
- value?: number | DataLink | EventProperty
337
- mapping?: string
338
- }
339
- >
340
- }
341
-
342
- /* Set text value of the TextInput */
343
- export type BrickTextInputActionSetText = ActionWithParams & {
344
- __actionName: 'BRICK_TEXT_INPUT_SET_TEXT'
345
- params?: Array<{
346
- input: 'text'
347
- value?: string | DataLink | EventProperty
348
- mapping?: string
349
- }>
350
- }
351
-
352
- /* Append text value of the TextInput */
353
- export type BrickTextInputActionAppendText = ActionWithParams & {
354
- __actionName: 'BRICK_TEXT_INPUT_APPEND_TEXT'
355
- params?: Array<{
356
- input: 'text'
357
- value?: string | DataLink | EventProperty
358
- mapping?: string
359
- }>
360
- }
361
-
362
- /* Trigger regex */
363
- export type BrickTextInputActionTrySubmit = Action & {
364
- __actionName: 'BRICK_TEXT_INPUT_TRY_SUBMIT'
365
- }
366
-
367
- interface BrickTextInputDef {
368
- /*
369
- Default property:
370
- {
371
- "editable": true,
372
- "defaultValue": "",
373
- "color": "#000",
374
- "fontWeight": "normal",
375
- "fontStyle": "normal",
376
- "fontSizeVector": 0.5,
377
- "lineNumber": 1,
378
- "textAlign": "center",
379
- "textAlignVertical": "center",
380
- "keyboardType": "default",
381
- "returnKeyType": "done"
382
- }
383
- */
384
- property?: BrickBasicProperty & {
385
- /* Allow to edit */
386
- editable?: boolean | DataLink
387
- /* The default value of the text input */
388
- defaultValue?: string | DataLink
389
- /* The text color */
390
- color?: string | DataLink
391
- /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */
392
- fontWeight?:
393
- | 'normal'
394
- | 'bold'
395
- | '100'
396
- | '200'
397
- | '300'
398
- | '400'
399
- | '500'
400
- | '600'
401
- | '700'
402
- | '800'
403
- | '900'
404
- | DataLink
405
- /* The text font style */
406
- fontStyle?: 'normal' | 'italic' | DataLink
407
- /* The text font family */
408
- fontFamily?: string | DataLink
409
- /* The text font size (grid) */
410
- fontSize?: number | DataLink
411
- /* The text font size vector. If the font size is not specified, the font size will be calculated by the height of the text box. */
412
- fontSizeVector?: number | DataLink
413
- /* The text letter spacing (grid) */
414
- letterSpacing?: number | DataLink
415
- /* The line height of text content (grid) */
416
- lineHeight?: number | DataLink
417
- /* The line number limit of text content (Use 0 to unlimited) */
418
- lineNumber?: number | DataLink
419
- /* The text align */
420
- textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink
421
- /* The text align vertical */
422
- textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink
423
- /* The placeholder text */
424
- placeholder?: string | DataLink
425
- /* Color of the placeholder text */
426
- placeholderTextColor?: string | DataLink
427
- /* Limits the maximum number of characters that can be entered */
428
- maxLength?: number | DataLink
429
- /* The virtual keyboard type */
430
- keyboardType?:
431
- | 'default'
432
- | 'number-pad'
433
- | 'decimal-pad'
434
- | 'numeric'
435
- | 'email-address'
436
- | 'phone-pad'
437
- | DataLink
438
- /* The virtual keyboard return key type The line number should be 1. */
439
- returnKeyType?: 'done' | 'go' | 'next' | 'search' | 'send' | DataLink
440
- /* Trigger event on input change after debounce time */
441
- debounce?: number | DataLink
442
- /* Regular Expression to match */
443
- regex?: string | DataLink
444
- /* The regex matching complete mode */
445
- completeMode?: 'allMatch' | 'oneMatch' | DataLink
446
- /* Auto submit when regex match */
447
- autoSubmitWhenMatch?: boolean | DataLink
448
- /* Blur TextInput on submit */
449
- blurOnSubmit?: boolean | DataLink
450
- }
451
- events?: BrickBasicEvents & {
452
- /* Event of the TextInput is focused */
453
- onFocus?: Array<EventAction>
454
- /* Event of the input field is blurred */
455
- onBlur?: Array<EventAction>
456
- /* Event of the TextInput is empty */
457
- onEmpty?: Array<EventAction>
458
- /* Event of the TextInput value change */
459
- onChange?: Array<EventAction>
460
- /* Event of the TextInput submit */
461
- onSubmit?: Array<EventAction>
462
- /* Event of the TextInput match regex (check every value change) */
463
- onMatch?: Array<EventAction>
464
- /* Event of the TextInput not match regex (check every value change) */
465
- onNotMatch?: Array<EventAction>
466
- /* Event of the TextInput not match regex (check every submit) */
467
- onResultNotMatch?: Array<EventAction>
468
- /* Event of the TextInput reach max length or match regex */
469
- onFullFill?: Array<EventAction>
470
- }
471
- outlets?: {
472
- /* The raw input */
473
- rawInput?: () => Data
474
- /* The regex result */
475
- resultVariable?: () => Data
476
- /* Last key in */
477
- lastKey?: () => Data
478
- /* Selection of the TextInput (start, end, text) */
479
- selection?: () => Data
480
- /* Selection text of the TextInput */
481
- selectionText?: () => Data
482
- }
483
- animation?: AnimationBasicEvents & {
484
- onFocus?: Animation
485
- onBlur?: Animation
486
- onEmpty?: Animation
487
- onChange?: Animation
488
- onSubmit?: Animation
489
- onMatch?: Animation
490
- onNotMatch?: Animation
491
- onResultNotMatch?: Animation
492
- onFullFill?: Animation
493
- }
494
- }
495
-
496
- /* Text Input brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378575-text-input)) */
497
- export type BrickTextInput = Brick &
498
- BrickTextInputDef & {
499
- templateKey: 'BRICK_TEXT_INPUT'
500
- switches: Array<
501
- SwitchDef &
502
- BrickTextInputDef & {
503
- conds?: Array<{
504
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
505
- cond:
506
- | SwitchCondInnerStateCurrentCanvas
507
- | SwitchCondData
508
- | {
509
- __typename: 'SwitchCondInnerStateOutlet'
510
- outlet: 'rawInput' | 'resultVariable' | 'lastKey' | 'selection' | 'selectionText'
511
- value: any
512
- }
513
- }>
514
- }
515
- >
516
- }
517
-
518
- interface BrickRichTextDef {
519
- /*
520
- Default property:
521
- {
522
- "content": "",
523
- "renderImage": false,
524
- "color": "#000",
525
- "fontWeight": "normal",
526
- "fontStyle": "normal",
527
- "fontSizes": {
528
- "base": 3,
529
- "h1": 6.857142857142857,
530
- "h2": 5.714285714285714,
531
- "h3": 4.011428571428572,
532
- "h4": 3.428571428571429,
533
- "h5": 2.845714285714286,
534
- "h6": 2.285714285714286
535
- }
536
- }
537
- */
538
- property?: BrickBasicProperty & {
539
- /* The text content */
540
- content?: string | DataLink
541
- /* Render Image */
542
- renderImage?: boolean | DataLink
543
- /* The text color */
544
- color?: string | DataLink
545
- /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */
546
- fontWeight?:
547
- | 'normal'
548
- | 'bold'
549
- | '100'
550
- | '200'
551
- | '300'
552
- | '400'
553
- | '500'
554
- | '600'
555
- | '700'
556
- | '800'
557
- | '900'
558
- | DataLink
559
- /* The text font style */
560
- fontStyle?: 'normal' | 'italic' | DataLink
561
- /* The text font family */
562
- fontFamily?: string | DataLink
563
- /* The text font size definition (base and headers) */
564
- fontSizes?:
565
- | DataLink
566
- | {
567
- base?: number | DataLink // BRICKS Grid unit
568
- h1?: number | DataLink // BRICKS Grid unit
569
- h2?: number | DataLink // BRICKS Grid unit
570
- h3?: number | DataLink // BRICKS Grid unit
571
- h4?: number | DataLink // BRICKS Grid unit
572
- h5?: number | DataLink // BRICKS Grid unit
573
- h6?: number | DataLink // BRICKS Grid unit
574
- }
575
- }
576
- events?: BrickBasicEvents & {
577
- /* Event of the brick press */
578
- onPress?: Array<EventAction>
579
- /* Event of the brick press in */
580
- onPressIn?: Array<EventAction>
581
- /* Event of the brick press out */
582
- onPressOut?: Array<EventAction>
583
- /* Event of the brick focus (Use TV Device with controller) */
584
- onFocus?: Array<EventAction>
585
- /* Event of the brick blur (Use TV Device with controller) */
586
- onBlur?: Array<EventAction>
587
- }
588
- outlets?: {
589
- /* Brick is pressing */
590
- brickPressing?: () => Data
591
- /* Brick is focusing (Use TV Device with controller) */
592
- brickFocusing?: () => Data
593
- }
594
- animation?: AnimationBasicEvents & {
595
- onPress?: Animation
596
- onPressIn?: Animation
597
- onPressOut?: Animation
598
- onFocus?: Animation
599
- onBlur?: Animation
600
- }
601
- }
602
-
603
- /* RichText brick */
604
- export type BrickRichText = Brick &
605
- BrickRichTextDef & {
606
- templateKey: 'BRICK_RICH_TEXT'
607
- switches: Array<
608
- SwitchDef &
609
- BrickRichTextDef & {
610
- conds?: Array<{
611
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
612
- cond:
613
- | SwitchCondInnerStateCurrentCanvas
614
- | SwitchCondData
615
- | {
616
- __typename: 'SwitchCondInnerStateOutlet'
617
- outlet: 'brickPressing' | 'brickFocusing'
618
- value: any
619
- }
620
- }>
621
- }
622
- >
623
- }
624
-
625
- interface BrickImageDef {
626
- /*
627
- Default property:
628
- {
629
- "path": "",
630
- "fadeDuration": 0,
631
- "blurBackgroundRadius": 8,
632
- "loadSystemIos": "auto",
633
- "loadSystemAndroid": "auto"
634
- }
635
- */
636
- property?: BrickBasicProperty & {
637
- /* The image resize mode */
638
- resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
639
- /* The image file path (File, URL) */
640
- path?: string | DataLink
641
- /* The checksum of file */
642
- md5?: string | DataLink
643
- /* The image fade duration */
644
- fadeDuration?: number | DataLink
645
- /* The image avatar mode */
646
- avatar?: boolean | DataLink
647
- /* The image fixed width with `avatar` */
648
- width?: number | DataLink
649
- /* Add blurred image at background if photo is not full */
650
- enableBlurBackground?: boolean | DataLink
651
- /* The blur radius of the blur filter added to the image background */
652
- blurBackgroundRadius?: number | DataLink
653
- /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
654
- loadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
655
- /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
656
- loadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
657
- }
658
- events?: BrickBasicEvents & {
659
- /* Event of the brick press */
660
- onPress?: Array<EventAction>
661
- /* Event of the brick press in */
662
- onPressIn?: Array<EventAction>
663
- /* Event of the brick press out */
664
- onPressOut?: Array<EventAction>
665
- /* Event of the brick focus (Use TV Device with controller) */
666
- onFocus?: Array<EventAction>
667
- /* Event of the brick blur (Use TV Device with controller) */
668
- onBlur?: Array<EventAction>
669
- /* Event of the image on load */
670
- onLoad?: Array<EventAction>
671
- /* Event of the image on error */
672
- onError?: Array<EventAction>
673
- }
674
- outlets?: {
675
- /* Brick is pressing */
676
- brickPressing?: () => Data
677
- /* Brick is focusing (Use TV Device with controller) */
678
- brickFocusing?: () => Data
679
- }
680
- animation?: AnimationBasicEvents & {
681
- onPress?: Animation
682
- onPressIn?: Animation
683
- onPressOut?: Animation
684
- onFocus?: Animation
685
- onBlur?: Animation
686
- onLoad?: Animation
687
- onError?: Animation
688
- }
689
- }
690
-
691
- /* Image brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378576-image)) */
692
- export type BrickImage = Brick &
693
- BrickImageDef & {
694
- templateKey: 'BRICK_IMAGE'
695
- switches: Array<
696
- SwitchDef &
697
- BrickImageDef & {
698
- conds?: Array<{
699
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
700
- cond:
701
- | SwitchCondInnerStateCurrentCanvas
702
- | SwitchCondData
703
- | {
704
- __typename: 'SwitchCondInnerStateOutlet'
705
- outlet: 'brickPressing' | 'brickFocusing'
706
- value: any
707
- }
708
- }>
709
- }
710
- >
711
- }
712
-
713
- interface BrickSvgDef {
714
- /*
715
- Default property:
716
- {
717
- "source": "",
718
- "uri": "",
719
- "renderMode": "general"
720
- }
721
- */
722
- property?: BrickBasicProperty & {
723
- /* The SVG XML content */
724
- source?: string | DataLink
725
- /* The svg source location (URL or LocalPath) */
726
- uri?: string | DataLink
727
- /* The checksum of file */
728
- md5?: string | DataLink
729
- /* The rules of replacing origin colour */
730
- colorMapping?:
731
- | Array<
732
- | DataLink
733
- | {
734
- findItem?: string | DataLink
735
- replaceItem?: string | DataLink
736
- }
737
- >
738
- | DataLink
739
- /* The render mode */
740
- renderMode?: 'general' | 'legacy' | DataLink
741
- }
742
- events?: BrickBasicEvents & {
743
- /* Event of the brick press */
744
- onPress?: Array<EventAction>
745
- /* Event of the brick press in */
746
- onPressIn?: Array<EventAction>
747
- /* Event of the brick press out */
748
- onPressOut?: Array<EventAction>
749
- /* Event of the brick focus (Use TV Device with controller) */
750
- onFocus?: Array<EventAction>
751
- /* Event of the brick blur (Use TV Device with controller) */
752
- onBlur?: Array<EventAction>
753
- }
754
- outlets?: {
755
- /* Brick is pressing */
756
- brickPressing?: () => Data
757
- /* Brick is focusing (Use TV Device with controller) */
758
- brickFocusing?: () => Data
759
- }
760
- animation?: AnimationBasicEvents & {
761
- onPress?: Animation
762
- onPressIn?: Animation
763
- onPressOut?: Animation
764
- onFocus?: Animation
765
- onBlur?: Animation
766
- }
767
- }
768
-
769
- /* SVG is an XML-based vector image format for 2D graphics */
770
- export type BrickSvg = Brick &
771
- BrickSvgDef & {
772
- templateKey: 'BRICK_SVG'
773
- switches: Array<
774
- SwitchDef &
775
- BrickSvgDef & {
776
- conds?: Array<{
777
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
778
- cond:
779
- | SwitchCondInnerStateCurrentCanvas
780
- | SwitchCondData
781
- | {
782
- __typename: 'SwitchCondInnerStateOutlet'
783
- outlet: 'brickPressing' | 'brickFocusing'
784
- value: any
785
- }
786
- }>
787
- }
788
- >
789
- }
790
-
791
- interface BrickIconDef {
792
- /*
793
- Default property:
794
- {}
795
- */
796
- property?: BrickBasicProperty & {
797
- /* Select icon */
798
- icon?:
799
- | DataLink
800
- | {
801
- type?:
802
- | 'solid'
803
- | 'regular'
804
- | 'light'
805
- | 'duotone'
806
- | 'thin'
807
- | 'brands'
808
- | 'sharpSolid'
809
- | 'sharpLight'
810
- | 'sharpRegular'
811
- | DataLink
812
- name?: string | DataLink
813
- }
814
- /* Icon main color */
815
- color?: string | DataLink
816
- /* Icon secondary color (For Duotone type) */
817
- secondaryColor?: string | DataLink
818
- }
819
- events?: BrickBasicEvents & {
820
- /* Event of the brick press */
821
- onPress?: Array<EventAction>
822
- /* Event of the brick press in */
823
- onPressIn?: Array<EventAction>
824
- /* Event of the brick press out */
825
- onPressOut?: Array<EventAction>
826
- /* Event of the brick focus (Use TV Device with controller) */
827
- onFocus?: Array<EventAction>
828
- /* Event of the brick blur (Use TV Device with controller) */
829
- onBlur?: Array<EventAction>
830
- }
831
- outlets?: {
832
- /* Brick is pressing */
833
- brickPressing?: () => Data
834
- /* Brick is focusing (Use TV Device with controller) */
835
- brickFocusing?: () => Data
836
- }
837
- animation?: AnimationBasicEvents & {
838
- onPress?: Animation
839
- onPressIn?: Animation
840
- onPressOut?: Animation
841
- onFocus?: Animation
842
- onBlur?: Animation
843
- }
844
- }
845
-
846
- /* Icon brick */
847
- export type BrickIcon = Brick &
848
- BrickIconDef & {
849
- templateKey: 'BRICK_ICON'
850
- switches: Array<
851
- SwitchDef &
852
- BrickIconDef & {
853
- conds?: Array<{
854
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
855
- cond:
856
- | SwitchCondInnerStateCurrentCanvas
857
- | SwitchCondData
858
- | {
859
- __typename: 'SwitchCondInnerStateOutlet'
860
- outlet: 'brickPressing' | 'brickFocusing'
861
- value: any
862
- }
863
- }>
864
- }
865
- >
866
- }
867
-
868
- interface BrickVideoDef {
869
- /*
870
- Default property:
871
- {
872
- "paused": false,
873
- "volume": 100,
874
- "muted": false,
875
- "progressUpdateInterval": 1000,
876
- "replayTimeout": 500,
877
- "renderMode": "auto"
878
- }
879
- */
880
- property?: BrickBasicProperty & {
881
- /* The video path list or single path (File, URL) */
882
- path?:
883
- | string
884
- | DataLink
885
- | DataLink
886
- | {
887
- url?: string | DataLink
888
- }
889
- | Array<
890
- | DataLink
891
- | {
892
- url?: string | DataLink
893
- }
894
- | string
895
- | DataLink
896
- | DataLink
897
- >
898
- | DataLink
899
- | DataLink
900
- /* The checksum of file */
901
- md5?: string | DataLink
902
- /* Controls whether the video is paused */
903
- paused?: boolean | DataLink
904
- /* Volume */
905
- volume?: number | DataLink
906
- /* Muted */
907
- muted?: boolean | DataLink
908
- /* Video resize mode */
909
- resizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
910
- /* Repeat the video path list */
911
- repeat?: boolean | DataLink
912
- /* Progress Update Interval */
913
- progressUpdateInterval?: number | DataLink
914
- /* Replay on playing error */
915
- replayOnError?: boolean | DataLink
916
- /* Timeout to replay if repeat or replayOnError is true and video is end or error */
917
- replayTimeout?: number | DataLink
918
- /* Use what view type for render video (Auto / Texture or Surface). Notice: Although using surface has better performance, it also affects the Animation & Standby Transition used by itself */
919
- renderMode?: 'auto' | 'texture' | 'surface' | DataLink
920
- }
921
- events?: BrickBasicEvents & {
922
- /* Event of the brick press */
923
- onPress?: Array<EventAction>
924
- /* Event of the brick press in */
925
- onPressIn?: Array<EventAction>
926
- /* Event of the brick press out */
927
- onPressOut?: Array<EventAction>
928
- /* Event of the brick focus (Use TV Device with controller) */
929
- onFocus?: Array<EventAction>
930
- /* Event of the brick blur (Use TV Device with controller) */
931
- onBlur?: Array<EventAction>
932
- /* Event of the next video on change start */
933
- nextVideo?: Array<EventAction>
934
- /* Event on plays of path are totally end */
935
- roundEnd?: Array<EventAction>
936
- /* Event on video load */
937
- onLoad?: Array<EventAction>
938
- /* Event of the video playing error */
939
- onError?: Array<EventAction>
940
- /* Event of the video progress interval */
941
- onProgress?: Array<EventAction>
942
- }
943
- outlets?: {
944
- /* Brick is pressing */
945
- brickPressing?: () => Data
946
- /* Brick is focusing (Use TV Device with controller) */
947
- brickFocusing?: () => Data
948
- }
949
- animation?: AnimationBasicEvents & {
950
- onPress?: Animation
951
- onPressIn?: Animation
952
- onPressOut?: Animation
953
- onFocus?: Animation
954
- onBlur?: Animation
955
- nextVideo?: Animation
956
- roundEnd?: Animation
957
- onLoad?: Animation
958
- onError?: Animation
959
- onProgress?: Animation
960
- }
961
- }
962
-
963
- /* Video brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378577-video)) */
964
- export type BrickVideo = Brick &
965
- BrickVideoDef & {
966
- templateKey: 'BRICK_VIDEO'
967
- switches: Array<
968
- SwitchDef &
969
- BrickVideoDef & {
970
- conds?: Array<{
971
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
972
- cond:
973
- | SwitchCondInnerStateCurrentCanvas
974
- | SwitchCondData
975
- | {
976
- __typename: 'SwitchCondInnerStateOutlet'
977
- outlet: 'brickPressing' | 'brickFocusing'
978
- value: any
979
- }
980
- }>
981
- }
982
- >
983
- }
984
-
985
- interface BrickVideoStreamingDef {
986
- /*
987
- Default property:
988
- {
989
- "networkCaching": 300,
990
- "paused": false,
991
- "volume": 100,
992
- "muted": false,
993
- "replayTimeout": 500
994
- }
995
- */
996
- property?: BrickBasicProperty & {
997
- /* The video path list or single path (File, URL) */
998
- uri?: string | DataLink
999
- /* Set cache time from streaming (You can adjust according to network conditions), it will delay the playing. */
1000
- networkCaching?: number | DataLink
1001
- /* Controls whether the video is paused */
1002
- paused?: boolean | DataLink
1003
- /* Volume */
1004
- volume?: number | DataLink
1005
- /* Muted */
1006
- muted?: boolean | DataLink
1007
- /* Video Auto Aspect Ratio */
1008
- autoAspectRatio?: boolean | DataLink
1009
- /* Video Aspect Ratio */
1010
- aspectRatio?: string | DataLink
1011
- /* Repeat the video path list */
1012
- repeat?: boolean | DataLink
1013
- /* Replay on playing error */
1014
- replayOnError?: boolean | DataLink
1015
- /* Timeout to replay if repeat or replayOnError is true and video is end or error */
1016
- replayTimeout?: number | DataLink
1017
- }
1018
- events?: BrickBasicEvents & {
1019
- /* Event of the brick press */
1020
- onPress?: Array<EventAction>
1021
- /* Event of the brick press in */
1022
- onPressIn?: Array<EventAction>
1023
- /* Event of the brick press out */
1024
- onPressOut?: Array<EventAction>
1025
- /* Event of the brick focus (Use TV Device with controller) */
1026
- onFocus?: Array<EventAction>
1027
- /* Event of the brick blur (Use TV Device with controller) */
1028
- onBlur?: Array<EventAction>
1029
- /* Event on plays of path are end */
1030
- onEnd?: Array<EventAction>
1031
- /* Event on plays of path are end */
1032
- onLoad?: Array<EventAction>
1033
- /* Event of the video playing error */
1034
- onError?: Array<EventAction>
1035
- }
1036
- outlets?: {
1037
- /* Brick is pressing */
1038
- brickPressing?: () => Data
1039
- /* Brick is focusing (Use TV Device with controller) */
1040
- brickFocusing?: () => Data
1041
- }
1042
- animation?: AnimationBasicEvents & {
1043
- onPress?: Animation
1044
- onPressIn?: Animation
1045
- onPressOut?: Animation
1046
- onFocus?: Animation
1047
- onBlur?: Animation
1048
- onEnd?: Animation
1049
- onLoad?: Animation
1050
- onError?: Animation
1051
- }
1052
- }
1053
-
1054
- /* Brick video streaming component, supports RTSP / RTMP streaming. */
1055
- export type BrickVideoStreaming = Brick &
1056
- BrickVideoStreamingDef & {
1057
- templateKey: 'BRICK_VIDEO_STREAMING'
1058
- switches: Array<
1059
- SwitchDef &
1060
- BrickVideoStreamingDef & {
1061
- conds?: Array<{
1062
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1063
- cond:
1064
- | SwitchCondInnerStateCurrentCanvas
1065
- | SwitchCondData
1066
- | {
1067
- __typename: 'SwitchCondInnerStateOutlet'
1068
- outlet: 'brickPressing' | 'brickFocusing'
1069
- value: any
1070
- }
1071
- }>
1072
- }
1073
- >
1074
- }
1075
-
1076
- interface BrickQrcodeDef {
1077
- /*
1078
- Default property:
1079
- {
1080
- "value": "",
1081
- "positiveColor": "#1e252a",
1082
- "negativeColor": "transparent",
1083
- "padding": 0,
1084
- "linearGradientEnabled": false,
1085
- "linearGradientStart": "black",
1086
- "linearGradientEnd": "black",
1087
- "linearGradientDirection": [
1088
- "0%",
1089
- "0%",
1090
- "100%",
1091
- "100%"
1092
- ],
1093
- "logoSize": 20,
1094
- "logoBackgroundColor": "transparent"
1095
- }
1096
- */
1097
- property?: BrickBasicProperty & {
1098
- /* The QRCode content */
1099
- value?: string | DataLink
1100
- /* The foreground color of QRCode */
1101
- positiveColor?: string | DataLink
1102
- /* The background color of QRCode */
1103
- negativeColor?: string | DataLink
1104
- /* Quiet zone around the qr */
1105
- padding?: number | DataLink
1106
- /* Enables or disables linear gradient */
1107
- linearGradientEnabled?: boolean | DataLink
1108
- /* Linear gradient start color */
1109
- linearGradientStart?: string | DataLink
1110
- /* Linear gradient end color */
1111
- linearGradientEnd?: string | DataLink
1112
- /* Linear gradient direction ('0%', '0%', '100%', '100%') */
1113
- linearGradientDirection?: Array<string | DataLink> | DataLink
1114
- /* Logo image source */
1115
- logoPath?: string | DataLink
1116
- /* The checksum of logo file */
1117
- md5?: string | DataLink
1118
- /* Logo image size (% of QRCode) */
1119
- logoSize?: number | DataLink
1120
- /* The logo gets a filled quadratic background with this color. */
1121
- logoBackgroundColor?: string | DataLink
1122
- }
1123
- events?: BrickBasicEvents & {
1124
- /* Event of the brick press */
1125
- onPress?: Array<EventAction>
1126
- /* Event of the brick press in */
1127
- onPressIn?: Array<EventAction>
1128
- /* Event of the brick press out */
1129
- onPressOut?: Array<EventAction>
1130
- /* Event of the brick focus (Use TV Device with controller) */
1131
- onFocus?: Array<EventAction>
1132
- /* Event of the brick blur (Use TV Device with controller) */
1133
- onBlur?: Array<EventAction>
1134
- }
1135
- outlets?: {
1136
- /* Brick is pressing */
1137
- brickPressing?: () => Data
1138
- /* Brick is focusing (Use TV Device with controller) */
1139
- brickFocusing?: () => Data
1140
- }
1141
- animation?: AnimationBasicEvents & {
1142
- onPress?: Animation
1143
- onPressIn?: Animation
1144
- onPressOut?: Animation
1145
- onFocus?: Animation
1146
- onBlur?: Animation
1147
- }
1148
- }
1149
-
1150
- /* QRCode brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378579-qr-code)) */
1151
- export type BrickQrcode = Brick &
1152
- BrickQrcodeDef & {
1153
- templateKey: 'BRICK_QRCODE'
1154
- switches: Array<
1155
- SwitchDef &
1156
- BrickQrcodeDef & {
1157
- conds?: Array<{
1158
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1159
- cond:
1160
- | SwitchCondInnerStateCurrentCanvas
1161
- | SwitchCondData
1162
- | {
1163
- __typename: 'SwitchCondInnerStateOutlet'
1164
- outlet: 'brickPressing' | 'brickFocusing'
1165
- value: any
1166
- }
1167
- }>
1168
- }
1169
- >
1170
- }
1171
-
1172
- /* Jump to a specific index in the slideshow */
1173
- export type BrickSlideshowActionJumpToIndex = ActionWithParams & {
1174
- __actionName: 'BRICK_SLIDESHOW_JUMP_TO_INDEX'
1175
- params?: Array<
1176
- | {
1177
- input: 'index'
1178
- value?: number | DataLink | EventProperty
1179
- mapping?: string
1180
- }
1181
- | {
1182
- input: 'reset'
1183
- value?: boolean | DataLink | EventProperty
1184
- mapping?: string
1185
- }
1186
- | {
1187
- input: 'shuffle'
1188
- value?: boolean | DataLink | EventProperty
1189
- mapping?: string
1190
- }
1191
- >
1192
- }
1193
-
1194
- interface BrickSlideshowDef {
1195
- /*
1196
- Default property:
1197
- {
1198
- "countdown": 2000,
1199
- "loop": true,
1200
- "shuffle": false,
1201
- "videoVolume": 100,
1202
- "emptyViewText": "no available image item to show",
1203
- "emptyViewTextSize": 44,
1204
- "emptyViewTextColor": "#fff",
1205
- "blurBackgroundRadius": 8
1206
- }
1207
- */
1208
- property?: BrickBasicProperty & {
1209
- /* The time interval of show for each photo */
1210
- countdown?: number | DataLink
1211
- /* The slideshow media path list (File, URL) */
1212
- paths?:
1213
- | Array<
1214
- | DataLink
1215
- | {
1216
- url?: string | DataLink
1217
- mediaType?: 'video' | 'video-streaming' | 'photo' | DataLink
1218
- photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
1219
- photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
1220
- photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
1221
- videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
1222
- videoAutoAspectRatio?: boolean | DataLink
1223
- videoAspectRatio?: string | DataLink
1224
- videoVolume?: number | DataLink
1225
- videoMuted?: boolean | DataLink
1226
- videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink
1227
- }
1228
- >
1229
- | DataLink
1230
- /* Multiple slideshow media path lists to combine (Array of path arrays) */
1231
- pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
1232
- /* Loop the slideshow */
1233
- loop?: boolean | DataLink
1234
- /* Shuffle the slideshow */
1235
- shuffle?: boolean | DataLink
1236
- /* Slideshow Photo resize mode */
1237
- photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
1238
- /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
1239
- photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
1240
- /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
1241
- photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
1242
- /* Slideshow Video resize mode */
1243
- videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
1244
- /* Video Auto Aspect Ratio for use Video Streaming */
1245
- videoAutoAspectRatio?: boolean | DataLink
1246
- /* Video Aspect Ratio for use Video Streaming */
1247
- videoAspectRatio?: string | DataLink
1248
- /* Video Volume */
1249
- videoVolume?: number | DataLink
1250
- /* Video Muted */
1251
- videoMuted?: boolean | DataLink
1252
- /* [Android only] Use what view type for render video (Auto / Texture or Surface). Notice: Although using surface has better performance, it also affects the Animation & Standby Transition used by itself */
1253
- videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink
1254
- /* The photo fade duration */
1255
- fadeDuration?: number | DataLink
1256
- /* Show text content if path list is empty */
1257
- emptyViewText?: string | DataLink
1258
- /* The font size of shown text content if path list is empty */
1259
- emptyViewTextSize?: number | DataLink
1260
- /* The color of shown text content if path list is empty */
1261
- emptyViewTextColor?: string | DataLink
1262
- /* Show emptyViewText when timeout and paths is empty */
1263
- emptyViewTimeout?: number | DataLink
1264
- /* The blur radius of the blur filter added to the image */
1265
- blurRadius?: number | DataLink
1266
- /* Add blurred image at background if photo is not full */
1267
- enableBlurBackground?: boolean | DataLink
1268
- /* The blur radius of the blur filter added to the image background */
1269
- blurBackgroundRadius?: number | DataLink
1270
- }
1271
- events?: BrickBasicEvents & {
1272
- /* Event of the next slideshow on change start */
1273
- changeStart?: Array<EventAction>
1274
- /* Event of the next slideshow on change end */
1275
- changeEnd?: Array<EventAction>
1276
- /* Event on paths change */
1277
- contentChange?: Array<EventAction>
1278
- /* Event on plays of paths are end */
1279
- roundEnd?: Array<EventAction>
1280
- /* Event of the slideshow on load */
1281
- mediaOnLoad?: Array<EventAction>
1282
- }
1283
- animation?: AnimationBasicEvents & {
1284
- changeStart?: Animation
1285
- changeEnd?: Animation
1286
- contentChange?: Animation
1287
- roundEnd?: Animation
1288
- mediaOnLoad?: Animation
1289
- }
1290
- }
1291
-
1292
- /* Slideshow brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378580-slideshow)) */
1293
- export type BrickSlideshow = Brick &
1294
- BrickSlideshowDef & {
1295
- templateKey: 'BRICK_SLIDESHOW'
1296
- switches: Array<
1297
- SwitchDef &
1298
- BrickSlideshowDef & {
1299
- conds?: Array<{
1300
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1301
- cond:
1302
- | SwitchCondInnerStateCurrentCanvas
1303
- | SwitchCondData
1304
- | {
1305
- __typename: 'SwitchCondInnerStateOutlet'
1306
- outlet: ''
1307
- value: any
1308
- }
1309
- }>
1310
- }
1311
- >
1312
- }
1313
-
1314
- /* Data highlight */
1315
- export type BrickChartActionDataHighlight = ActionWithParams & {
1316
- __actionName: 'BRICK_CHART_DATA_HIGHLIGHT'
1317
- params?: Array<
1318
- | {
1319
- input: 'seriesName'
1320
- value?: string | DataLink | EventProperty
1321
- mapping?: string
1322
- }
1323
- | {
1324
- input: 'seriesId'
1325
- value?: string | DataLink | EventProperty
1326
- mapping?: string
1327
- }
1328
- | {
1329
- input: 'seriesIndex'
1330
- value?: number | DataLink | EventProperty
1331
- mapping?: string
1332
- }
1333
- | {
1334
- input: 'dataIndex'
1335
- value?: number | DataLink | EventProperty
1336
- mapping?: string
1337
- }
1338
- | {
1339
- input: 'name'
1340
- value?: string | DataLink | EventProperty
1341
- mapping?: string
1342
- }
1343
- >
1344
- }
1345
-
1346
- /* Data downplay */
1347
- export type BrickChartActionDataDownplay = ActionWithParams & {
1348
- __actionName: 'BRICK_CHART_DATA_DOWNPLAY'
1349
- params?: Array<
1350
- | {
1351
- input: 'seriesName'
1352
- value?: string | DataLink | EventProperty
1353
- mapping?: string
1354
- }
1355
- | {
1356
- input: 'seriesId'
1357
- value?: string | DataLink | EventProperty
1358
- mapping?: string
1359
- }
1360
- | {
1361
- input: 'seriesIndex'
1362
- value?: number | DataLink | EventProperty
1363
- mapping?: string
1364
- }
1365
- | {
1366
- input: 'dataIndex'
1367
- value?: number | DataLink | EventProperty
1368
- mapping?: string
1369
- }
1370
- | {
1371
- input: 'name'
1372
- value?: string | DataLink | EventProperty
1373
- mapping?: string
1374
- }
1375
- >
1376
- }
1377
-
1378
- /* Data select */
1379
- export type BrickChartActionDataSelect = ActionWithParams & {
1380
- __actionName: 'BRICK_CHART_DATA_SELECT'
1381
- params?: Array<
1382
- | {
1383
- input: 'seriesName'
1384
- value?: string | DataLink | EventProperty
1385
- mapping?: string
1386
- }
1387
- | {
1388
- input: 'seriesId'
1389
- value?: string | DataLink | EventProperty
1390
- mapping?: string
1391
- }
1392
- | {
1393
- input: 'seriesIndex'
1394
- value?: number | DataLink | EventProperty
1395
- mapping?: string
1396
- }
1397
- | {
1398
- input: 'dataIndex'
1399
- value?: number | DataLink | EventProperty
1400
- mapping?: string
1401
- }
1402
- | {
1403
- input: 'name'
1404
- value?: string | DataLink | EventProperty
1405
- mapping?: string
1406
- }
1407
- >
1408
- }
1409
-
1410
- /* Data unselect */
1411
- export type BrickChartActionDataUnselect = ActionWithParams & {
1412
- __actionName: 'BRICK_CHART_DATA_UNSELECT'
1413
- params?: Array<
1414
- | {
1415
- input: 'seriesName'
1416
- value?: string | DataLink | EventProperty
1417
- mapping?: string
1418
- }
1419
- | {
1420
- input: 'seriesId'
1421
- value?: string | DataLink | EventProperty
1422
- mapping?: string
1423
- }
1424
- | {
1425
- input: 'seriesIndex'
1426
- value?: number | DataLink | EventProperty
1427
- mapping?: string
1428
- }
1429
- | {
1430
- input: 'dataIndex'
1431
- value?: number | DataLink | EventProperty
1432
- mapping?: string
1433
- }
1434
- | {
1435
- input: 'name'
1436
- value?: string | DataLink | EventProperty
1437
- mapping?: string
1438
- }
1439
- >
1440
- }
1441
-
1442
- /* Data toggle select */
1443
- export type BrickChartActionDataToggleSelect = ActionWithParams & {
1444
- __actionName: 'BRICK_CHART_DATA_TOGGLE_SELECT'
1445
- params?: Array<
1446
- | {
1447
- input: 'seriesName'
1448
- value?: string | DataLink | EventProperty
1449
- mapping?: string
1450
- }
1451
- | {
1452
- input: 'seriesId'
1453
- value?: string | DataLink | EventProperty
1454
- mapping?: string
1455
- }
1456
- | {
1457
- input: 'seriesIndex'
1458
- value?: number | DataLink | EventProperty
1459
- mapping?: string
1460
- }
1461
- | {
1462
- input: 'dataIndex'
1463
- value?: number | DataLink | EventProperty
1464
- mapping?: string
1465
- }
1466
- | {
1467
- input: 'name'
1468
- value?: string | DataLink | EventProperty
1469
- mapping?: string
1470
- }
1471
- >
1472
- }
1473
-
1474
- /* Legend select */
1475
- export type BrickChartActionLegendSelect = ActionWithParams & {
1476
- __actionName: 'BRICK_CHART_LEGEND_SELECT'
1477
- params?: Array<{
1478
- input: 'name'
1479
- value?: string | DataLink | EventProperty
1480
- mapping?: string
1481
- }>
1482
- }
1483
-
1484
- /* Legend unselect */
1485
- export type BrickChartActionLegendUnselect = ActionWithParams & {
1486
- __actionName: 'BRICK_CHART_LEGEND_UNSELECT'
1487
- params?: Array<{
1488
- input: 'name'
1489
- value?: string | DataLink | EventProperty
1490
- mapping?: string
1491
- }>
1492
- }
1493
-
1494
- /* Legend toggle select */
1495
- export type BrickChartActionLegendToggleSelect = Action & {
1496
- __actionName: 'BRICK_CHART_LEGEND_TOGGLE_SELECT'
1497
- }
1498
-
1499
- /* Legend all select */
1500
- export type BrickChartActionLegendAllSelect = Action & {
1501
- __actionName: 'BRICK_CHART_LEGEND_ALL_SELECT'
1502
- }
1503
-
1504
- /* Legend inverse select */
1505
- export type BrickChartActionLegendInverseSelect = Action & {
1506
- __actionName: 'BRICK_CHART_LEGEND_INVERSE_SELECT'
1507
- }
1508
-
1509
- /* Tooltip show */
1510
- export type BrickChartActionTooltipShow = ActionWithParams & {
1511
- __actionName: 'BRICK_CHART_TOOLTIP_SHOW'
1512
- params?: Array<
1513
- | {
1514
- input: 'seriesIndex'
1515
- value?: number | DataLink | EventProperty
1516
- mapping?: string
1517
- }
1518
- | {
1519
- input: 'dataIndex'
1520
- value?: number | DataLink | EventProperty
1521
- mapping?: string
1522
- }
1523
- | {
1524
- input: 'name'
1525
- value?: string | DataLink | EventProperty
1526
- mapping?: string
1527
- }
1528
- >
1529
- }
1530
-
1531
- /* Tooltip hide */
1532
- export type BrickChartActionTooltipHide = ActionWithParams & {
1533
- __actionName: 'BRICK_CHART_TOOLTIP_HIDE'
1534
- params?: Array<
1535
- | {
1536
- input: 'seriesIndex'
1537
- value?: number | DataLink | EventProperty
1538
- mapping?: string
1539
- }
1540
- | {
1541
- input: 'dataIndex'
1542
- value?: number | DataLink | EventProperty
1543
- mapping?: string
1544
- }
1545
- | {
1546
- input: 'name'
1547
- value?: string | DataLink | EventProperty
1548
- mapping?: string
1549
- }
1550
- >
1551
- }
1552
-
1553
- interface BrickChartDef {
1554
- /*
1555
- Default property:
1556
- {
1557
- "legendShow": true,
1558
- "xAxisShow": true,
1559
- "xAxisType": "category",
1560
- "yAxisShow": true,
1561
- "yAxisType": "value",
1562
- "tooltipShow": true,
1563
- "tooltipTrigger": "item"
1564
- }
1565
- */
1566
- property?: BrickBasicProperty & {
1567
- /* Theme. You can use https://echarts.apache.org/en/theme-builder.html to generate theme */
1568
- themeEntry?: {} | DataLink
1569
- /* Theme of URL (.json) */
1570
- themeUrl?: string | DataLink
1571
- /* Theme of MD5 */
1572
- themeMd5?: string | DataLink
1573
- /* Title text */
1574
- titleText?: string | DataLink
1575
- /* Subtitle text */
1576
- titleSubtext?: string | DataLink
1577
- /* Full configuration of title, see https://echarts.apache.org/en/option.html#title */
1578
- titleOptions?: {} | DataLink
1579
- /* Show legend */
1580
- legendShow?: boolean | DataLink
1581
- /* Legend data */
1582
- legendData?: Array<string | DataLink> | DataLink
1583
- /* Full configuration of legend, see https://echarts.apache.org/en/option.html#legend */
1584
- legendOptions?: {} | DataLink
1585
- /* Show grid */
1586
- gridShow?: boolean | DataLink
1587
- /* Full configuration of grid, see https://echarts.apache.org/en/option.html#grid */
1588
- gridOptions?: {} | DataLink
1589
- /* Dataset (see https://echarts.apache.org/en/option.html#dataset) */
1590
- dataset?: Array<any> | DataLink
1591
- /* Show x axis */
1592
- xAxisShow?: boolean | DataLink
1593
- /* Type of x axis */
1594
- xAxisType?: 'category' | 'value' | 'time' | 'log' | DataLink
1595
- /* Name of x axis */
1596
- xAxisName?: string | DataLink
1597
- /* Data of x axis */
1598
- xAxisData?: Array<string | DataLink> | DataLink
1599
- /* Full configuration of x axis, see https://echarts.apache.org/en/option.html#xAxis */
1600
- xAxisOptions?: {} | DataLink
1601
- /* Show y axis */
1602
- yAxisShow?: boolean | DataLink
1603
- /* Type of x axis */
1604
- yAxisType?: 'value' | 'category' | 'time' | 'log' | DataLink
1605
- /* Name of x axis */
1606
- yAxisName?: string | DataLink
1607
- /* Data of y axis */
1608
- yAxisData?: Array<string | DataLink> | DataLink
1609
- /* Full configuration of y axis, see https://echarts.apache.org/en/option.html#yAxis */
1610
- yAxisOptions?: {} | DataLink
1611
- /* Show axis pointer */
1612
- axisPointerShow?: boolean | DataLink
1613
- /* Full configuration of axis pointer, see https://echarts.apache.org/en/option.html#axisPointer */
1614
- axisPointerOptions?: {} | DataLink
1615
- /* data series (see https://echarts.apache.org/en/option.html#series-line) */
1616
- series?: Array<any> | DataLink
1617
- /* Show tooltip */
1618
- tooltipShow?: boolean | DataLink
1619
- /* Trigger type of tooltip */
1620
- tooltipTrigger?: 'item' | 'axis' | 'none' | DataLink
1621
- /* data series (see https://echarts.apache.org/en/option.html#tooltip) */
1622
- tooltipOptions?: {} | DataLink
1623
- /* Full configuration of options, see https://echarts.apache.org/en/option.html */
1624
- options?: {} | DataLink
1625
- }
1626
- events?: BrickBasicEvents & {
1627
- /* Event of chart render */
1628
- onRender?: Array<EventAction>
1629
- /* Event of data point on press */
1630
- onPress?: Array<EventAction>
1631
- /* Event of legend select changed */
1632
- onLegendSelectChanged?: Array<EventAction>
1633
- }
1634
- animation?: AnimationBasicEvents & {
1635
- onRender?: Animation
1636
- onPress?: Animation
1637
- onLegendSelectChanged?: Animation
1638
- }
1639
- }
1640
-
1641
- /* Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html). */
1642
- export type BrickChart = Brick &
1643
- BrickChartDef & {
1644
- templateKey: 'BRICK_CHART'
1645
- switches: Array<
1646
- SwitchDef &
1647
- BrickChartDef & {
1648
- conds?: Array<{
1649
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1650
- cond:
1651
- | SwitchCondInnerStateCurrentCanvas
1652
- | SwitchCondData
1653
- | {
1654
- __typename: 'SwitchCondInnerStateOutlet'
1655
- outlet: ''
1656
- value: any
1657
- }
1658
- }>
1659
- }
1660
- >
1661
- }
1662
-
1663
- /* prev page */
1664
- export type BrickItemsActionPrevPage = Action & {
1665
- __actionName: 'BRICK_ITEMS_PREV_PAGE'
1666
- }
1667
-
1668
- /* next page */
1669
- export type BrickItemsActionNextPage = Action & {
1670
- __actionName: 'BRICK_ITEMS_NEXT_PAGE'
1671
- }
1672
-
1673
- /* jump page */
1674
- export type BrickItemsActionJumpPage = ActionWithParams & {
1675
- __actionName: 'BRICK_ITEMS_JUMP_PAGE'
1676
- params?: Array<{
1677
- input: 'pageIndex'
1678
- value?: number | DataLink | EventProperty
1679
- mapping?: string
1680
- }>
1681
- }
1682
-
1683
- /* open detail */
1684
- export type BrickItemsActionOpenDetail = ActionWithParams & {
1685
- __actionName: 'BRICK_ITEMS_OPEN_DETAIL'
1686
- params?: Array<{
1687
- input: 'detailIndex'
1688
- value?: number | DataLink | EventProperty
1689
- mapping?: string
1690
- }>
1691
- }
1692
-
1693
- /* back list */
1694
- export type BrickItemsActionBackList = Action & {
1695
- __actionName: 'BRICK_ITEMS_BACK_LIST'
1696
- }
1697
-
1698
- /* Trigger dynamic animation of item by data id or index */
1699
- export type BrickItemsActionDynamicAnimation = ActionWithParams & {
1700
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION'
1701
- params?: Array<
1702
- | {
1703
- input: 'mode'
1704
- value?: 'list' | 'detail' | DataLink | EventProperty
1705
- mapping?: string
1706
- }
1707
- | {
1708
- input: 'brickId'
1709
- value?: string | DataLink | EventProperty
1710
- mapping?: string
1711
- }
1712
- | {
1713
- input: 'dataId'
1714
- value?: string | DataLink | EventProperty
1715
- mapping?: string
1716
- }
1717
- | {
1718
- input: 'index'
1719
- value?: number | DataLink | EventProperty
1720
- mapping?: string
1721
- }
1722
- | {
1723
- input: 'animationId'
1724
- value?: string | DataLink | (() => Animation) | EventProperty
1725
- mapping?: string
1726
- }
1727
- | {
1728
- input: 'animationType'
1729
- value?: 'once' | 'loop' | DataLink | EventProperty
1730
- mapping?: string
1731
- }
1732
- | {
1733
- input: 'animationResetInitialValue'
1734
- value?: boolean | DataLink | EventProperty
1735
- mapping?: string
1736
- }
1737
- >
1738
- }
1739
-
1740
- /* Reset dynamic action of item by data id or index */
1741
- export type BrickItemsActionDynamicAnimationReset = ActionWithParams & {
1742
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_RESET'
1743
- params?: Array<
1744
- | {
1745
- input: 'mode'
1746
- value?: 'list' | 'detail' | DataLink | EventProperty
1747
- mapping?: string
1748
- }
1749
- | {
1750
- input: 'brickId'
1751
- value?: string | DataLink | EventProperty
1752
- mapping?: string
1753
- }
1754
- | {
1755
- input: 'dataId'
1756
- value?: string | DataLink | EventProperty
1757
- mapping?: string
1758
- }
1759
- | {
1760
- input: 'index'
1761
- value?: number | DataLink | EventProperty
1762
- mapping?: string
1763
- }
1764
- >
1765
- }
1766
-
1767
- /* Stop dynamic action of item by data id or index */
1768
- export type BrickItemsActionDynamicAnimationStop = ActionWithParams & {
1769
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_STOP'
1770
- params?: Array<
1771
- | {
1772
- input: 'mode'
1773
- value?: 'list' | 'detail' | DataLink | EventProperty
1774
- mapping?: string
1775
- }
1776
- | {
1777
- input: 'brickId'
1778
- value?: string | DataLink | EventProperty
1779
- mapping?: string
1780
- }
1781
- | {
1782
- input: 'dataId'
1783
- value?: string | DataLink | EventProperty
1784
- mapping?: string
1785
- }
1786
- | {
1787
- input: 'index'
1788
- value?: number | DataLink | EventProperty
1789
- mapping?: string
1790
- }
1791
- >
1792
- }
1793
-
1794
- interface BrickItemsDef {
1795
- /*
1796
- Default property:
1797
- {
1798
- "mode": "list",
1799
- "items": [],
1800
- "transformScriptEnabled": false,
1801
- "transformScriptCode": "\/\* Global variable: inputs = { items, variables } \*\/\nreturn inputs.items",
1802
- "transformScriptVariables": {},
1803
- "postTransformScriptEnabled": false,
1804
- "postTransformScriptCode": "\/\*\n * Global variable: inputs = {\n * itemsLength, // items data length\n * collections, // [{ index, item, renderList }] (all items data)\n * collectionsCurrentPage, // [{ index, item, renderList }] (current page items data)\n * renderList, // Flattened bricks of current page { frame: { x, y, width, height ... }, ... }\n * variables\n * }\n \*\/\nreturn inputs.renderList",
1805
- "postTransformScriptVariables": {},
1806
- "pageIndex": 0,
1807
- "selectedItemIndex": 0,
1808
- "allowPageOutOfBound": true,
1809
- "standbySequenceInterval": 500,
1810
- "standbySequenceRandom": 0,
1811
- "brickEditWidth": 10,
1812
- "brickEditHeight": 10,
1813
- "detailBrickEditWidth": 50,
1814
- "detailBrickEditHeight": 50,
1815
- "orderMode": "horizontal",
1816
- "resizeMode": "auto",
1817
- "justifyContent": "start",
1818
- "alignContent": "stretch",
1819
- "detailResizeMode": "auto",
1820
- "detailJustifyContent": "start",
1821
- "detailAlignContent": "stretch"
1822
- }
1823
- */
1824
- property?: BrickBasicProperty & {
1825
- /* Set current display to `list` or `detail` mode */
1826
- mode?: 'list' | 'detail' | DataLink
1827
- /* Items to generate bricks for rendering */
1828
- items?: Array<any> | DataLink
1829
- /* Enable Transform Script */
1830
- transformScriptEnabled?: boolean | DataLink
1831
- /* Code of Transform Script */
1832
- transformScriptCode?: string | DataLink
1833
- /* Variables used in Transform Script (object) */
1834
- transformScriptVariables?: {} | DataLink
1835
- /* Enable Post Transform Script */
1836
- postTransformScriptEnabled?: boolean | DataLink
1837
- /* Code of Post Transform Script */
1838
- postTransformScriptCode?: string | DataLink
1839
- /* Variables used in Post Transform Script (object) */
1840
- postTransformScriptVariables?: {} | DataLink
1841
- /* Path to get item property for generate brick id instead of use index */
1842
- dataKeyPath?: string | DataLink
1843
- /* Items per page (Default: Items size) */
1844
- itemsPerPage?: number | DataLink
1845
- /* Current page index for `list` mode */
1846
- pageIndex?: number | DataLink
1847
- /* Current selected item index for `detail` mode */
1848
- selectedItemIndex?: number | DataLink
1849
- /* Allow page out of bound */
1850
- allowPageOutOfBound?: boolean | DataLink
1851
- /* Sequentially run Standby Transition for each item */
1852
- standbySequenceEnabled?: boolean | DataLink
1853
- /* Delay time (ms) between each item */
1854
- standbySequenceInterval?: number | DataLink
1855
- /* Random delay time (ms) increase or decrease between each item (e.g. if 100ms then delay time will be -100ms ~ 100ms) */
1856
- standbySequenceRandom?: number | DataLink
1857
- /* Define frame width of Brick List editor */
1858
- brickEditWidth?: number | DataLink
1859
- /* Define frame height of Brick List editor */
1860
- brickEditHeight?: number | DataLink
1861
- /* Define frame width of Brick List editor for detail mode */
1862
- detailBrickEditWidth?: number | DataLink
1863
- /* Define frame height of Brick List editor */
1864
- detailBrickEditHeight?: number | DataLink
1865
- /* order of horizontal first or vertical first */
1866
- orderMode?: 'horizontal' | 'vertical' | DataLink
1867
- /* Max horizontal item quantity */
1868
- horizontalMaxQuantity?: number | DataLink
1869
- /* Max vertical item quantity */
1870
- verticalMaxQuantity?: number | DataLink
1871
- /* Resize mode */
1872
- resizeMode?: 'auto' | 'fix' | DataLink
1873
- /* Align Content */
1874
- justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink
1875
- /* Align Content */
1876
- alignContent?:
1877
- | 'stretch'
1878
- | 'start'
1879
- | 'end'
1880
- | 'center'
1881
- | 'space-between'
1882
- | 'space-around'
1883
- | DataLink
1884
- /* Resize mode for detail mode */
1885
- detailResizeMode?: 'auto' | 'fix' | DataLink
1886
- /* Align Content for detail mode */
1887
- detailJustifyContent?: 'start' | 'end' | 'center' | DataLink
1888
- /* Align Content for detail mode */
1889
- detailAlignContent?: 'stretch' | 'start' | 'end' | 'center' | DataLink
1890
- }
1891
- /* Brick Definitions for render bricks for each item of `items` on `list` mode */
1892
- brickList?:
1893
- | Array<
1894
- | DataLink
1895
- | {
1896
- title?: string | DataLink
1897
- description?: string | DataLink
1898
- hidden?: boolean | DataLink
1899
- brickId?: string | DataLink
1900
- brickIdPrefix?: string | DataLink
1901
- templateKey?: string | DataLink
1902
- property?: {} | DataLink
1903
- animation?: {} | DataLink
1904
- eventMap?: {} | DataLink
1905
- outlet?: {} | DataLink
1906
- stateGroup?: any
1907
- propertyMapping?: {} | DataLink
1908
- frame?:
1909
- | DataLink
1910
- | {
1911
- x?: number | DataLink
1912
- y?: number | DataLink
1913
- width?: number | DataLink
1914
- height?: number | DataLink
1915
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
1916
- standbyFrame?: DataLink | {}
1917
- standbyOpacity?: number | DataLink
1918
- standbyDelay?: number | DataLink
1919
- standbyDelayRandom?: number | DataLink
1920
- standbyEasing?:
1921
- | DataLink
1922
- | {
1923
- default?:
1924
- | DataLink
1925
- | {
1926
- method?: string | DataLink
1927
- duration?: number | DataLink
1928
- }
1929
- x?:
1930
- | DataLink
1931
- | {
1932
- method?: string | DataLink
1933
- duration?: number | DataLink
1934
- }
1935
- y?:
1936
- | DataLink
1937
- | {
1938
- method?: string | DataLink
1939
- duration?: number | DataLink
1940
- }
1941
- width?:
1942
- | DataLink
1943
- | {
1944
- method?: string | DataLink
1945
- duration?: number | DataLink
1946
- }
1947
- height?:
1948
- | DataLink
1949
- | {
1950
- method?: string | DataLink
1951
- duration?: number | DataLink
1952
- }
1953
- opacity?:
1954
- | DataLink
1955
- | {
1956
- method?: string | DataLink
1957
- duration?: number | DataLink
1958
- }
1959
- }
1960
- showingDelay?: number | DataLink
1961
- renderOutOfViewport?: boolean | DataLink
1962
- }
1963
- show?: string | DataLink
1964
- pressToOpenDetail?: boolean | DataLink
1965
- }
1966
- >
1967
- | DataLink
1968
- /* Brick Definitions for render bricks for each item of `items` on `detail` mode */
1969
- brickDetails?:
1970
- | Array<
1971
- | DataLink
1972
- | {
1973
- title?: string | DataLink
1974
- description?: string | DataLink
1975
- hidden?: boolean | DataLink
1976
- brickId?: string | DataLink
1977
- brickIdPrefix?: string | DataLink
1978
- templateKey?: string | DataLink
1979
- property?: {} | DataLink
1980
- animation?: {} | DataLink
1981
- eventMap?: {} | DataLink
1982
- outlet?: {} | DataLink
1983
- stateGroup?: any
1984
- propertyMapping?: {} | DataLink
1985
- frame?:
1986
- | DataLink
1987
- | {
1988
- x?: number | DataLink
1989
- y?: number | DataLink
1990
- width?: number | DataLink
1991
- height?: number | DataLink
1992
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
1993
- standbyFrame?: DataLink | {}
1994
- standbyOpacity?: number | DataLink
1995
- standbyDelay?: number | DataLink
1996
- standbyDelayRandom?: number | DataLink
1997
- standbyEasing?:
1998
- | DataLink
1999
- | {
2000
- default?:
2001
- | DataLink
2002
- | {
2003
- method?: string | DataLink
2004
- duration?: number | DataLink
2005
- }
2006
- x?:
2007
- | DataLink
2008
- | {
2009
- method?: string | DataLink
2010
- duration?: number | DataLink
2011
- }
2012
- y?:
2013
- | DataLink
2014
- | {
2015
- method?: string | DataLink
2016
- duration?: number | DataLink
2017
- }
2018
- width?:
2019
- | DataLink
2020
- | {
2021
- method?: string | DataLink
2022
- duration?: number | DataLink
2023
- }
2024
- height?:
2025
- | DataLink
2026
- | {
2027
- method?: string | DataLink
2028
- duration?: number | DataLink
2029
- }
2030
- opacity?:
2031
- | DataLink
2032
- | {
2033
- method?: string | DataLink
2034
- duration?: number | DataLink
2035
- }
2036
- }
2037
- showingDelay?: number | DataLink
2038
- renderOutOfViewport?: boolean | DataLink
2039
- }
2040
- show?: string | DataLink
2041
- pressToBackList?: boolean | DataLink
2042
- }
2043
- >
2044
- | DataLink
2045
- events?: BrickBasicEventsForItem & {
2046
- /* Event on page render finished */
2047
- onPageRender?: Array<EventActionForItem>
2048
- /* Event on page change. */
2049
- onPageChange?: Array<EventActionForItem>
2050
- /* Event on page index out of bound. */
2051
- onPageOutOfBound?: Array<EventActionForItem>
2052
- /* Event on into `detail` mode */
2053
- onIntoDetailMode?: Array<EventActionForItem>
2054
- /* Event on into `list` mode. */
2055
- onIntoListMode?: Array<EventActionForItem>
2056
- /* Event on render error */
2057
- onError?: Array<EventActionForItem>
2058
- }
2059
- outlets?: {
2060
- /* Catched error message */
2061
- error?: () => Data
2062
- /* Current render mode */
2063
- mode?: () => Data
2064
- /* Current page index */
2065
- pageIndex?: () => Data
2066
- /* Current page size */
2067
- pageSize?: () => Data
2068
- /* Selected item index of detail mode */
2069
- selectedItemIndex?: () => Data
2070
- /* Page is out of bound */
2071
- pageIsOutOfBound?: () => Data
2072
- }
2073
- animation?: AnimationBasicEvents & {
2074
- onPageRender?: Animation
2075
- onPageChange?: Animation
2076
- onPageOutOfBound?: Animation
2077
- onIntoDetailMode?: Animation
2078
- onIntoListMode?: Animation
2079
- onError?: Animation
2080
- }
2081
- }
2082
-
2083
- /* Brick items component */
2084
- export type BrickItems = Brick &
2085
- BrickItemsDef & {
2086
- templateKey: 'BRICK_ITEMS'
2087
- switches: Array<
2088
- SwitchDef &
2089
- BrickItemsDef & {
2090
- conds?: Array<{
2091
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2092
- cond:
2093
- | SwitchCondInnerStateCurrentCanvas
2094
- | SwitchCondData
2095
- | {
2096
- __typename: 'SwitchCondInnerStateOutlet'
2097
- outlet:
2098
- | 'error'
2099
- | 'mode'
2100
- | 'pageIndex'
2101
- | 'pageSize'
2102
- | 'selectedItemIndex'
2103
- | 'pageIsOutOfBound'
2104
- value: any
2105
- }
2106
- }>
2107
- }
2108
- >
2109
- }
2110
-
2111
- interface BrickLottieDef {
2112
- /*
2113
- Default property:
2114
- {
2115
- "loop": true,
2116
- "autoPlay": true,
2117
- "resizeMode": "contain",
2118
- "renderMode": "auto"
2119
- }
2120
- */
2121
- property?: BrickBasicProperty & {
2122
- /* The animation json config content from uri */
2123
- uri?: string | DataLink
2124
- /* The checksum of `uri` */
2125
- md5?: string | DataLink
2126
- /* The animation json config content(The `uri` will be ignored if `source` is defined) */
2127
- source?: {} | DataLink
2128
- /* The speed the animation will progress. This only affects the imperative API. Sending a negative value will reverse the animation. */
2129
- speed?: number | DataLink
2130
- /* A boolean flag indicating whether or not the animation should loop. */
2131
- loop?: boolean | DataLink
2132
- /* A boolean flag indicating whether or not the animation should start automatically when mounted. This only affects the imperative API. */
2133
- autoPlay?: boolean | DataLink
2134
- /* The animation resize mode */
2135
- resizeMode?: 'cover' | 'contain' | 'center' | DataLink
2136
- /* A flag to set whether or not to render with hardware or software acceleration (Not supported for iOS) */
2137
- renderMode?: 'auto' | 'hardware' | 'software' | DataLink
2138
- /* Replace color (as hex string) by keypath */
2139
- colorFilters?:
2140
- | Array<
2141
- | DataLink
2142
- | {
2143
- keypath?: string | DataLink
2144
- color?: string | DataLink
2145
- }
2146
- >
2147
- | DataLink
2148
- /* Replace color (as hex string) by find text. Use text filters will disable glyphs text render / force software render mode, This means that a specific font needs to be loaded. */
2149
- textFilters?:
2150
- | Array<
2151
- | DataLink
2152
- | {
2153
- find?: string | DataLink
2154
- replace?: string | DataLink
2155
- }
2156
- >
2157
- | DataLink
2158
- }
2159
- events?: BrickBasicEvents & {
2160
- /* Event of the brick press */
2161
- onPress?: Array<EventAction>
2162
- /* Event of the brick press in */
2163
- onPressIn?: Array<EventAction>
2164
- /* Event of the brick press out */
2165
- onPressOut?: Array<EventAction>
2166
- /* Event of the brick focus (Use TV Device with controller) */
2167
- onFocus?: Array<EventAction>
2168
- /* Event of the brick blur (Use TV Device with controller) */
2169
- onBlur?: Array<EventAction>
2170
- /* Event of the animation finished */
2171
- onAnimationFinish?: Array<EventAction>
2172
- /* Event of the uri on load failed */
2173
- onAnimationFailure?: Array<EventAction>
2174
- /* Event of the animation on loop */
2175
- onAnimationLoop?: Array<EventAction>
2176
- }
2177
- outlets?: {
2178
- /* Brick is pressing */
2179
- brickPressing?: () => Data
2180
- /* Brick is focusing (Use TV Device with controller) */
2181
- brickFocusing?: () => Data
2182
- }
2183
- animation?: AnimationBasicEvents & {
2184
- onPress?: Animation
2185
- onPressIn?: Animation
2186
- onPressOut?: Animation
2187
- onFocus?: Animation
2188
- onBlur?: Animation
2189
- onAnimationFinish?: Animation
2190
- onAnimationFailure?: Animation
2191
- onAnimationLoop?: Animation
2192
- }
2193
- }
2194
-
2195
- /* Lottie Adobe After Effects animations brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378583-lottie)) */
2196
- export type BrickLottie = Brick &
2197
- BrickLottieDef & {
2198
- templateKey: 'BRICK_LOTTIE'
2199
- switches: Array<
2200
- SwitchDef &
2201
- BrickLottieDef & {
2202
- conds?: Array<{
2203
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2204
- cond:
2205
- | SwitchCondInnerStateCurrentCanvas
2206
- | SwitchCondData
2207
- | {
2208
- __typename: 'SwitchCondInnerStateOutlet'
2209
- outlet: 'brickPressing' | 'brickFocusing'
2210
- value: any
2211
- }
2212
- }>
2213
- }
2214
- >
2215
- }
2216
-
2217
- /* Play animation */
2218
- export type BrickRiveActionPlay = ActionWithParams & {
2219
- __actionName: 'BRICK_RIVE_PLAY'
2220
- params?: Array<
2221
- | {
2222
- input: 'animationName'
2223
- value?: string | DataLink | EventProperty
2224
- mapping?: string
2225
- }
2226
- | {
2227
- input: 'loop'
2228
- value?: 'auto' | 'oneShot' | 'loop' | 'pingPong' | DataLink | EventProperty
2229
- mapping?: string
2230
- }
2231
- | {
2232
- input: 'direction'
2233
- value?: 'auto' | 'backwards' | 'forwards' | DataLink | EventProperty
2234
- mapping?: string
2235
- }
2236
- | {
2237
- input: 'isStateMachine'
2238
- value?: boolean | DataLink | EventProperty
2239
- mapping?: string
2240
- }
2241
- >
2242
- }
2243
-
2244
- /* Pause animation */
2245
- export type BrickRiveActionPause = Action & {
2246
- __actionName: 'BRICK_RIVE_PAUSE'
2247
- }
2248
-
2249
- /* Stop animation */
2250
- export type BrickRiveActionStop = Action & {
2251
- __actionName: 'BRICK_RIVE_STOP'
2252
- }
2253
-
2254
- /* Reset animation */
2255
- export type BrickRiveActionReset = Action & {
2256
- __actionName: 'BRICK_RIVE_RESET'
2257
- }
2258
-
2259
- /* Fire state */
2260
- export type BrickRiveActionFireState = ActionWithParams & {
2261
- __actionName: 'BRICK_RIVE_FIRE_STATE'
2262
- params?: Array<
2263
- | {
2264
- input: 'stateMachineName'
2265
- value?: string | DataLink | EventProperty
2266
- mapping?: string
2267
- }
2268
- | {
2269
- input: 'inputName'
2270
- value?: string | DataLink | EventProperty
2271
- mapping?: string
2272
- }
2273
- >
2274
- }
2275
-
2276
- /* Set input state */
2277
- export type BrickRiveActionSetInputState = ActionWithParams & {
2278
- __actionName: 'BRICK_RIVE_SET_INPUT_STATE'
2279
- params?: Array<
2280
- | {
2281
- input: 'stateMachineName'
2282
- value?: string | DataLink | EventProperty
2283
- mapping?: string
2284
- }
2285
- | {
2286
- input: 'inputName'
2287
- value?: string | DataLink | EventProperty
2288
- mapping?: string
2289
- }
2290
- | {
2291
- input: 'value'
2292
- value?: any | EventProperty
2293
- mapping?: string
2294
- }
2295
- >
2296
- }
2297
-
2298
- /* Set text run value. Text Run name need to defined as unique name in Rive file. (Ref: https://rive.app/community/doc/text/docn2E6y1lXo) */
2299
- export type BrickRiveActionSetTextRunValue = ActionWithParams & {
2300
- __actionName: 'BRICK_RIVE_SET_TEXT_RUN_VALUE'
2301
- params?: Array<
2302
- | {
2303
- input: 'textRunName'
2304
- value?: string | DataLink | EventProperty
2305
- mapping?: string
2306
- }
2307
- | {
2308
- input: 'value'
2309
- value?: any | EventProperty
2310
- mapping?: string
2311
- }
2312
- >
2313
- }
2314
-
2315
- interface BrickRiveDef {
2316
- /*
2317
- Default property:
2318
- {
2319
- "autoplay": true,
2320
- "alignment": "center",
2321
- "fit": "contain"
2322
- }
2323
- */
2324
- property?: BrickBasicProperty & {
2325
- /* Rive file url */
2326
- url?: string | DataLink
2327
- /* The checksum of `url` */
2328
- md5?: string | DataLink
2329
- /* Autoplay the animation */
2330
- autoplay?: boolean | DataLink
2331
- /* Alignment of the animation */
2332
- alignment?:
2333
- | 'topLeft'
2334
- | 'topCenter'
2335
- | 'topRight'
2336
- | 'centerLeft'
2337
- | 'center'
2338
- | 'centerRight'
2339
- | 'bottomLeft'
2340
- | 'bottomCenter'
2341
- | 'bottomRight'
2342
- | DataLink
2343
- /* Fit mode of the animation */
2344
- fit?:
2345
- | 'cover'
2346
- | 'contain'
2347
- | 'fill'
2348
- | 'fitWidth'
2349
- | 'fitHeight'
2350
- | 'none'
2351
- | 'scaleDown'
2352
- | 'layout'
2353
- | DataLink
2354
- /* Artboard name */
2355
- artboardName?: string | DataLink
2356
- /* Animation name */
2357
- animationName?: string | DataLink
2358
- /* State machine name */
2359
- stateMachineName?: string | DataLink
2360
- }
2361
- events?: BrickBasicEvents & {
2362
- /* Event of animation play */
2363
- onPlay?: Array<EventAction>
2364
- /* Event of animation pause */
2365
- onPause?: Array<EventAction>
2366
- /* Event of animation stop */
2367
- onStop?: Array<EventAction>
2368
- /* Event of animation loop end */
2369
- onLoopEnd?: Array<EventAction>
2370
- /* Event of state changed */
2371
- onStateChanged?: Array<EventAction>
2372
- /* Event of error */
2373
- onError?: Array<EventAction>
2374
- /* Event of Rive general event received */
2375
- onRiveGeneralEvent?: Array<EventAction>
2376
- /* Event of Rive open-url event received */
2377
- onRiveOpenUrlEvent?: Array<EventAction>
2378
- }
2379
- animation?: AnimationBasicEvents & {
2380
- onPlay?: Animation
2381
- onPause?: Animation
2382
- onStop?: Animation
2383
- onLoopEnd?: Animation
2384
- onStateChanged?: Animation
2385
- onError?: Animation
2386
- onRiveGeneralEvent?: Animation
2387
- onRiveOpenUrlEvent?: Animation
2388
- }
2389
- }
2390
-
2391
- /* Rive file component */
2392
- export type BrickRive = Brick &
2393
- BrickRiveDef & {
2394
- templateKey: 'BRICK_RIVE'
2395
- switches: Array<
2396
- SwitchDef &
2397
- BrickRiveDef & {
2398
- conds?: Array<{
2399
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2400
- cond:
2401
- | SwitchCondInnerStateCurrentCanvas
2402
- | SwitchCondData
2403
- | {
2404
- __typename: 'SwitchCondInnerStateOutlet'
2405
- outlet: ''
2406
- value: any
2407
- }
2408
- }>
2409
- }
2410
- >
2411
- }
2412
-
2413
- /* Run Javascript on the WebView */
2414
- export type BrickWebViewActionInjectJavascript = ActionWithParams & {
2415
- __actionName: 'BRICK_WEBVIEW_INJECT_JAVASCRIPT'
2416
- params?: Array<{
2417
- input: 'javascriptCode'
2418
- value?: string | DataLink | EventProperty
2419
- mapping?: string
2420
- }>
2421
- }
2422
-
2423
- /* Do go forward on the WebView */
2424
- export type BrickWebViewActionGoForward = Action & {
2425
- __actionName: 'BRICK_WEBVIEW_GO_FORWARD'
2426
- }
2427
-
2428
- /* Do go back on the webview */
2429
- export type BrickWebViewActionGoBack = Action & {
2430
- __actionName: 'BRICK_WEBVIEW_GO_BACK'
2431
- }
2432
-
2433
- /* Do reload on the webview */
2434
- export type BrickWebViewActionReload = Action & {
2435
- __actionName: 'BRICK_WEBVIEW_RELOAD'
2436
- }
2437
-
2438
- interface BrickWebViewDef {
2439
- /*
2440
- Default property:
2441
- {
2442
- "cropLeft": 0,
2443
- "cropRight": 0,
2444
- "cropTop": 0,
2445
- "cropBottom": 0,
2446
- "allowContentControl": true,
2447
- "allowFileAccess": true,
2448
- "domStorageEnabled": true,
2449
- "cacheEnabled": true,
2450
- "geolocationEnabled": true,
2451
- "thirdPartyCookiesEnabled": true,
2452
- "javaScriptEnabled": true
2453
- }
2454
- */
2455
- property?: BrickBasicProperty & {
2456
- /* The WebView content URL */
2457
- url?: string | DataLink
2458
- /* The request headers to load content */
2459
- headers?: {} | DataLink
2460
- /* The request UserAgent */
2461
- userAgent?: string | DataLink
2462
- /* The webview content HTML (Use `url` first) */
2463
- html?: string | DataLink
2464
- /* Crop webview content left position (px) */
2465
- cropLeft?: number | DataLink
2466
- /* Crop webview content right position (px) */
2467
- cropRight?: number | DataLink
2468
- /* Crop webview content top position (px) */
2469
- cropTop?: number | DataLink
2470
- /* Crop webview content bottom position (px) */
2471
- cropBottom?: number | DataLink
2472
- /* Allow content control */
2473
- allowContentControl?: boolean | DataLink
2474
- /* List of origin strings to allow being navigated to. (Allowed all if not provided) */
2475
- originAllowList?: Array<string | DataLink> | DataLink
2476
- /* Allow file:// access */
2477
- allowFileAccess?: boolean | DataLink
2478
- /* Enable DOM Storage */
2479
- domStorageEnabled?: boolean | DataLink
2480
- /* Enable Cache */
2481
- cacheEnabled?: boolean | DataLink
2482
- /* Enable Geolocation */
2483
- geolocationEnabled?: boolean | DataLink
2484
- /* Enable Third Party Cooikies */
2485
- thirdPartyCookiesEnabled?: boolean | DataLink
2486
- /* Enable JavaScript */
2487
- javaScriptEnabled?: boolean | DataLink
2488
- /* Inject JavaScript code */
2489
- code?: string | DataLink
2490
- /* Inject JavaScript code before content loaded */
2491
- beforeContentLoaded?: string | DataLink
2492
- /* Inject JavaScript code for main frame only (only `YES` supported for Android) */
2493
- forMainFrameOnly?: boolean | DataLink
2494
- /* Inject JavaScript code before content loaded for main frame only (only `YES` supported for Android) */
2495
- beforeContentLoadedForMainFrameOnly?: boolean | DataLink
2496
- }
2497
- events?: BrickBasicEvents & {
2498
- /* Event of the WebView on load */
2499
- onLoad?: Array<EventAction>
2500
- /* Event when the WebView load fails */
2501
- onError?: Array<EventAction>
2502
- /* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
2503
- onMessage?: Array<EventAction>
2504
- }
2505
- animation?: AnimationBasicEvents & {
2506
- onLoad?: Animation
2507
- onError?: Animation
2508
- onMessage?: Animation
2509
- }
2510
- }
2511
-
2512
- /* WebView brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378588-web-view)) */
2513
- export type BrickWebView = Brick &
2514
- BrickWebViewDef & {
2515
- templateKey: 'BRICK_WEBVIEW'
2516
- switches: Array<
2517
- SwitchDef &
2518
- BrickWebViewDef & {
2519
- conds?: Array<{
2520
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2521
- cond:
2522
- | SwitchCondInnerStateCurrentCanvas
2523
- | SwitchCondData
2524
- | {
2525
- __typename: 'SwitchCondInnerStateOutlet'
2526
- outlet: ''
2527
- value: any
2528
- }
2529
- }>
2530
- }
2531
- >
2532
- }
2533
-
2534
- /* Take picture on the Camera */
2535
- export type BrickCameraActionTakePicture = ActionWithParams & {
2536
- __actionName: 'BRICK_CAMERA_TAKE_PICTURE'
2537
- params?: Array<
2538
- | {
2539
- input: 'width'
2540
- value?: number | DataLink | EventProperty
2541
- mapping?: string
2542
- }
2543
- | {
2544
- input: 'quality'
2545
- value?: string | DataLink | EventProperty
2546
- mapping?: string
2547
- }
2548
- | {
2549
- input: 'base64'
2550
- value?: boolean | DataLink | EventProperty
2551
- mapping?: string
2552
- }
2553
- | {
2554
- input: 'mirrorImage'
2555
- value?: boolean | DataLink | EventProperty
2556
- mapping?: string
2557
- }
2558
- >
2559
- }
2560
-
2561
- /* Record video on the Camera */
2562
- export type BrickCameraActionRecord = ActionWithParams & {
2563
- __actionName: 'BRICK_CAMERA_RECORD'
2564
- params?: Array<
2565
- | {
2566
- input: 'quality'
2567
- value?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink | EventProperty
2568
- mapping?: string
2569
- }
2570
- | {
2571
- input: 'mirrorVideo'
2572
- value?: boolean | DataLink | EventProperty
2573
- mapping?: string
2574
- }
2575
- | {
2576
- input: 'videoBitrate'
2577
- value?: string | DataLink | EventProperty
2578
- mapping?: string
2579
- }
2580
- | {
2581
- input: 'maxDuration'
2582
- value?: number | DataLink | EventProperty
2583
- mapping?: string
2584
- }
2585
- | {
2586
- input: 'maxFileSize'
2587
- value?: string | DataLink | EventProperty
2588
- mapping?: string
2589
- }
2590
- >
2591
- }
2592
-
2593
- /* Record video on the Camera */
2594
- export type BrickCameraActionStopRecord = Action & {
2595
- __actionName: 'BRICK_CAMERA_STOP_RECORD'
2596
- }
2597
-
2598
- interface BrickCameraDef {
2599
- /*
2600
- Default property:
2601
- {
2602
- "autoFocusEnabled": false,
2603
- "focusDepth": 0.5,
2604
- "type": "back",
2605
- "flashMode": "off",
2606
- "captureAudio": false,
2607
- "whiteBalance": "auto",
2608
- "faceDetectionEnabled": false,
2609
- "faceDetectionEventMode": "when-detected"
2610
- }
2611
- */
2612
- property?: BrickBasicProperty & {
2613
- /* Camera auto focus */
2614
- autoFocusEnabled?: boolean | DataLink
2615
- /* The auto focus feature of the camera to attempt to focus on the part of the image at this coordinate. */
2616
- focusDepth?: number | DataLink
2617
- /* Camera type (Ignore it if you are using external camera) */
2618
- type?: 'back' | 'front' | DataLink
2619
- /* Camera zoom */
2620
- zoom?: number | DataLink
2621
- /* Camera flash mode */
2622
- flashMode?: 'off' | 'on' | 'torch' | 'auto' | DataLink
2623
- /* Camera ratio (Unsupported ratio will be ignored) */
2624
- ratio?: string | DataLink
2625
- /* Capture audio when start recording */
2626
- captureAudio?: boolean | DataLink
2627
- /* Allows you to control the color temperature in your photos by cooling down or warming up the colors. */
2628
- whiteBalance?:
2629
- | 'auto'
2630
- | 'sunny'
2631
- | 'cloudy'
2632
- | 'shadow'
2633
- | 'incandescent'
2634
- | 'fluorescent'
2635
- | DataLink
2636
- /* Enable face detection */
2637
- faceDetectionEnabled?: boolean | DataLink
2638
- /* Face detection event mode */
2639
- faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink
2640
- /* Quality of take picture */
2641
- pictureQuality?: number | DataLink
2642
- /* Take picture format as base64 */
2643
- pictureBase64?: boolean | DataLink
2644
- /* Mirror image of take picture */
2645
- pictureIsMirrorImage?: boolean | DataLink
2646
- /* Quality of record video */
2647
- recordQuality?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink
2648
- /* Bitrate of record video (bit/s) */
2649
- recordVideoBitrate?: number | DataLink
2650
- /* Mirror video of record video */
2651
- recordMirrorVideo?: boolean | DataLink
2652
- /* Max duration of record video (s) */
2653
- recordMaxDuration?: number | DataLink
2654
- /* Max file size of record video (bytes) */
2655
- recordMaxFileSize?: number | DataLink
2656
- }
2657
- events?: BrickBasicEvents & {
2658
- /* Event of the Camera state change */
2659
- stateChange?: Array<EventAction>
2660
- /* Event of the Camera record start */
2661
- recordStart?: Array<EventAction>
2662
- /* Event of the Camera record end */
2663
- recordEnd?: Array<EventAction>
2664
- /* Event of the Camera barcode read */
2665
- barcodeRead?: Array<EventAction>
2666
- /* Event of the Camera picture taken */
2667
- pictureTaken?: Array<EventAction>
2668
- /* Event of the Camera record finished */
2669
- recordFinish?: Array<EventAction>
2670
- /* Event of the Camera mount error */
2671
- mountError?: Array<EventAction>
2672
- }
2673
- outlets?: {
2674
- /* Picture taken result */
2675
- pictureTaken?: () => Data
2676
- /* Record video result */
2677
- recordVideo?: () => Data
2678
- /* Barcode read result */
2679
- barcodeRead?: () => Data
2680
- /* Faces detected result */
2681
- faceDetected?: () => Data
2682
- }
2683
- animation?: AnimationBasicEvents & {
2684
- stateChange?: Animation
2685
- recordStart?: Animation
2686
- recordEnd?: Animation
2687
- barcodeRead?: Animation
2688
- pictureTaken?: Animation
2689
- recordFinish?: Animation
2690
- mountError?: Animation
2691
- }
2692
- }
2693
-
2694
- /* Camera view brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378589-camera)) */
2695
- export type BrickCamera = Brick &
2696
- BrickCameraDef & {
2697
- templateKey: 'BRICK_CAMERA'
2698
- switches: Array<
2699
- SwitchDef &
2700
- BrickCameraDef & {
2701
- conds?: Array<{
2702
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2703
- cond:
2704
- | SwitchCondInnerStateCurrentCanvas
2705
- | SwitchCondData
2706
- | {
2707
- __typename: 'SwitchCondInnerStateOutlet'
2708
- outlet: 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
2709
- value: any
2710
- }
2711
- }>
2712
- }
2713
- >
2714
- }
2715
-
2716
- interface BrickWebRTCStreamDef {
2717
- /*
2718
- Default property:
2719
- {
2720
- "mirror": false,
2721
- "resizeMode": "contain",
2722
- "noStreamViewText": "no stream",
2723
- "noStreamViewTextSize": 44,
2724
- "noStreamViewTextColor": "#000"
2725
- }
2726
- */
2727
- property?: BrickBasicProperty & {
2728
- /* Mirror video */
2729
- mirror?: boolean | DataLink
2730
- /* The stream resize mode */
2731
- resizeMode?: 'contain' | 'cover' | DataLink
2732
- /* Show text content if no stream */
2733
- noStreamViewText?: string | DataLink
2734
- /* The font size of shown text content if no stream */
2735
- noStreamViewTextSize?: number | DataLink
2736
- /* The color of shown text content if no stream */
2737
- noStreamViewTextColor?: string | DataLink
2738
- }
2739
- }
2740
-
2741
- /* WebRTCStream brick */
2742
- export type BrickWebRTCStream = Brick &
2743
- BrickWebRTCStreamDef & {
2744
- templateKey: 'BRICK_WEBRTC_STREAM'
2745
- switches: Array<
2746
- SwitchDef &
2747
- BrickWebRTCStreamDef & {
2748
- conds?: Array<{
2749
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2750
- cond:
2751
- | SwitchCondInnerStateCurrentCanvas
2752
- | SwitchCondData
2753
- | {
2754
- __typename: 'SwitchCondInnerStateOutlet'
2755
- outlet: ''
2756
- value: any
2757
- }
2758
- }>
2759
- }
2760
- >
2761
- }
2762
-
2763
- /* Play object animation */
2764
- export type Brick3DViewerActionAnimationPlay = ActionWithParams & {
2765
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_PLAY'
2766
- params?: Array<{
2767
- input: 'objectIndex'
2768
- value?: number | DataLink | EventProperty
2769
- mapping?: string
2770
- }>
2771
- }
2772
-
2773
- /* Pause object animation */
2774
- export type Brick3DViewerActionAnimationPause = ActionWithParams & {
2775
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_PAUSE'
2776
- params?: Array<{
2777
- input: 'objectIndex'
2778
- value?: number | DataLink | EventProperty
2779
- mapping?: string
2780
- }>
2781
- }
2782
-
2783
- /* Goto object animation progress */
2784
- export type Brick3DViewerActionAnimationGoto = ActionWithParams & {
2785
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_GOTO'
2786
- params?: Array<
2787
- | {
2788
- input: 'objectIndex'
2789
- value?: number | DataLink | EventProperty
2790
- mapping?: string
2791
- }
2792
- | {
2793
- input: 'animationProgress'
2794
- value?: number | DataLink | EventProperty
2795
- mapping?: string
2796
- }
2797
- >
2798
- }
2799
-
2800
- interface Brick3DViewerDef {
2801
- /*
2802
- Default property:
2803
- {
2804
- "showLoadingBox": true,
2805
- "enableOrbitControls": true
2806
- }
2807
- */
2808
- property?: BrickBasicProperty & {
2809
- /* 3D model list */
2810
- objects?:
2811
- | Array<
2812
- | DataLink
2813
- | {
2814
- url?: string | DataLink
2815
- md5?: string | DataLink
2816
- type?: 'USDZ' | 'glTF' | DataLink
2817
- rotation?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
2818
- scale?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
2819
- x?: number | DataLink
2820
- y?: number | DataLink
2821
- z?: number | DataLink
2822
- moveable?: boolean | DataLink
2823
- rotateable?: boolean | DataLink
2824
- selectable?: boolean | DataLink
2825
- enableCollision?: boolean | DataLink
2826
- animationLoopMode?: 'once' | 'repeat' | 'pingpong' | DataLink
2827
- animationProgress?: number | DataLink
2828
- animationPaused?: boolean | DataLink
2829
- boundingBox?:
2830
- | DataLink
2831
- | {
2832
- min?:
2833
- | DataLink
2834
- | {
2835
- x?: number | DataLink
2836
- y?: number | DataLink
2837
- z?: number | DataLink
2838
- }
2839
- max?:
2840
- | DataLink
2841
- | {
2842
- x?: number | DataLink
2843
- y?: number | DataLink
2844
- z?: number | DataLink
2845
- }
2846
- }
2847
- }
2848
- >
2849
- | DataLink
2850
- /* Show loading placeholder box */
2851
- showLoadingBox?: boolean | DataLink
2852
- /* Display shadows */
2853
- shadows?: boolean | DataLink
2854
- /* Default camera position */
2855
- camera?:
2856
- | DataLink
2857
- | {
2858
- fov?: number | DataLink
2859
- aspect?: number | DataLink
2860
- near?: number | DataLink
2861
- far?: number | DataLink
2862
- position?:
2863
- | DataLink
2864
- | {
2865
- x?: number | DataLink
2866
- y?: number | DataLink
2867
- z?: number | DataLink
2868
- }
2869
- quaternion?:
2870
- | DataLink
2871
- | {
2872
- x?: number | DataLink
2873
- y?: number | DataLink
2874
- z?: number | DataLink
2875
- w?: number | DataLink
2876
- }
2877
- }
2878
- /* Enable orbit controls */
2879
- enableOrbitControls?: boolean | DataLink
2880
- /* Camera control options */
2881
- orbitControls?:
2882
- | DataLink
2883
- | {
2884
- autoRotate?: boolean | DataLink
2885
- enableZoom?: boolean | DataLink
2886
- enablePan?: boolean | DataLink
2887
- enableRotate?: boolean | DataLink
2888
- enableDamping?: boolean | DataLink
2889
- dampingFactor?: number | DataLink
2890
- rotateSpeed?: number | DataLink
2891
- zoomSpeed?: number | DataLink
2892
- panSpeed?: number | DataLink
2893
- minDistance?: number | DataLink
2894
- maxDistance?: number | DataLink
2895
- minPolarAngle?: number | DataLink
2896
- maxPolarAngle?: number | DataLink
2897
- minAzimuthAngle?: number | DataLink
2898
- maxAzimuthAngle?: number | DataLink
2899
- }
2900
- /* Move controls options */
2901
- moveControls?:
2902
- | DataLink
2903
- | {
2904
- responsiveness?: number | DataLink
2905
- rotationRingColor?: string | DataLink
2906
- rotationRingSize?: number | DataLink
2907
- showBoundingBox?: boolean | DataLink
2908
- }
2909
- }
2910
- events?: BrickBasicEvents & {
2911
- /* Event of error occurred */
2912
- onError?: Array<EventAction>
2913
- /* Event of object changed position or rotation */
2914
- onChange?: Array<EventAction>
2915
- /* Event of object selected */
2916
- onSelectChange?: Array<EventAction>
2917
- /* Event of object collision occurred */
2918
- onCollision?: Array<EventAction>
2919
- }
2920
- animation?: AnimationBasicEvents & {
2921
- onError?: Animation
2922
- onChange?: Animation
2923
- onSelectChange?: Animation
2924
- onCollision?: Animation
2925
- }
2926
- }
2927
-
2928
- /* 3D viewer brick */
2929
- export type Brick3DViewer = Brick &
2930
- Brick3DViewerDef & {
2931
- templateKey: 'BRICK_3D_VIEWER'
2932
- switches: Array<
2933
- SwitchDef &
2934
- Brick3DViewerDef & {
2935
- conds?: Array<{
2936
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2937
- cond:
2938
- | SwitchCondInnerStateCurrentCanvas
2939
- | SwitchCondData
2940
- | {
2941
- __typename: 'SwitchCondInnerStateOutlet'
2942
- outlet: ''
2943
- value: any
2944
- }
2945
- }>
2946
- }
2947
- >
2948
- }
2949
-
2950
- interface GenerativeMediaDef {
2951
- /*
2952
- Default property:
2953
- {
2954
- "enableCache": true,
2955
- "type": "image",
2956
- "resizeMode": "cover",
2957
- "provider": "openai",
2958
- "freepikClassicImageSize": "square_1_1"
2959
- }
2960
- */
2961
- property?: BrickBasicProperty & {
2962
- /* The text prompt to generate media from */
2963
- prompt?: string | DataLink
2964
- /* Enable cache */
2965
- enableCache?: boolean | DataLink
2966
- /* The type of media to generate (image or video) */
2967
- type?: 'image' | 'video' | DataLink
2968
- /* Default image to display when no generated image is available */
2969
- defaultImage?: string | DataLink
2970
- /* The Lottie animation to show while generating */
2971
- loadingAnimation?: string | DataLink
2972
- /* The Lottie animation to show when an error occurs */
2973
- errorAnimation?: string | DataLink
2974
- /* The resize mode for the generated media */
2975
- resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
2976
- /* The API key for the generative media service */
2977
- apiKey?: string | DataLink
2978
- /* The AI provider to use for generation (openai, freepik, or deepai) */
2979
- provider?: 'openai' | 'freepik-classic' | 'deepai' | DataLink
2980
- /* OpenAI image size (256x256, 512x512, 1024x1024, etc) */
2981
- openaiSize?: '1024x1024' | '1024x1792' | '1792x1024' | DataLink
2982
- /* OpenAI image style (vivid or natural) */
2983
- openaiStyle?: 'vivid' | 'natural' | DataLink
2984
- /* OpenAI image quality (standard or hd) */
2985
- openaiQuality?: 'standard' | 'hd' | DataLink
2986
- /* Freepik image size */
2987
- freepikClassicImageSize?:
2988
- | 'square_1_1'
2989
- | 'classic_4_3'
2990
- | 'traditional_3_4'
2991
- | 'widescreen_16_9'
2992
- | 'social_story_9_16'
2993
- | 'smartphone_horizontal_20_9'
2994
- | 'smartphone_vertical_9_20'
2995
- | 'standard_3_2'
2996
- | 'portrait_2_3'
2997
- | 'horizontal_2_1'
2998
- | 'vertical_1_2'
2999
- | 'social_5_4'
3000
- | 'social_post_4_5'
3001
- | DataLink
3002
- /* Freepik image style */
3003
- freepikClassicStyle?:
3004
- | 'photo'
3005
- | 'digital-art'
3006
- | '3d'
3007
- | 'painting'
3008
- | 'low-poly'
3009
- | 'pixel-art'
3010
- | 'anime'
3011
- | 'cyberpunk'
3012
- | 'comic'
3013
- | 'vintage'
3014
- | 'cartoon'
3015
- | 'vector'
3016
- | 'studio-shot'
3017
- | 'dark'
3018
- | 'sketch'
3019
- | 'mockup'
3020
- | '2000s-pone'
3021
- | '70s-vibe'
3022
- | 'watercolor'
3023
- | 'art-nouveau'
3024
- | 'origami'
3025
- | 'surreal'
3026
- | 'fantasy'
3027
- | 'traditional-japan'
3028
- | DataLink
3029
- /* Freepik color scheme */
3030
- freepikClassicStyleColor?:
3031
- | 'b&w'
3032
- | 'pastel'
3033
- | 'sepia'
3034
- | 'dramatic'
3035
- | 'vibrant'
3036
- | 'orange&teal'
3037
- | 'film-filter'
3038
- | 'split'
3039
- | 'electric'
3040
- | 'pastel-pink'
3041
- | 'gold-glow'
3042
- | 'autumn'
3043
- | 'muted-green'
3044
- | 'deep-teal'
3045
- | 'duotone'
3046
- | 'terracotta&teal'
3047
- | 'red&blue'
3048
- | 'cold-neon'
3049
- | 'burgundy&blue'
3050
- | DataLink
3051
- /* Freepik lighting style */
3052
- freepikClassicStyleLighting?:
3053
- | 'studio'
3054
- | 'warm'
3055
- | 'cinematic'
3056
- | 'volumetric'
3057
- | 'golden-hour'
3058
- | 'long-exposure'
3059
- | 'cold'
3060
- | 'iridescent'
3061
- | 'dramatic'
3062
- | 'hardlight'
3063
- | 'redscale'
3064
- | 'indoor-light'
3065
- | DataLink
3066
- /* Freepik framing style */
3067
- freepikClassicStyleFraming?:
3068
- | 'portrait'
3069
- | 'macro'
3070
- | 'panoramic'
3071
- | 'aerial-view'
3072
- | 'close-up'
3073
- | 'cinematic'
3074
- | 'high-angle'
3075
- | 'low-angle'
3076
- | 'symmetry'
3077
- | 'fish-eye'
3078
- | 'first-person'
3079
- | DataLink
3080
- /* Freepik guidance scale (level of fidelity to prompt) */
3081
- freepikClassicGuidanceScale?: number | DataLink
3082
- /* Freepik negative prompt (attributes to avoid) */
3083
- freepikClassicNegativePrompt?: string | DataLink
3084
- /* DeepAI negative prompt (attributes to avoid) */
3085
- deepaiNegativePrompt?: string | DataLink
3086
- /* DeepAI image generator version */
3087
- deepaiImageGeneratorVersion?: 'standard' | 'hd' | DataLink
3088
- /* DeepAI output image width */
3089
- deepaiWidth?: number | DataLink
3090
- /* DeepAI output image height */
3091
- deepaiHeight?: number | DataLink
3092
- }
3093
- events?: BrickBasicEvents & {
3094
- /* Event of the brick press */
3095
- generativeMediaOnPress?: Array<EventAction>
3096
- /* Event of the brick press in */
3097
- generativeMediaOnPressIn?: Array<EventAction>
3098
- /* Event of the brick press out */
3099
- generativeMediaOnPressOut?: Array<EventAction>
3100
- /* Event of the brick focus (Use TV Device with controller) */
3101
- generativeMediaOnFocus?: Array<EventAction>
3102
- /* Event of the brick blur (Use TV Device with controller) */
3103
- generativeMediaOnBlur?: Array<EventAction>
3104
- /* Event when media generation succeeds */
3105
- onSuccess?: Array<EventAction>
3106
- /* Event when media generation fails */
3107
- onError?: Array<EventAction>
3108
- /* Event when media prompt request starts */
3109
- promptStart?: Array<EventAction>
3110
- /* Event when media prompt request succeeds */
3111
- promptSuccess?: Array<EventAction>
3112
- /* Event when media prompt request fails */
3113
- promptError?: Array<EventAction>
3114
- /* Event when media loading starts */
3115
- loadStart?: Array<EventAction>
3116
- /* Event when media loading succeeds */
3117
- loadSuccess?: Array<EventAction>
3118
- /* Event when media loading fails */
3119
- loadError?: Array<EventAction>
3120
- }
3121
- outlets?: {
3122
- /* Brick is pressing */
3123
- brickPressing?: () => Data
3124
- /* Brick is focusing (Use TV Device with controller) */
3125
- brickFocusing?: () => Data
3126
- /* Generated media URL */
3127
- url?: () => Data
3128
- /* Generated media error */
3129
- error?: () => Data
3130
- }
3131
- animation?: AnimationBasicEvents & {
3132
- generativeMediaOnPress?: Animation
3133
- generativeMediaOnPressIn?: Animation
3134
- generativeMediaOnPressOut?: Animation
3135
- generativeMediaOnFocus?: Animation
3136
- generativeMediaOnBlur?: Animation
3137
- onSuccess?: Animation
3138
- onError?: Animation
3139
- promptStart?: Animation
3140
- promptSuccess?: Animation
3141
- promptError?: Animation
3142
- loadStart?: Animation
3143
- loadSuccess?: Animation
3144
- loadError?: Animation
3145
- }
3146
- }
3147
-
3148
- /* Generative Media brick - Generate images and videos using AI */
3149
- export type GenerativeMedia = Brick &
3150
- GenerativeMediaDef & {
3151
- templateKey: 'BRICK_GENERATIVE_MEDIA'
3152
- switches: Array<
3153
- SwitchDef &
3154
- GenerativeMediaDef & {
3155
- conds?: Array<{
3156
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
3157
- cond:
3158
- | SwitchCondInnerStateCurrentCanvas
3159
- | SwitchCondData
3160
- | {
3161
- __typename: 'SwitchCondInnerStateOutlet'
3162
- outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error'
3163
- value: any
3164
- }
3165
- }>
3166
- }
3167
- >
3168
- }