@fugood/bricks-project 2.22.0-beta.3 → 2.22.0-beta.31

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 (87) hide show
  1. package/compile/action-name-map.ts +176 -1
  2. package/compile/index.ts +1 -0
  3. package/package.json +3 -3
  4. package/tools/postinstall.ts +17 -11
  5. package/types/animation.ts +2 -1
  6. package/types/brick-base.ts +77 -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 +237 -0
  11. package/types/bricks/Icon.ts +90 -0
  12. package/types/bricks/Image.ts +101 -0
  13. package/types/bricks/Items.ts +461 -0
  14. package/types/bricks/Lottie.ts +156 -0
  15. package/types/bricks/QrCode.ts +109 -0
  16. package/types/bricks/Rect.ts +107 -0
  17. package/types/bricks/RichText.ts +120 -0
  18. package/types/bricks/Rive.ts +209 -0
  19. package/types/bricks/Slideshow.ts +155 -0
  20. package/types/bricks/Svg.ts +91 -0
  21. package/types/bricks/Text.ts +140 -0
  22. package/types/bricks/TextInput.ts +231 -0
  23. package/types/bricks/Video.ts +167 -0
  24. package/types/bricks/VideoStreaming.ts +104 -0
  25. package/types/bricks/WebRtcStream.ts +60 -0
  26. package/types/bricks/WebView.ts +157 -0
  27. package/types/bricks/index.ts +20 -0
  28. package/types/canvas.ts +1 -1
  29. package/types/common.ts +3 -3
  30. package/types/data.ts +6 -0
  31. package/types/generators/AlarmClock.ts +102 -0
  32. package/types/generators/Assistant.ts +546 -0
  33. package/types/generators/BleCentral.ts +225 -0
  34. package/types/generators/BlePeripheral.ts +202 -0
  35. package/types/generators/CanvasMap.ts +57 -0
  36. package/types/generators/CastlesPay.ts +77 -0
  37. package/types/generators/DataBank.ts +123 -0
  38. package/types/generators/File.ts +351 -0
  39. package/types/generators/GraphQl.ts +124 -0
  40. package/types/generators/Http.ts +117 -0
  41. package/types/generators/HttpServer.ts +164 -0
  42. package/types/generators/Information.ts +97 -0
  43. package/types/generators/Intent.ts +107 -0
  44. package/types/generators/Iterator.ts +95 -0
  45. package/types/generators/Keyboard.ts +85 -0
  46. package/types/generators/LlmAnthropicCompat.ts +188 -0
  47. package/types/generators/LlmGgml.ts +719 -0
  48. package/types/generators/LlmOnnx.ts +184 -0
  49. package/types/generators/LlmOpenAiCompat.ts +206 -0
  50. package/types/generators/LlmQualcommAiEngine.ts +213 -0
  51. package/types/generators/Mcp.ts +294 -0
  52. package/types/generators/McpServer.ts +245 -0
  53. package/types/generators/MediaFlow.ts +142 -0
  54. package/types/generators/MqttBroker.ts +121 -0
  55. package/types/generators/MqttClient.ts +129 -0
  56. package/types/generators/Question.ts +395 -0
  57. package/types/generators/RealtimeTranscription.ts +172 -0
  58. package/types/generators/RerankerGgml.ts +153 -0
  59. package/types/generators/SerialPort.ts +141 -0
  60. package/types/generators/SoundPlayer.ts +86 -0
  61. package/types/generators/SoundRecorder.ts +113 -0
  62. package/types/generators/SpeechToTextGgml.ts +462 -0
  63. package/types/generators/SpeechToTextOnnx.ts +227 -0
  64. package/types/generators/SpeechToTextPlatform.ts +75 -0
  65. package/types/generators/SqLite.ts +118 -0
  66. package/types/generators/Step.ts +101 -0
  67. package/types/generators/TapToPayOnIPhone.ts +175 -0
  68. package/types/generators/Tcp.ts +120 -0
  69. package/types/generators/TcpServer.ts +137 -0
  70. package/types/generators/TextToSpeechGgml.ts +182 -0
  71. package/types/generators/TextToSpeechOnnx.ts +169 -0
  72. package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
  73. package/types/generators/ThermalPrinter.ts +185 -0
  74. package/types/generators/Tick.ts +75 -0
  75. package/types/generators/Udp.ts +109 -0
  76. package/types/generators/VadGgml.ts +211 -0
  77. package/types/generators/VectorStore.ts +223 -0
  78. package/types/generators/Watchdog.ts +96 -0
  79. package/types/generators/WebCrawler.ts +97 -0
  80. package/types/generators/WebRtc.ts +165 -0
  81. package/types/generators/WebSocket.ts +142 -0
  82. package/types/generators/index.ts +51 -0
  83. package/types/system.ts +64 -0
  84. package/utils/data.ts +45 -0
  85. package/utils/event-props.ts +210 -0
  86. package/types/bricks.ts +0 -3166
  87. package/types/generators.ts +0 -6671
package/types/bricks.ts DELETED
@@ -1,3166 +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
- /* Loop the slideshow */
1231
- loop?: boolean | DataLink
1232
- /* Shuffle the slideshow */
1233
- shuffle?: boolean | DataLink
1234
- /* Slideshow Photo resize mode */
1235
- photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
1236
- /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
1237
- photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
1238
- /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
1239
- photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
1240
- /* Slideshow Video resize mode */
1241
- videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
1242
- /* Video Auto Aspect Ratio for use Video Streaming */
1243
- videoAutoAspectRatio?: boolean | DataLink
1244
- /* Video Aspect Ratio for use Video Streaming */
1245
- videoAspectRatio?: string | DataLink
1246
- /* Video Volume */
1247
- videoVolume?: number | DataLink
1248
- /* Video Muted */
1249
- videoMuted?: boolean | DataLink
1250
- /* [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 */
1251
- videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink
1252
- /* The photo fade duration */
1253
- fadeDuration?: number | DataLink
1254
- /* Show text content if path list is empty */
1255
- emptyViewText?: string | DataLink
1256
- /* The font size of shown text content if path list is empty */
1257
- emptyViewTextSize?: number | DataLink
1258
- /* The color of shown text content if path list is empty */
1259
- emptyViewTextColor?: string | DataLink
1260
- /* Show emptyViewText when timeout and paths is empty */
1261
- emptyViewTimeout?: number | DataLink
1262
- /* The blur radius of the blur filter added to the image */
1263
- blurRadius?: number | DataLink
1264
- /* Add blurred image at background if photo is not full */
1265
- enableBlurBackground?: boolean | DataLink
1266
- /* The blur radius of the blur filter added to the image background */
1267
- blurBackgroundRadius?: number | DataLink
1268
- }
1269
- events?: BrickBasicEvents & {
1270
- /* Event of the next slideshow on change start */
1271
- changeStart?: Array<EventAction>
1272
- /* Event of the next slideshow on change end */
1273
- changeEnd?: Array<EventAction>
1274
- /* Event on paths change */
1275
- contentChange?: Array<EventAction>
1276
- /* Event on plays of paths are end */
1277
- roundEnd?: Array<EventAction>
1278
- /* Event of the slideshow on load */
1279
- mediaOnLoad?: Array<EventAction>
1280
- }
1281
- animation?: AnimationBasicEvents & {
1282
- changeStart?: Animation
1283
- changeEnd?: Animation
1284
- contentChange?: Animation
1285
- roundEnd?: Animation
1286
- mediaOnLoad?: Animation
1287
- }
1288
- }
1289
-
1290
- /* Slideshow brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378580-slideshow)) */
1291
- export type BrickSlideshow = Brick &
1292
- BrickSlideshowDef & {
1293
- templateKey: 'BRICK_SLIDESHOW'
1294
- switches: Array<
1295
- SwitchDef &
1296
- BrickSlideshowDef & {
1297
- conds?: Array<{
1298
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1299
- cond:
1300
- | SwitchCondInnerStateCurrentCanvas
1301
- | SwitchCondData
1302
- | {
1303
- __typename: 'SwitchCondInnerStateOutlet'
1304
- outlet: ''
1305
- value: any
1306
- }
1307
- }>
1308
- }
1309
- >
1310
- }
1311
-
1312
- /* Data highlight */
1313
- export type BrickChartActionDataHighlight = ActionWithParams & {
1314
- __actionName: 'BRICK_CHART_DATA_HIGHLIGHT'
1315
- params?: Array<
1316
- | {
1317
- input: 'seriesName'
1318
- value?: string | DataLink | EventProperty
1319
- mapping?: string
1320
- }
1321
- | {
1322
- input: 'seriesId'
1323
- value?: string | DataLink | EventProperty
1324
- mapping?: string
1325
- }
1326
- | {
1327
- input: 'seriesIndex'
1328
- value?: number | DataLink | EventProperty
1329
- mapping?: string
1330
- }
1331
- | {
1332
- input: 'dataIndex'
1333
- value?: number | DataLink | EventProperty
1334
- mapping?: string
1335
- }
1336
- | {
1337
- input: 'name'
1338
- value?: string | DataLink | EventProperty
1339
- mapping?: string
1340
- }
1341
- >
1342
- }
1343
-
1344
- /* Data downplay */
1345
- export type BrickChartActionDataDownplay = ActionWithParams & {
1346
- __actionName: 'BRICK_CHART_DATA_DOWNPLAY'
1347
- params?: Array<
1348
- | {
1349
- input: 'seriesName'
1350
- value?: string | DataLink | EventProperty
1351
- mapping?: string
1352
- }
1353
- | {
1354
- input: 'seriesId'
1355
- value?: string | DataLink | EventProperty
1356
- mapping?: string
1357
- }
1358
- | {
1359
- input: 'seriesIndex'
1360
- value?: number | DataLink | EventProperty
1361
- mapping?: string
1362
- }
1363
- | {
1364
- input: 'dataIndex'
1365
- value?: number | DataLink | EventProperty
1366
- mapping?: string
1367
- }
1368
- | {
1369
- input: 'name'
1370
- value?: string | DataLink | EventProperty
1371
- mapping?: string
1372
- }
1373
- >
1374
- }
1375
-
1376
- /* Data select */
1377
- export type BrickChartActionDataSelect = ActionWithParams & {
1378
- __actionName: 'BRICK_CHART_DATA_SELECT'
1379
- params?: Array<
1380
- | {
1381
- input: 'seriesName'
1382
- value?: string | DataLink | EventProperty
1383
- mapping?: string
1384
- }
1385
- | {
1386
- input: 'seriesId'
1387
- value?: string | DataLink | EventProperty
1388
- mapping?: string
1389
- }
1390
- | {
1391
- input: 'seriesIndex'
1392
- value?: number | DataLink | EventProperty
1393
- mapping?: string
1394
- }
1395
- | {
1396
- input: 'dataIndex'
1397
- value?: number | DataLink | EventProperty
1398
- mapping?: string
1399
- }
1400
- | {
1401
- input: 'name'
1402
- value?: string | DataLink | EventProperty
1403
- mapping?: string
1404
- }
1405
- >
1406
- }
1407
-
1408
- /* Data unselect */
1409
- export type BrickChartActionDataUnselect = ActionWithParams & {
1410
- __actionName: 'BRICK_CHART_DATA_UNSELECT'
1411
- params?: Array<
1412
- | {
1413
- input: 'seriesName'
1414
- value?: string | DataLink | EventProperty
1415
- mapping?: string
1416
- }
1417
- | {
1418
- input: 'seriesId'
1419
- value?: string | DataLink | EventProperty
1420
- mapping?: string
1421
- }
1422
- | {
1423
- input: 'seriesIndex'
1424
- value?: number | DataLink | EventProperty
1425
- mapping?: string
1426
- }
1427
- | {
1428
- input: 'dataIndex'
1429
- value?: number | DataLink | EventProperty
1430
- mapping?: string
1431
- }
1432
- | {
1433
- input: 'name'
1434
- value?: string | DataLink | EventProperty
1435
- mapping?: string
1436
- }
1437
- >
1438
- }
1439
-
1440
- /* Data toggle select */
1441
- export type BrickChartActionDataToggleSelect = ActionWithParams & {
1442
- __actionName: 'BRICK_CHART_DATA_TOGGLE_SELECT'
1443
- params?: Array<
1444
- | {
1445
- input: 'seriesName'
1446
- value?: string | DataLink | EventProperty
1447
- mapping?: string
1448
- }
1449
- | {
1450
- input: 'seriesId'
1451
- value?: string | DataLink | EventProperty
1452
- mapping?: string
1453
- }
1454
- | {
1455
- input: 'seriesIndex'
1456
- value?: number | DataLink | EventProperty
1457
- mapping?: string
1458
- }
1459
- | {
1460
- input: 'dataIndex'
1461
- value?: number | DataLink | EventProperty
1462
- mapping?: string
1463
- }
1464
- | {
1465
- input: 'name'
1466
- value?: string | DataLink | EventProperty
1467
- mapping?: string
1468
- }
1469
- >
1470
- }
1471
-
1472
- /* Legend select */
1473
- export type BrickChartActionLegendSelect = ActionWithParams & {
1474
- __actionName: 'BRICK_CHART_LEGEND_SELECT'
1475
- params?: Array<{
1476
- input: 'name'
1477
- value?: string | DataLink | EventProperty
1478
- mapping?: string
1479
- }>
1480
- }
1481
-
1482
- /* Legend unselect */
1483
- export type BrickChartActionLegendUnselect = ActionWithParams & {
1484
- __actionName: 'BRICK_CHART_LEGEND_UNSELECT'
1485
- params?: Array<{
1486
- input: 'name'
1487
- value?: string | DataLink | EventProperty
1488
- mapping?: string
1489
- }>
1490
- }
1491
-
1492
- /* Legend toggle select */
1493
- export type BrickChartActionLegendToggleSelect = Action & {
1494
- __actionName: 'BRICK_CHART_LEGEND_TOGGLE_SELECT'
1495
- }
1496
-
1497
- /* Legend all select */
1498
- export type BrickChartActionLegendAllSelect = Action & {
1499
- __actionName: 'BRICK_CHART_LEGEND_ALL_SELECT'
1500
- }
1501
-
1502
- /* Legend inverse select */
1503
- export type BrickChartActionLegendInverseSelect = Action & {
1504
- __actionName: 'BRICK_CHART_LEGEND_INVERSE_SELECT'
1505
- }
1506
-
1507
- /* Tooltip show */
1508
- export type BrickChartActionTooltipShow = ActionWithParams & {
1509
- __actionName: 'BRICK_CHART_TOOLTIP_SHOW'
1510
- params?: Array<
1511
- | {
1512
- input: 'seriesIndex'
1513
- value?: number | DataLink | EventProperty
1514
- mapping?: string
1515
- }
1516
- | {
1517
- input: 'dataIndex'
1518
- value?: number | DataLink | EventProperty
1519
- mapping?: string
1520
- }
1521
- | {
1522
- input: 'name'
1523
- value?: string | DataLink | EventProperty
1524
- mapping?: string
1525
- }
1526
- >
1527
- }
1528
-
1529
- /* Tooltip hide */
1530
- export type BrickChartActionTooltipHide = ActionWithParams & {
1531
- __actionName: 'BRICK_CHART_TOOLTIP_HIDE'
1532
- params?: Array<
1533
- | {
1534
- input: 'seriesIndex'
1535
- value?: number | DataLink | EventProperty
1536
- mapping?: string
1537
- }
1538
- | {
1539
- input: 'dataIndex'
1540
- value?: number | DataLink | EventProperty
1541
- mapping?: string
1542
- }
1543
- | {
1544
- input: 'name'
1545
- value?: string | DataLink | EventProperty
1546
- mapping?: string
1547
- }
1548
- >
1549
- }
1550
-
1551
- interface BrickChartDef {
1552
- /*
1553
- Default property:
1554
- {
1555
- "legendShow": true,
1556
- "xAxisShow": true,
1557
- "xAxisType": "category",
1558
- "yAxisShow": true,
1559
- "yAxisType": "value",
1560
- "tooltipShow": true,
1561
- "tooltipTrigger": "item"
1562
- }
1563
- */
1564
- property?: BrickBasicProperty & {
1565
- /* Theme. You can use https://echarts.apache.org/en/theme-builder.html to generate theme */
1566
- themeEntry?: {} | DataLink
1567
- /* Theme of URL (.json) */
1568
- themeUrl?: string | DataLink
1569
- /* Theme of MD5 */
1570
- themeMd5?: string | DataLink
1571
- /* Title text */
1572
- titleText?: string | DataLink
1573
- /* Subtitle text */
1574
- titleSubtext?: string | DataLink
1575
- /* Full configuration of title, see https://echarts.apache.org/en/option.html#title */
1576
- titleOptions?: {} | DataLink
1577
- /* Show legend */
1578
- legendShow?: boolean | DataLink
1579
- /* Legend data */
1580
- legendData?: Array<string | DataLink> | DataLink
1581
- /* Full configuration of legend, see https://echarts.apache.org/en/option.html#legend */
1582
- legendOptions?: {} | DataLink
1583
- /* Show grid */
1584
- gridShow?: boolean | DataLink
1585
- /* Full configuration of grid, see https://echarts.apache.org/en/option.html#grid */
1586
- gridOptions?: {} | DataLink
1587
- /* Dataset (see https://echarts.apache.org/en/option.html#dataset) */
1588
- dataset?: Array<any> | DataLink
1589
- /* Show x axis */
1590
- xAxisShow?: boolean | DataLink
1591
- /* Type of x axis */
1592
- xAxisType?: 'category' | 'value' | 'time' | 'log' | DataLink
1593
- /* Name of x axis */
1594
- xAxisName?: string | DataLink
1595
- /* Data of x axis */
1596
- xAxisData?: Array<string | DataLink> | DataLink
1597
- /* Full configuration of x axis, see https://echarts.apache.org/en/option.html#xAxis */
1598
- xAxisOptions?: {} | DataLink
1599
- /* Show y axis */
1600
- yAxisShow?: boolean | DataLink
1601
- /* Type of x axis */
1602
- yAxisType?: 'value' | 'category' | 'time' | 'log' | DataLink
1603
- /* Name of x axis */
1604
- yAxisName?: string | DataLink
1605
- /* Data of y axis */
1606
- yAxisData?: Array<string | DataLink> | DataLink
1607
- /* Full configuration of y axis, see https://echarts.apache.org/en/option.html#yAxis */
1608
- yAxisOptions?: {} | DataLink
1609
- /* Show axis pointer */
1610
- axisPointerShow?: boolean | DataLink
1611
- /* Full configuration of axis pointer, see https://echarts.apache.org/en/option.html#axisPointer */
1612
- axisPointerOptions?: {} | DataLink
1613
- /* data series (see https://echarts.apache.org/en/option.html#series-line) */
1614
- series?: Array<any> | DataLink
1615
- /* Show tooltip */
1616
- tooltipShow?: boolean | DataLink
1617
- /* Trigger type of tooltip */
1618
- tooltipTrigger?: 'item' | 'axis' | 'none' | DataLink
1619
- /* data series (see https://echarts.apache.org/en/option.html#tooltip) */
1620
- tooltipOptions?: {} | DataLink
1621
- /* Full configuration of options, see https://echarts.apache.org/en/option.html */
1622
- options?: {} | DataLink
1623
- }
1624
- events?: BrickBasicEvents & {
1625
- /* Event of chart render */
1626
- onRender?: Array<EventAction>
1627
- /* Event of data point on press */
1628
- onPress?: Array<EventAction>
1629
- /* Event of legend select changed */
1630
- onLegendSelectChanged?: Array<EventAction>
1631
- }
1632
- animation?: AnimationBasicEvents & {
1633
- onRender?: Animation
1634
- onPress?: Animation
1635
- onLegendSelectChanged?: Animation
1636
- }
1637
- }
1638
-
1639
- /* Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html). */
1640
- export type BrickChart = Brick &
1641
- BrickChartDef & {
1642
- templateKey: 'BRICK_CHART'
1643
- switches: Array<
1644
- SwitchDef &
1645
- BrickChartDef & {
1646
- conds?: Array<{
1647
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
1648
- cond:
1649
- | SwitchCondInnerStateCurrentCanvas
1650
- | SwitchCondData
1651
- | {
1652
- __typename: 'SwitchCondInnerStateOutlet'
1653
- outlet: ''
1654
- value: any
1655
- }
1656
- }>
1657
- }
1658
- >
1659
- }
1660
-
1661
- /* prev page */
1662
- export type BrickItemsActionPrevPage = Action & {
1663
- __actionName: 'BRICK_ITEMS_PREV_PAGE'
1664
- }
1665
-
1666
- /* next page */
1667
- export type BrickItemsActionNextPage = Action & {
1668
- __actionName: 'BRICK_ITEMS_NEXT_PAGE'
1669
- }
1670
-
1671
- /* jump page */
1672
- export type BrickItemsActionJumpPage = ActionWithParams & {
1673
- __actionName: 'BRICK_ITEMS_JUMP_PAGE'
1674
- params?: Array<{
1675
- input: 'pageIndex'
1676
- value?: number | DataLink | EventProperty
1677
- mapping?: string
1678
- }>
1679
- }
1680
-
1681
- /* open detail */
1682
- export type BrickItemsActionOpenDetail = ActionWithParams & {
1683
- __actionName: 'BRICK_ITEMS_OPEN_DETAIL'
1684
- params?: Array<{
1685
- input: 'detailIndex'
1686
- value?: number | DataLink | EventProperty
1687
- mapping?: string
1688
- }>
1689
- }
1690
-
1691
- /* back list */
1692
- export type BrickItemsActionBackList = Action & {
1693
- __actionName: 'BRICK_ITEMS_BACK_LIST'
1694
- }
1695
-
1696
- /* Trigger dynamic animation of item by data id or index */
1697
- export type BrickItemsActionDynamicAnimation = ActionWithParams & {
1698
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION'
1699
- params?: Array<
1700
- | {
1701
- input: 'mode'
1702
- value?: 'list' | 'detail' | DataLink | EventProperty
1703
- mapping?: string
1704
- }
1705
- | {
1706
- input: 'brickId'
1707
- value?: string | DataLink | EventProperty
1708
- mapping?: string
1709
- }
1710
- | {
1711
- input: 'dataId'
1712
- value?: string | DataLink | EventProperty
1713
- mapping?: string
1714
- }
1715
- | {
1716
- input: 'index'
1717
- value?: number | DataLink | EventProperty
1718
- mapping?: string
1719
- }
1720
- | {
1721
- input: 'animationId'
1722
- value?: string | DataLink | (() => Animation) | EventProperty
1723
- mapping?: string
1724
- }
1725
- | {
1726
- input: 'animationType'
1727
- value?: 'once' | 'loop' | DataLink | EventProperty
1728
- mapping?: string
1729
- }
1730
- | {
1731
- input: 'animationResetInitialValue'
1732
- value?: boolean | DataLink | EventProperty
1733
- mapping?: string
1734
- }
1735
- >
1736
- }
1737
-
1738
- /* Reset dynamic action of item by data id or index */
1739
- export type BrickItemsActionDynamicAnimationReset = ActionWithParams & {
1740
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_RESET'
1741
- params?: Array<
1742
- | {
1743
- input: 'mode'
1744
- value?: 'list' | 'detail' | DataLink | EventProperty
1745
- mapping?: string
1746
- }
1747
- | {
1748
- input: 'brickId'
1749
- value?: string | DataLink | EventProperty
1750
- mapping?: string
1751
- }
1752
- | {
1753
- input: 'dataId'
1754
- value?: string | DataLink | EventProperty
1755
- mapping?: string
1756
- }
1757
- | {
1758
- input: 'index'
1759
- value?: number | DataLink | EventProperty
1760
- mapping?: string
1761
- }
1762
- >
1763
- }
1764
-
1765
- /* Stop dynamic action of item by data id or index */
1766
- export type BrickItemsActionDynamicAnimationStop = ActionWithParams & {
1767
- __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_STOP'
1768
- params?: Array<
1769
- | {
1770
- input: 'mode'
1771
- value?: 'list' | 'detail' | DataLink | EventProperty
1772
- mapping?: string
1773
- }
1774
- | {
1775
- input: 'brickId'
1776
- value?: string | DataLink | EventProperty
1777
- mapping?: string
1778
- }
1779
- | {
1780
- input: 'dataId'
1781
- value?: string | DataLink | EventProperty
1782
- mapping?: string
1783
- }
1784
- | {
1785
- input: 'index'
1786
- value?: number | DataLink | EventProperty
1787
- mapping?: string
1788
- }
1789
- >
1790
- }
1791
-
1792
- interface BrickItemsDef {
1793
- /*
1794
- Default property:
1795
- {
1796
- "mode": "list",
1797
- "items": [],
1798
- "transformScriptEnabled": false,
1799
- "transformScriptCode": "\/\* Global variable: inputs = { items, variables } \*\/\nreturn inputs.items",
1800
- "transformScriptVariables": {},
1801
- "postTransformScriptEnabled": false,
1802
- "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",
1803
- "postTransformScriptVariables": {},
1804
- "pageIndex": 0,
1805
- "selectedItemIndex": 0,
1806
- "allowPageOutOfBound": true,
1807
- "standbySequenceInterval": 500,
1808
- "standbySequenceRandom": 0,
1809
- "brickEditWidth": 10,
1810
- "brickEditHeight": 10,
1811
- "detailBrickEditWidth": 50,
1812
- "detailBrickEditHeight": 50,
1813
- "orderMode": "horizontal",
1814
- "resizeMode": "auto",
1815
- "justifyContent": "start",
1816
- "alignContent": "stretch",
1817
- "detailResizeMode": "auto",
1818
- "detailJustifyContent": "start",
1819
- "detailAlignContent": "stretch"
1820
- }
1821
- */
1822
- property?: BrickBasicProperty & {
1823
- /* Set current display to `list` or `detail` mode */
1824
- mode?: 'list' | 'detail' | DataLink
1825
- /* Items to generate bricks for rendering */
1826
- items?: Array<any> | DataLink
1827
- /* Enable Transform Script */
1828
- transformScriptEnabled?: boolean | DataLink
1829
- /* Code of Transform Script */
1830
- transformScriptCode?: string | DataLink
1831
- /* Variables used in Transform Script (object) */
1832
- transformScriptVariables?: {} | DataLink
1833
- /* Enable Post Transform Script */
1834
- postTransformScriptEnabled?: boolean | DataLink
1835
- /* Code of Post Transform Script */
1836
- postTransformScriptCode?: string | DataLink
1837
- /* Variables used in Post Transform Script (object) */
1838
- postTransformScriptVariables?: {} | DataLink
1839
- /* Path to get item property for generate brick id instead of use index */
1840
- dataKeyPath?: string | DataLink
1841
- /* Items per page (Default: Items size) */
1842
- itemsPerPage?: number | DataLink
1843
- /* Current page index for `list` mode */
1844
- pageIndex?: number | DataLink
1845
- /* Current selected item index for `detail` mode */
1846
- selectedItemIndex?: number | DataLink
1847
- /* Allow page out of bound */
1848
- allowPageOutOfBound?: boolean | DataLink
1849
- /* Sequentially run Standby Transition for each item */
1850
- standbySequenceEnabled?: boolean | DataLink
1851
- /* Delay time (ms) between each item */
1852
- standbySequenceInterval?: number | DataLink
1853
- /* Random delay time (ms) increase or decrease between each item (e.g. if 100ms then delay time will be -100ms ~ 100ms) */
1854
- standbySequenceRandom?: number | DataLink
1855
- /* Define frame width of Brick List editor */
1856
- brickEditWidth?: number | DataLink
1857
- /* Define frame height of Brick List editor */
1858
- brickEditHeight?: number | DataLink
1859
- /* Define frame width of Brick List editor for detail mode */
1860
- detailBrickEditWidth?: number | DataLink
1861
- /* Define frame height of Brick List editor */
1862
- detailBrickEditHeight?: number | DataLink
1863
- /* order of horizontal first or vertical first */
1864
- orderMode?: 'horizontal' | 'vertical' | DataLink
1865
- /* Max horizontal item quantity */
1866
- horizontalMaxQuantity?: number | DataLink
1867
- /* Max vertical item quantity */
1868
- verticalMaxQuantity?: number | DataLink
1869
- /* Resize mode */
1870
- resizeMode?: 'auto' | 'fix' | DataLink
1871
- /* Align Content */
1872
- justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink
1873
- /* Align Content */
1874
- alignContent?:
1875
- | 'stretch'
1876
- | 'start'
1877
- | 'end'
1878
- | 'center'
1879
- | 'space-between'
1880
- | 'space-around'
1881
- | DataLink
1882
- /* Resize mode for detail mode */
1883
- detailResizeMode?: 'auto' | 'fix' | DataLink
1884
- /* Align Content for detail mode */
1885
- detailJustifyContent?: 'start' | 'end' | 'center' | DataLink
1886
- /* Align Content for detail mode */
1887
- detailAlignContent?: 'stretch' | 'start' | 'end' | 'center' | DataLink
1888
- }
1889
- /* Brick Definitions for render bricks for each item of `items` on `list` mode */
1890
- brickList?:
1891
- | Array<
1892
- | DataLink
1893
- | {
1894
- title?: string | DataLink
1895
- description?: string | DataLink
1896
- hidden?: boolean | DataLink
1897
- brickId?: string | DataLink
1898
- brickIdPrefix?: string | DataLink
1899
- templateKey?: string | DataLink
1900
- property?: {} | DataLink
1901
- animation?: {} | DataLink
1902
- eventMap?: {} | DataLink
1903
- outlet?: {} | DataLink
1904
- stateGroup?: any
1905
- propertyMapping?: {} | DataLink
1906
- frame?:
1907
- | DataLink
1908
- | {
1909
- x?: number | DataLink
1910
- y?: number | DataLink
1911
- width?: number | DataLink
1912
- height?: number | DataLink
1913
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
1914
- standbyFrame?: DataLink | {}
1915
- standbyOpacity?: number | DataLink
1916
- standbyDelay?: number | DataLink
1917
- standbyDelayRandom?: number | DataLink
1918
- standbyEasing?:
1919
- | DataLink
1920
- | {
1921
- default?:
1922
- | DataLink
1923
- | {
1924
- method?: string | DataLink
1925
- duration?: number | DataLink
1926
- }
1927
- x?:
1928
- | DataLink
1929
- | {
1930
- method?: string | DataLink
1931
- duration?: number | DataLink
1932
- }
1933
- y?:
1934
- | DataLink
1935
- | {
1936
- method?: string | DataLink
1937
- duration?: number | DataLink
1938
- }
1939
- width?:
1940
- | DataLink
1941
- | {
1942
- method?: string | DataLink
1943
- duration?: number | DataLink
1944
- }
1945
- height?:
1946
- | DataLink
1947
- | {
1948
- method?: string | DataLink
1949
- duration?: number | DataLink
1950
- }
1951
- opacity?:
1952
- | DataLink
1953
- | {
1954
- method?: string | DataLink
1955
- duration?: number | DataLink
1956
- }
1957
- }
1958
- showingDelay?: number | DataLink
1959
- renderOutOfViewport?: boolean | DataLink
1960
- }
1961
- show?: string | DataLink
1962
- pressToOpenDetail?: boolean | DataLink
1963
- }
1964
- >
1965
- | DataLink
1966
- /* Brick Definitions for render bricks for each item of `items` on `detail` mode */
1967
- brickDetails?:
1968
- | Array<
1969
- | DataLink
1970
- | {
1971
- title?: string | DataLink
1972
- description?: string | DataLink
1973
- hidden?: boolean | DataLink
1974
- brickId?: string | DataLink
1975
- brickIdPrefix?: string | DataLink
1976
- templateKey?: string | DataLink
1977
- property?: {} | DataLink
1978
- animation?: {} | DataLink
1979
- eventMap?: {} | DataLink
1980
- outlet?: {} | DataLink
1981
- stateGroup?: any
1982
- propertyMapping?: {} | DataLink
1983
- frame?:
1984
- | DataLink
1985
- | {
1986
- x?: number | DataLink
1987
- y?: number | DataLink
1988
- width?: number | DataLink
1989
- height?: number | DataLink
1990
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
1991
- standbyFrame?: DataLink | {}
1992
- standbyOpacity?: number | DataLink
1993
- standbyDelay?: number | DataLink
1994
- standbyDelayRandom?: number | DataLink
1995
- standbyEasing?:
1996
- | DataLink
1997
- | {
1998
- default?:
1999
- | DataLink
2000
- | {
2001
- method?: string | DataLink
2002
- duration?: number | DataLink
2003
- }
2004
- x?:
2005
- | DataLink
2006
- | {
2007
- method?: string | DataLink
2008
- duration?: number | DataLink
2009
- }
2010
- y?:
2011
- | DataLink
2012
- | {
2013
- method?: string | DataLink
2014
- duration?: number | DataLink
2015
- }
2016
- width?:
2017
- | DataLink
2018
- | {
2019
- method?: string | DataLink
2020
- duration?: number | DataLink
2021
- }
2022
- height?:
2023
- | DataLink
2024
- | {
2025
- method?: string | DataLink
2026
- duration?: number | DataLink
2027
- }
2028
- opacity?:
2029
- | DataLink
2030
- | {
2031
- method?: string | DataLink
2032
- duration?: number | DataLink
2033
- }
2034
- }
2035
- showingDelay?: number | DataLink
2036
- renderOutOfViewport?: boolean | DataLink
2037
- }
2038
- show?: string | DataLink
2039
- pressToBackList?: boolean | DataLink
2040
- }
2041
- >
2042
- | DataLink
2043
- events?: BrickBasicEventsForItem & {
2044
- /* Event on page render finished */
2045
- onPageRender?: Array<EventActionForItem>
2046
- /* Event on page change. */
2047
- onPageChange?: Array<EventActionForItem>
2048
- /* Event on page index out of bound. */
2049
- onPageOutOfBound?: Array<EventActionForItem>
2050
- /* Event on into `detail` mode */
2051
- onIntoDetailMode?: Array<EventActionForItem>
2052
- /* Event on into `list` mode. */
2053
- onIntoListMode?: Array<EventActionForItem>
2054
- /* Event on render error */
2055
- onError?: Array<EventActionForItem>
2056
- }
2057
- outlets?: {
2058
- /* Catched error message */
2059
- error?: () => Data
2060
- /* Current render mode */
2061
- mode?: () => Data
2062
- /* Current page index */
2063
- pageIndex?: () => Data
2064
- /* Current page size */
2065
- pageSize?: () => Data
2066
- /* Selected item index of detail mode */
2067
- selectedItemIndex?: () => Data
2068
- /* Page is out of bound */
2069
- pageIsOutOfBound?: () => Data
2070
- }
2071
- animation?: AnimationBasicEvents & {
2072
- onPageRender?: Animation
2073
- onPageChange?: Animation
2074
- onPageOutOfBound?: Animation
2075
- onIntoDetailMode?: Animation
2076
- onIntoListMode?: Animation
2077
- onError?: Animation
2078
- }
2079
- }
2080
-
2081
- /* Brick items component */
2082
- export type BrickItems = Brick &
2083
- BrickItemsDef & {
2084
- templateKey: 'BRICK_ITEMS'
2085
- switches: Array<
2086
- SwitchDef &
2087
- BrickItemsDef & {
2088
- conds?: Array<{
2089
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2090
- cond:
2091
- | SwitchCondInnerStateCurrentCanvas
2092
- | SwitchCondData
2093
- | {
2094
- __typename: 'SwitchCondInnerStateOutlet'
2095
- outlet:
2096
- | 'error'
2097
- | 'mode'
2098
- | 'pageIndex'
2099
- | 'pageSize'
2100
- | 'selectedItemIndex'
2101
- | 'pageIsOutOfBound'
2102
- value: any
2103
- }
2104
- }>
2105
- }
2106
- >
2107
- }
2108
-
2109
- interface BrickLottieDef {
2110
- /*
2111
- Default property:
2112
- {
2113
- "loop": true,
2114
- "autoPlay": true,
2115
- "resizeMode": "contain",
2116
- "renderMode": "auto"
2117
- }
2118
- */
2119
- property?: BrickBasicProperty & {
2120
- /* The animation json config content from uri */
2121
- uri?: string | DataLink
2122
- /* The checksum of `uri` */
2123
- md5?: string | DataLink
2124
- /* The animation json config content(The `uri` will be ignored if `source` is defined) */
2125
- source?: {} | DataLink
2126
- /* The speed the animation will progress. This only affects the imperative API. Sending a negative value will reverse the animation. */
2127
- speed?: number | DataLink
2128
- /* A boolean flag indicating whether or not the animation should loop. */
2129
- loop?: boolean | DataLink
2130
- /* A boolean flag indicating whether or not the animation should start automatically when mounted. This only affects the imperative API. */
2131
- autoPlay?: boolean | DataLink
2132
- /* The animation resize mode */
2133
- resizeMode?: 'cover' | 'contain' | 'center' | DataLink
2134
- /* A flag to set whether or not to render with hardware or software acceleration (Not supported for iOS) */
2135
- renderMode?: 'auto' | 'hardware' | 'software' | DataLink
2136
- /* Replace color (as hex string) by keypath */
2137
- colorFilters?:
2138
- | Array<
2139
- | DataLink
2140
- | {
2141
- keypath?: string | DataLink
2142
- color?: string | DataLink
2143
- }
2144
- >
2145
- | DataLink
2146
- /* 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. */
2147
- textFilters?:
2148
- | Array<
2149
- | DataLink
2150
- | {
2151
- find?: string | DataLink
2152
- replace?: string | DataLink
2153
- }
2154
- >
2155
- | DataLink
2156
- }
2157
- events?: BrickBasicEvents & {
2158
- /* Event of the brick press */
2159
- onPress?: Array<EventAction>
2160
- /* Event of the brick press in */
2161
- onPressIn?: Array<EventAction>
2162
- /* Event of the brick press out */
2163
- onPressOut?: Array<EventAction>
2164
- /* Event of the brick focus (Use TV Device with controller) */
2165
- onFocus?: Array<EventAction>
2166
- /* Event of the brick blur (Use TV Device with controller) */
2167
- onBlur?: Array<EventAction>
2168
- /* Event of the animation finished */
2169
- onAnimationFinish?: Array<EventAction>
2170
- /* Event of the uri on load failed */
2171
- onAnimationFailure?: Array<EventAction>
2172
- /* Event of the animation on loop */
2173
- onAnimationLoop?: Array<EventAction>
2174
- }
2175
- outlets?: {
2176
- /* Brick is pressing */
2177
- brickPressing?: () => Data
2178
- /* Brick is focusing (Use TV Device with controller) */
2179
- brickFocusing?: () => Data
2180
- }
2181
- animation?: AnimationBasicEvents & {
2182
- onPress?: Animation
2183
- onPressIn?: Animation
2184
- onPressOut?: Animation
2185
- onFocus?: Animation
2186
- onBlur?: Animation
2187
- onAnimationFinish?: Animation
2188
- onAnimationFailure?: Animation
2189
- onAnimationLoop?: Animation
2190
- }
2191
- }
2192
-
2193
- /* Lottie Adobe After Effects animations brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378583-lottie)) */
2194
- export type BrickLottie = Brick &
2195
- BrickLottieDef & {
2196
- templateKey: 'BRICK_LOTTIE'
2197
- switches: Array<
2198
- SwitchDef &
2199
- BrickLottieDef & {
2200
- conds?: Array<{
2201
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2202
- cond:
2203
- | SwitchCondInnerStateCurrentCanvas
2204
- | SwitchCondData
2205
- | {
2206
- __typename: 'SwitchCondInnerStateOutlet'
2207
- outlet: 'brickPressing' | 'brickFocusing'
2208
- value: any
2209
- }
2210
- }>
2211
- }
2212
- >
2213
- }
2214
-
2215
- /* Play animation */
2216
- export type BrickRiveActionPlay = ActionWithParams & {
2217
- __actionName: 'BRICK_RIVE_PLAY'
2218
- params?: Array<
2219
- | {
2220
- input: 'animationName'
2221
- value?: string | DataLink | EventProperty
2222
- mapping?: string
2223
- }
2224
- | {
2225
- input: 'loop'
2226
- value?: 'auto' | 'oneShot' | 'loop' | 'pingPong' | DataLink | EventProperty
2227
- mapping?: string
2228
- }
2229
- | {
2230
- input: 'direction'
2231
- value?: 'auto' | 'backwards' | 'forwards' | DataLink | EventProperty
2232
- mapping?: string
2233
- }
2234
- | {
2235
- input: 'isStateMachine'
2236
- value?: boolean | DataLink | EventProperty
2237
- mapping?: string
2238
- }
2239
- >
2240
- }
2241
-
2242
- /* Pause animation */
2243
- export type BrickRiveActionPause = Action & {
2244
- __actionName: 'BRICK_RIVE_PAUSE'
2245
- }
2246
-
2247
- /* Stop animation */
2248
- export type BrickRiveActionStop = Action & {
2249
- __actionName: 'BRICK_RIVE_STOP'
2250
- }
2251
-
2252
- /* Reset animation */
2253
- export type BrickRiveActionReset = Action & {
2254
- __actionName: 'BRICK_RIVE_RESET'
2255
- }
2256
-
2257
- /* Fire state */
2258
- export type BrickRiveActionFireState = ActionWithParams & {
2259
- __actionName: 'BRICK_RIVE_FIRE_STATE'
2260
- params?: Array<
2261
- | {
2262
- input: 'stateMachineName'
2263
- value?: string | DataLink | EventProperty
2264
- mapping?: string
2265
- }
2266
- | {
2267
- input: 'inputName'
2268
- value?: string | DataLink | EventProperty
2269
- mapping?: string
2270
- }
2271
- >
2272
- }
2273
-
2274
- /* Set input state */
2275
- export type BrickRiveActionSetInputState = ActionWithParams & {
2276
- __actionName: 'BRICK_RIVE_SET_INPUT_STATE'
2277
- params?: Array<
2278
- | {
2279
- input: 'stateMachineName'
2280
- value?: string | DataLink | EventProperty
2281
- mapping?: string
2282
- }
2283
- | {
2284
- input: 'inputName'
2285
- value?: string | DataLink | EventProperty
2286
- mapping?: string
2287
- }
2288
- | {
2289
- input: 'value'
2290
- value?: any | EventProperty
2291
- mapping?: string
2292
- }
2293
- >
2294
- }
2295
-
2296
- /* Set text run value. Text Run name need to defined as unique name in Rive file. (Ref: https://rive.app/community/doc/text/docn2E6y1lXo) */
2297
- export type BrickRiveActionSetTextRunValue = ActionWithParams & {
2298
- __actionName: 'BRICK_RIVE_SET_TEXT_RUN_VALUE'
2299
- params?: Array<
2300
- | {
2301
- input: 'textRunName'
2302
- value?: string | DataLink | EventProperty
2303
- mapping?: string
2304
- }
2305
- | {
2306
- input: 'value'
2307
- value?: any | EventProperty
2308
- mapping?: string
2309
- }
2310
- >
2311
- }
2312
-
2313
- interface BrickRiveDef {
2314
- /*
2315
- Default property:
2316
- {
2317
- "autoplay": true,
2318
- "alignment": "center",
2319
- "fit": "contain"
2320
- }
2321
- */
2322
- property?: BrickBasicProperty & {
2323
- /* Rive file url */
2324
- url?: string | DataLink
2325
- /* The checksum of `url` */
2326
- md5?: string | DataLink
2327
- /* Autoplay the animation */
2328
- autoplay?: boolean | DataLink
2329
- /* Alignment of the animation */
2330
- alignment?:
2331
- | 'topLeft'
2332
- | 'topCenter'
2333
- | 'topRight'
2334
- | 'centerLeft'
2335
- | 'center'
2336
- | 'centerRight'
2337
- | 'bottomLeft'
2338
- | 'bottomCenter'
2339
- | 'bottomRight'
2340
- | DataLink
2341
- /* Fit mode of the animation */
2342
- fit?:
2343
- | 'cover'
2344
- | 'contain'
2345
- | 'fill'
2346
- | 'fitWidth'
2347
- | 'fitHeight'
2348
- | 'none'
2349
- | 'scaleDown'
2350
- | 'layout'
2351
- | DataLink
2352
- /* Artboard name */
2353
- artboardName?: string | DataLink
2354
- /* Animation name */
2355
- animationName?: string | DataLink
2356
- /* State machine name */
2357
- stateMachineName?: string | DataLink
2358
- }
2359
- events?: BrickBasicEvents & {
2360
- /* Event of animation play */
2361
- onPlay?: Array<EventAction>
2362
- /* Event of animation pause */
2363
- onPause?: Array<EventAction>
2364
- /* Event of animation stop */
2365
- onStop?: Array<EventAction>
2366
- /* Event of animation loop end */
2367
- onLoopEnd?: Array<EventAction>
2368
- /* Event of state changed */
2369
- onStateChanged?: Array<EventAction>
2370
- /* Event of error */
2371
- onError?: Array<EventAction>
2372
- /* Event of Rive general event received */
2373
- onRiveGeneralEvent?: Array<EventAction>
2374
- /* Event of Rive open-url event received */
2375
- onRiveOpenUrlEvent?: Array<EventAction>
2376
- }
2377
- animation?: AnimationBasicEvents & {
2378
- onPlay?: Animation
2379
- onPause?: Animation
2380
- onStop?: Animation
2381
- onLoopEnd?: Animation
2382
- onStateChanged?: Animation
2383
- onError?: Animation
2384
- onRiveGeneralEvent?: Animation
2385
- onRiveOpenUrlEvent?: Animation
2386
- }
2387
- }
2388
-
2389
- /* Rive file component */
2390
- export type BrickRive = Brick &
2391
- BrickRiveDef & {
2392
- templateKey: 'BRICK_RIVE'
2393
- switches: Array<
2394
- SwitchDef &
2395
- BrickRiveDef & {
2396
- conds?: Array<{
2397
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2398
- cond:
2399
- | SwitchCondInnerStateCurrentCanvas
2400
- | SwitchCondData
2401
- | {
2402
- __typename: 'SwitchCondInnerStateOutlet'
2403
- outlet: ''
2404
- value: any
2405
- }
2406
- }>
2407
- }
2408
- >
2409
- }
2410
-
2411
- /* Run Javascript on the WebView */
2412
- export type BrickWebViewActionInjectJavascript = ActionWithParams & {
2413
- __actionName: 'BRICK_WEBVIEW_INJECT_JAVASCRIPT'
2414
- params?: Array<{
2415
- input: 'javascriptCode'
2416
- value?: string | DataLink | EventProperty
2417
- mapping?: string
2418
- }>
2419
- }
2420
-
2421
- /* Do go forward on the WebView */
2422
- export type BrickWebViewActionGoForward = Action & {
2423
- __actionName: 'BRICK_WEBVIEW_GO_FORWARD'
2424
- }
2425
-
2426
- /* Do go back on the webview */
2427
- export type BrickWebViewActionGoBack = Action & {
2428
- __actionName: 'BRICK_WEBVIEW_GO_BACK'
2429
- }
2430
-
2431
- /* Do reload on the webview */
2432
- export type BrickWebViewActionReload = Action & {
2433
- __actionName: 'BRICK_WEBVIEW_RELOAD'
2434
- }
2435
-
2436
- interface BrickWebViewDef {
2437
- /*
2438
- Default property:
2439
- {
2440
- "cropLeft": 0,
2441
- "cropRight": 0,
2442
- "cropTop": 0,
2443
- "cropBottom": 0,
2444
- "allowContentControl": true,
2445
- "allowFileAccess": true,
2446
- "domStorageEnabled": true,
2447
- "cacheEnabled": true,
2448
- "geolocationEnabled": true,
2449
- "thirdPartyCookiesEnabled": true,
2450
- "javaScriptEnabled": true
2451
- }
2452
- */
2453
- property?: BrickBasicProperty & {
2454
- /* The WebView content URL */
2455
- url?: string | DataLink
2456
- /* The request headers to load content */
2457
- headers?: {} | DataLink
2458
- /* The request UserAgent */
2459
- userAgent?: string | DataLink
2460
- /* The webview content HTML (Use `url` first) */
2461
- html?: string | DataLink
2462
- /* Crop webview content left position (px) */
2463
- cropLeft?: number | DataLink
2464
- /* Crop webview content right position (px) */
2465
- cropRight?: number | DataLink
2466
- /* Crop webview content top position (px) */
2467
- cropTop?: number | DataLink
2468
- /* Crop webview content bottom position (px) */
2469
- cropBottom?: number | DataLink
2470
- /* Allow content control */
2471
- allowContentControl?: boolean | DataLink
2472
- /* List of origin strings to allow being navigated to. (Allowed all if not provided) */
2473
- originAllowList?: Array<string | DataLink> | DataLink
2474
- /* Allow file:// access */
2475
- allowFileAccess?: boolean | DataLink
2476
- /* Enable DOM Storage */
2477
- domStorageEnabled?: boolean | DataLink
2478
- /* Enable Cache */
2479
- cacheEnabled?: boolean | DataLink
2480
- /* Enable Geolocation */
2481
- geolocationEnabled?: boolean | DataLink
2482
- /* Enable Third Party Cooikies */
2483
- thirdPartyCookiesEnabled?: boolean | DataLink
2484
- /* Enable JavaScript */
2485
- javaScriptEnabled?: boolean | DataLink
2486
- /* Inject JavaScript code */
2487
- code?: string | DataLink
2488
- /* Inject JavaScript code before content loaded */
2489
- beforeContentLoaded?: string | DataLink
2490
- /* Inject JavaScript code for main frame only (only `YES` supported for Android) */
2491
- forMainFrameOnly?: boolean | DataLink
2492
- /* Inject JavaScript code before content loaded for main frame only (only `YES` supported for Android) */
2493
- beforeContentLoadedForMainFrameOnly?: boolean | DataLink
2494
- }
2495
- events?: BrickBasicEvents & {
2496
- /* Event of the WebView on load */
2497
- onLoad?: Array<EventAction>
2498
- /* Event when the WebView load fails */
2499
- onError?: Array<EventAction>
2500
- /* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
2501
- onMessage?: Array<EventAction>
2502
- }
2503
- animation?: AnimationBasicEvents & {
2504
- onLoad?: Animation
2505
- onError?: Animation
2506
- onMessage?: Animation
2507
- }
2508
- }
2509
-
2510
- /* WebView brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378588-web-view)) */
2511
- export type BrickWebView = Brick &
2512
- BrickWebViewDef & {
2513
- templateKey: 'BRICK_WEBVIEW'
2514
- switches: Array<
2515
- SwitchDef &
2516
- BrickWebViewDef & {
2517
- conds?: Array<{
2518
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2519
- cond:
2520
- | SwitchCondInnerStateCurrentCanvas
2521
- | SwitchCondData
2522
- | {
2523
- __typename: 'SwitchCondInnerStateOutlet'
2524
- outlet: ''
2525
- value: any
2526
- }
2527
- }>
2528
- }
2529
- >
2530
- }
2531
-
2532
- /* Take picture on the Camera */
2533
- export type BrickCameraActionTakePicture = ActionWithParams & {
2534
- __actionName: 'BRICK_CAMERA_TAKE_PICTURE'
2535
- params?: Array<
2536
- | {
2537
- input: 'width'
2538
- value?: number | DataLink | EventProperty
2539
- mapping?: string
2540
- }
2541
- | {
2542
- input: 'quality'
2543
- value?: string | DataLink | EventProperty
2544
- mapping?: string
2545
- }
2546
- | {
2547
- input: 'base64'
2548
- value?: boolean | DataLink | EventProperty
2549
- mapping?: string
2550
- }
2551
- | {
2552
- input: 'mirrorImage'
2553
- value?: boolean | DataLink | EventProperty
2554
- mapping?: string
2555
- }
2556
- >
2557
- }
2558
-
2559
- /* Record video on the Camera */
2560
- export type BrickCameraActionRecord = ActionWithParams & {
2561
- __actionName: 'BRICK_CAMERA_RECORD'
2562
- params?: Array<
2563
- | {
2564
- input: 'quality'
2565
- value?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink | EventProperty
2566
- mapping?: string
2567
- }
2568
- | {
2569
- input: 'mirrorVideo'
2570
- value?: boolean | DataLink | EventProperty
2571
- mapping?: string
2572
- }
2573
- | {
2574
- input: 'videoBitrate'
2575
- value?: string | DataLink | EventProperty
2576
- mapping?: string
2577
- }
2578
- | {
2579
- input: 'maxDuration'
2580
- value?: number | DataLink | EventProperty
2581
- mapping?: string
2582
- }
2583
- | {
2584
- input: 'maxFileSize'
2585
- value?: string | DataLink | EventProperty
2586
- mapping?: string
2587
- }
2588
- >
2589
- }
2590
-
2591
- /* Record video on the Camera */
2592
- export type BrickCameraActionStopRecord = Action & {
2593
- __actionName: 'BRICK_CAMERA_STOP_RECORD'
2594
- }
2595
-
2596
- interface BrickCameraDef {
2597
- /*
2598
- Default property:
2599
- {
2600
- "autoFocusEnabled": false,
2601
- "focusDepth": 0.5,
2602
- "type": "back",
2603
- "flashMode": "off",
2604
- "captureAudio": false,
2605
- "whiteBalance": "auto",
2606
- "faceDetectionEnabled": false,
2607
- "faceDetectionEventMode": "when-detected"
2608
- }
2609
- */
2610
- property?: BrickBasicProperty & {
2611
- /* Camera auto focus */
2612
- autoFocusEnabled?: boolean | DataLink
2613
- /* The auto focus feature of the camera to attempt to focus on the part of the image at this coordinate. */
2614
- focusDepth?: number | DataLink
2615
- /* Camera type (Ignore it if you are using external camera) */
2616
- type?: 'back' | 'front' | DataLink
2617
- /* Camera zoom */
2618
- zoom?: number | DataLink
2619
- /* Camera flash mode */
2620
- flashMode?: 'off' | 'on' | 'torch' | 'auto' | DataLink
2621
- /* Camera ratio (Unsupported ratio will be ignored) */
2622
- ratio?: string | DataLink
2623
- /* Capture audio when start recording */
2624
- captureAudio?: boolean | DataLink
2625
- /* Allows you to control the color temperature in your photos by cooling down or warming up the colors. */
2626
- whiteBalance?:
2627
- | 'auto'
2628
- | 'sunny'
2629
- | 'cloudy'
2630
- | 'shadow'
2631
- | 'incandescent'
2632
- | 'fluorescent'
2633
- | DataLink
2634
- /* Enable face detection */
2635
- faceDetectionEnabled?: boolean | DataLink
2636
- /* Face detection event mode */
2637
- faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink
2638
- /* Quality of take picture */
2639
- pictureQuality?: number | DataLink
2640
- /* Take picture format as base64 */
2641
- pictureBase64?: boolean | DataLink
2642
- /* Mirror image of take picture */
2643
- pictureIsMirrorImage?: boolean | DataLink
2644
- /* Quality of record video */
2645
- recordQuality?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink
2646
- /* Bitrate of record video (bit/s) */
2647
- recordVideoBitrate?: number | DataLink
2648
- /* Mirror video of record video */
2649
- recordMirrorVideo?: boolean | DataLink
2650
- /* Max duration of record video (s) */
2651
- recordMaxDuration?: number | DataLink
2652
- /* Max file size of record video (bytes) */
2653
- recordMaxFileSize?: number | DataLink
2654
- }
2655
- events?: BrickBasicEvents & {
2656
- /* Event of the Camera state change */
2657
- stateChange?: Array<EventAction>
2658
- /* Event of the Camera record start */
2659
- recordStart?: Array<EventAction>
2660
- /* Event of the Camera record end */
2661
- recordEnd?: Array<EventAction>
2662
- /* Event of the Camera barcode read */
2663
- barcodeRead?: Array<EventAction>
2664
- /* Event of the Camera picture taken */
2665
- pictureTaken?: Array<EventAction>
2666
- /* Event of the Camera record finished */
2667
- recordFinish?: Array<EventAction>
2668
- /* Event of the Camera mount error */
2669
- mountError?: Array<EventAction>
2670
- }
2671
- outlets?: {
2672
- /* Picture taken result */
2673
- pictureTaken?: () => Data
2674
- /* Record video result */
2675
- recordVideo?: () => Data
2676
- /* Barcode read result */
2677
- barcodeRead?: () => Data
2678
- /* Faces detected result */
2679
- faceDetected?: () => Data
2680
- }
2681
- animation?: AnimationBasicEvents & {
2682
- stateChange?: Animation
2683
- recordStart?: Animation
2684
- recordEnd?: Animation
2685
- barcodeRead?: Animation
2686
- pictureTaken?: Animation
2687
- recordFinish?: Animation
2688
- mountError?: Animation
2689
- }
2690
- }
2691
-
2692
- /* Camera view brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378589-camera)) */
2693
- export type BrickCamera = Brick &
2694
- BrickCameraDef & {
2695
- templateKey: 'BRICK_CAMERA'
2696
- switches: Array<
2697
- SwitchDef &
2698
- BrickCameraDef & {
2699
- conds?: Array<{
2700
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2701
- cond:
2702
- | SwitchCondInnerStateCurrentCanvas
2703
- | SwitchCondData
2704
- | {
2705
- __typename: 'SwitchCondInnerStateOutlet'
2706
- outlet: 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
2707
- value: any
2708
- }
2709
- }>
2710
- }
2711
- >
2712
- }
2713
-
2714
- interface BrickWebRTCStreamDef {
2715
- /*
2716
- Default property:
2717
- {
2718
- "mirror": false,
2719
- "resizeMode": "contain",
2720
- "noStreamViewText": "no stream",
2721
- "noStreamViewTextSize": 44,
2722
- "noStreamViewTextColor": "#000"
2723
- }
2724
- */
2725
- property?: BrickBasicProperty & {
2726
- /* Mirror video */
2727
- mirror?: boolean | DataLink
2728
- /* The stream resize mode */
2729
- resizeMode?: 'contain' | 'cover' | DataLink
2730
- /* Show text content if no stream */
2731
- noStreamViewText?: string | DataLink
2732
- /* The font size of shown text content if no stream */
2733
- noStreamViewTextSize?: number | DataLink
2734
- /* The color of shown text content if no stream */
2735
- noStreamViewTextColor?: string | DataLink
2736
- }
2737
- }
2738
-
2739
- /* WebRTCStream brick */
2740
- export type BrickWebRTCStream = Brick &
2741
- BrickWebRTCStreamDef & {
2742
- templateKey: 'BRICK_WEBRTC_STREAM'
2743
- switches: Array<
2744
- SwitchDef &
2745
- BrickWebRTCStreamDef & {
2746
- conds?: Array<{
2747
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2748
- cond:
2749
- | SwitchCondInnerStateCurrentCanvas
2750
- | SwitchCondData
2751
- | {
2752
- __typename: 'SwitchCondInnerStateOutlet'
2753
- outlet: ''
2754
- value: any
2755
- }
2756
- }>
2757
- }
2758
- >
2759
- }
2760
-
2761
- /* Play object animation */
2762
- export type Brick3DViewerActionAnimationPlay = ActionWithParams & {
2763
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_PLAY'
2764
- params?: Array<{
2765
- input: 'objectIndex'
2766
- value?: number | DataLink | EventProperty
2767
- mapping?: string
2768
- }>
2769
- }
2770
-
2771
- /* Pause object animation */
2772
- export type Brick3DViewerActionAnimationPause = ActionWithParams & {
2773
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_PAUSE'
2774
- params?: Array<{
2775
- input: 'objectIndex'
2776
- value?: number | DataLink | EventProperty
2777
- mapping?: string
2778
- }>
2779
- }
2780
-
2781
- /* Goto object animation progress */
2782
- export type Brick3DViewerActionAnimationGoto = ActionWithParams & {
2783
- __actionName: 'BRICK_3D_VIEWER_ANIMATION_GOTO'
2784
- params?: Array<
2785
- | {
2786
- input: 'objectIndex'
2787
- value?: number | DataLink | EventProperty
2788
- mapping?: string
2789
- }
2790
- | {
2791
- input: 'animationProgress'
2792
- value?: number | DataLink | EventProperty
2793
- mapping?: string
2794
- }
2795
- >
2796
- }
2797
-
2798
- interface Brick3DViewerDef {
2799
- /*
2800
- Default property:
2801
- {
2802
- "showLoadingBox": true,
2803
- "enableOrbitControls": true
2804
- }
2805
- */
2806
- property?: BrickBasicProperty & {
2807
- /* 3D model list */
2808
- objects?:
2809
- | Array<
2810
- | DataLink
2811
- | {
2812
- url?: string | DataLink
2813
- md5?: string | DataLink
2814
- type?: 'USDZ' | 'glTF' | DataLink
2815
- rotation?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
2816
- scale?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
2817
- x?: number | DataLink
2818
- y?: number | DataLink
2819
- z?: number | DataLink
2820
- moveable?: boolean | DataLink
2821
- rotateable?: boolean | DataLink
2822
- selectable?: boolean | DataLink
2823
- enableCollision?: boolean | DataLink
2824
- animationLoopMode?: 'once' | 'repeat' | 'pingpong' | DataLink
2825
- animationProgress?: number | DataLink
2826
- animationPaused?: boolean | DataLink
2827
- boundingBox?:
2828
- | DataLink
2829
- | {
2830
- min?:
2831
- | DataLink
2832
- | {
2833
- x?: number | DataLink
2834
- y?: number | DataLink
2835
- z?: number | DataLink
2836
- }
2837
- max?:
2838
- | DataLink
2839
- | {
2840
- x?: number | DataLink
2841
- y?: number | DataLink
2842
- z?: number | DataLink
2843
- }
2844
- }
2845
- }
2846
- >
2847
- | DataLink
2848
- /* Show loading placeholder box */
2849
- showLoadingBox?: boolean | DataLink
2850
- /* Display shadows */
2851
- shadows?: boolean | DataLink
2852
- /* Default camera position */
2853
- camera?:
2854
- | DataLink
2855
- | {
2856
- fov?: number | DataLink
2857
- aspect?: number | DataLink
2858
- near?: number | DataLink
2859
- far?: number | DataLink
2860
- position?:
2861
- | DataLink
2862
- | {
2863
- x?: number | DataLink
2864
- y?: number | DataLink
2865
- z?: number | DataLink
2866
- }
2867
- quaternion?:
2868
- | DataLink
2869
- | {
2870
- x?: number | DataLink
2871
- y?: number | DataLink
2872
- z?: number | DataLink
2873
- w?: number | DataLink
2874
- }
2875
- }
2876
- /* Enable orbit controls */
2877
- enableOrbitControls?: boolean | DataLink
2878
- /* Camera control options */
2879
- orbitControls?:
2880
- | DataLink
2881
- | {
2882
- autoRotate?: boolean | DataLink
2883
- enableZoom?: boolean | DataLink
2884
- enablePan?: boolean | DataLink
2885
- enableRotate?: boolean | DataLink
2886
- enableDamping?: boolean | DataLink
2887
- dampingFactor?: number | DataLink
2888
- rotateSpeed?: number | DataLink
2889
- zoomSpeed?: number | DataLink
2890
- panSpeed?: number | DataLink
2891
- minDistance?: number | DataLink
2892
- maxDistance?: number | DataLink
2893
- minPolarAngle?: number | DataLink
2894
- maxPolarAngle?: number | DataLink
2895
- minAzimuthAngle?: number | DataLink
2896
- maxAzimuthAngle?: number | DataLink
2897
- }
2898
- /* Move controls options */
2899
- moveControls?:
2900
- | DataLink
2901
- | {
2902
- responsiveness?: number | DataLink
2903
- rotationRingColor?: string | DataLink
2904
- rotationRingSize?: number | DataLink
2905
- showBoundingBox?: boolean | DataLink
2906
- }
2907
- }
2908
- events?: BrickBasicEvents & {
2909
- /* Event of error occurred */
2910
- onError?: Array<EventAction>
2911
- /* Event of object changed position or rotation */
2912
- onChange?: Array<EventAction>
2913
- /* Event of object selected */
2914
- onSelectChange?: Array<EventAction>
2915
- /* Event of object collision occurred */
2916
- onCollision?: Array<EventAction>
2917
- }
2918
- animation?: AnimationBasicEvents & {
2919
- onError?: Animation
2920
- onChange?: Animation
2921
- onSelectChange?: Animation
2922
- onCollision?: Animation
2923
- }
2924
- }
2925
-
2926
- /* 3D viewer brick */
2927
- export type Brick3DViewer = Brick &
2928
- Brick3DViewerDef & {
2929
- templateKey: 'BRICK_3D_VIEWER'
2930
- switches: Array<
2931
- SwitchDef &
2932
- Brick3DViewerDef & {
2933
- conds?: Array<{
2934
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
2935
- cond:
2936
- | SwitchCondInnerStateCurrentCanvas
2937
- | SwitchCondData
2938
- | {
2939
- __typename: 'SwitchCondInnerStateOutlet'
2940
- outlet: ''
2941
- value: any
2942
- }
2943
- }>
2944
- }
2945
- >
2946
- }
2947
-
2948
- interface GenerativeMediaDef {
2949
- /*
2950
- Default property:
2951
- {
2952
- "enableCache": true,
2953
- "type": "image",
2954
- "resizeMode": "cover",
2955
- "provider": "openai",
2956
- "freepikClassicImageSize": "square_1_1"
2957
- }
2958
- */
2959
- property?: BrickBasicProperty & {
2960
- /* The text prompt to generate media from */
2961
- prompt?: string | DataLink
2962
- /* Enable cache */
2963
- enableCache?: boolean | DataLink
2964
- /* The type of media to generate (image or video) */
2965
- type?: 'image' | 'video' | DataLink
2966
- /* Default image to display when no generated image is available */
2967
- defaultImage?: string | DataLink
2968
- /* The Lottie animation to show while generating */
2969
- loadingAnimation?: string | DataLink
2970
- /* The Lottie animation to show when an error occurs */
2971
- errorAnimation?: string | DataLink
2972
- /* The resize mode for the generated media */
2973
- resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
2974
- /* The API key for the generative media service */
2975
- apiKey?: string | DataLink
2976
- /* The AI provider to use for generation (openai, freepik, or deepai) */
2977
- provider?: 'openai' | 'freepik-classic' | 'deepai' | DataLink
2978
- /* OpenAI image size (256x256, 512x512, 1024x1024, etc) */
2979
- openaiSize?: '1024x1024' | '1024x1792' | '1792x1024' | DataLink
2980
- /* OpenAI image style (vivid or natural) */
2981
- openaiStyle?: 'vivid' | 'natural' | DataLink
2982
- /* OpenAI image quality (standard or hd) */
2983
- openaiQuality?: 'standard' | 'hd' | DataLink
2984
- /* Freepik image size */
2985
- freepikClassicImageSize?:
2986
- | 'square_1_1'
2987
- | 'classic_4_3'
2988
- | 'traditional_3_4'
2989
- | 'widescreen_16_9'
2990
- | 'social_story_9_16'
2991
- | 'smartphone_horizontal_20_9'
2992
- | 'smartphone_vertical_9_20'
2993
- | 'standard_3_2'
2994
- | 'portrait_2_3'
2995
- | 'horizontal_2_1'
2996
- | 'vertical_1_2'
2997
- | 'social_5_4'
2998
- | 'social_post_4_5'
2999
- | DataLink
3000
- /* Freepik image style */
3001
- freepikClassicStyle?:
3002
- | 'photo'
3003
- | 'digital-art'
3004
- | '3d'
3005
- | 'painting'
3006
- | 'low-poly'
3007
- | 'pixel-art'
3008
- | 'anime'
3009
- | 'cyberpunk'
3010
- | 'comic'
3011
- | 'vintage'
3012
- | 'cartoon'
3013
- | 'vector'
3014
- | 'studio-shot'
3015
- | 'dark'
3016
- | 'sketch'
3017
- | 'mockup'
3018
- | '2000s-pone'
3019
- | '70s-vibe'
3020
- | 'watercolor'
3021
- | 'art-nouveau'
3022
- | 'origami'
3023
- | 'surreal'
3024
- | 'fantasy'
3025
- | 'traditional-japan'
3026
- | DataLink
3027
- /* Freepik color scheme */
3028
- freepikClassicStyleColor?:
3029
- | 'b&w'
3030
- | 'pastel'
3031
- | 'sepia'
3032
- | 'dramatic'
3033
- | 'vibrant'
3034
- | 'orange&teal'
3035
- | 'film-filter'
3036
- | 'split'
3037
- | 'electric'
3038
- | 'pastel-pink'
3039
- | 'gold-glow'
3040
- | 'autumn'
3041
- | 'muted-green'
3042
- | 'deep-teal'
3043
- | 'duotone'
3044
- | 'terracotta&teal'
3045
- | 'red&blue'
3046
- | 'cold-neon'
3047
- | 'burgundy&blue'
3048
- | DataLink
3049
- /* Freepik lighting style */
3050
- freepikClassicStyleLighting?:
3051
- | 'studio'
3052
- | 'warm'
3053
- | 'cinematic'
3054
- | 'volumetric'
3055
- | 'golden-hour'
3056
- | 'long-exposure'
3057
- | 'cold'
3058
- | 'iridescent'
3059
- | 'dramatic'
3060
- | 'hardlight'
3061
- | 'redscale'
3062
- | 'indoor-light'
3063
- | DataLink
3064
- /* Freepik framing style */
3065
- freepikClassicStyleFraming?:
3066
- | 'portrait'
3067
- | 'macro'
3068
- | 'panoramic'
3069
- | 'aerial-view'
3070
- | 'close-up'
3071
- | 'cinematic'
3072
- | 'high-angle'
3073
- | 'low-angle'
3074
- | 'symmetry'
3075
- | 'fish-eye'
3076
- | 'first-person'
3077
- | DataLink
3078
- /* Freepik guidance scale (level of fidelity to prompt) */
3079
- freepikClassicGuidanceScale?: number | DataLink
3080
- /* Freepik negative prompt (attributes to avoid) */
3081
- freepikClassicNegativePrompt?: string | DataLink
3082
- /* DeepAI negative prompt (attributes to avoid) */
3083
- deepaiNegativePrompt?: string | DataLink
3084
- /* DeepAI image generator version */
3085
- deepaiImageGeneratorVersion?: 'standard' | 'hd' | DataLink
3086
- /* DeepAI output image width */
3087
- deepaiWidth?: number | DataLink
3088
- /* DeepAI output image height */
3089
- deepaiHeight?: number | DataLink
3090
- }
3091
- events?: BrickBasicEvents & {
3092
- /* Event of the brick press */
3093
- generativeMediaOnPress?: Array<EventAction>
3094
- /* Event of the brick press in */
3095
- generativeMediaOnPressIn?: Array<EventAction>
3096
- /* Event of the brick press out */
3097
- generativeMediaOnPressOut?: Array<EventAction>
3098
- /* Event of the brick focus (Use TV Device with controller) */
3099
- generativeMediaOnFocus?: Array<EventAction>
3100
- /* Event of the brick blur (Use TV Device with controller) */
3101
- generativeMediaOnBlur?: Array<EventAction>
3102
- /* Event when media generation succeeds */
3103
- onSuccess?: Array<EventAction>
3104
- /* Event when media generation fails */
3105
- onError?: Array<EventAction>
3106
- /* Event when media prompt request starts */
3107
- promptStart?: Array<EventAction>
3108
- /* Event when media prompt request succeeds */
3109
- promptSuccess?: Array<EventAction>
3110
- /* Event when media prompt request fails */
3111
- promptError?: Array<EventAction>
3112
- /* Event when media loading starts */
3113
- loadStart?: Array<EventAction>
3114
- /* Event when media loading succeeds */
3115
- loadSuccess?: Array<EventAction>
3116
- /* Event when media loading fails */
3117
- loadError?: Array<EventAction>
3118
- }
3119
- outlets?: {
3120
- /* Brick is pressing */
3121
- brickPressing?: () => Data
3122
- /* Brick is focusing (Use TV Device with controller) */
3123
- brickFocusing?: () => Data
3124
- /* Generated media URL */
3125
- url?: () => Data
3126
- /* Generated media error */
3127
- error?: () => Data
3128
- }
3129
- animation?: AnimationBasicEvents & {
3130
- generativeMediaOnPress?: Animation
3131
- generativeMediaOnPressIn?: Animation
3132
- generativeMediaOnPressOut?: Animation
3133
- generativeMediaOnFocus?: Animation
3134
- generativeMediaOnBlur?: Animation
3135
- onSuccess?: Animation
3136
- onError?: Animation
3137
- promptStart?: Animation
3138
- promptSuccess?: Animation
3139
- promptError?: Animation
3140
- loadStart?: Animation
3141
- loadSuccess?: Animation
3142
- loadError?: Animation
3143
- }
3144
- }
3145
-
3146
- /* Generative Media brick - Generate images and videos using AI */
3147
- export type GenerativeMedia = Brick &
3148
- GenerativeMediaDef & {
3149
- templateKey: 'BRICK_GENERATIVE_MEDIA'
3150
- switches: Array<
3151
- SwitchDef &
3152
- GenerativeMediaDef & {
3153
- conds?: Array<{
3154
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
3155
- cond:
3156
- | SwitchCondInnerStateCurrentCanvas
3157
- | SwitchCondData
3158
- | {
3159
- __typename: 'SwitchCondInnerStateOutlet'
3160
- outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error'
3161
- value: any
3162
- }
3163
- }>
3164
- }
3165
- >
3166
- }