@fugood/bricks-project 2.21.0-beta.14.test0

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