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

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 +156 -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
@@ -0,0 +1,91 @@
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
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ interface BrickSvgDef {
16
+ /*
17
+ Default property:
18
+ {
19
+ "source": "",
20
+ "uri": "",
21
+ "renderMode": "general"
22
+ }
23
+ */
24
+ property?: BrickBasicProperty & {
25
+ /* The SVG XML content */
26
+ source?: string | DataLink
27
+ /* The svg source location (URL or LocalPath) */
28
+ uri?: string | DataLink
29
+ /* The checksum of file */
30
+ md5?: string | DataLink
31
+ /* The rules of replacing origin colour */
32
+ colorMapping?:
33
+ | Array<
34
+ | DataLink
35
+ | {
36
+ findItem?: string | DataLink
37
+ replaceItem?: string | DataLink
38
+ }
39
+ >
40
+ | DataLink
41
+ /* The render mode */
42
+ renderMode?: 'general' | 'legacy' | DataLink
43
+ }
44
+ events?: BrickBasicEvents & {
45
+ /* Event of the brick press */
46
+ onPress?: Array<EventAction>
47
+ /* Event of the brick press in */
48
+ onPressIn?: Array<EventAction>
49
+ /* Event of the brick press out */
50
+ onPressOut?: Array<EventAction>
51
+ /* Event of the brick focus (Use TV Device with controller) */
52
+ onFocus?: Array<EventAction>
53
+ /* Event of the brick blur (Use TV Device with controller) */
54
+ onBlur?: Array<EventAction>
55
+ }
56
+ outlets?: {
57
+ /* Brick is pressing */
58
+ brickPressing?: () => Data
59
+ /* Brick is focusing (Use TV Device with controller) */
60
+ brickFocusing?: () => Data
61
+ }
62
+ animation?: AnimationBasicEvents & {
63
+ onPress?: Animation
64
+ onPressIn?: Animation
65
+ onPressOut?: Animation
66
+ onFocus?: Animation
67
+ onBlur?: Animation
68
+ }
69
+ }
70
+
71
+ /* SVG is an XML-based vector image format for 2D graphics */
72
+ export type BrickSvg = Brick &
73
+ BrickSvgDef & {
74
+ templateKey: 'BRICK_SVG'
75
+ switches: Array<
76
+ SwitchDef &
77
+ BrickSvgDef & {
78
+ conds?: Array<{
79
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
80
+ cond:
81
+ | SwitchCondInnerStateCurrentCanvas
82
+ | SwitchCondData
83
+ | {
84
+ __typename: 'SwitchCondInnerStateOutlet'
85
+ outlet: 'brickPressing' | 'brickFocusing'
86
+ value: any
87
+ }
88
+ }>
89
+ }
90
+ >
91
+ }
@@ -0,0 +1,140 @@
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
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ interface BrickTextDef {
16
+ /*
17
+ Default property:
18
+ {
19
+ "text": "",
20
+ "templateType": "${}",
21
+ "color": "#000",
22
+ "fontWeight": "normal",
23
+ "fontStyle": "normal",
24
+ "fontPadding": true,
25
+ "fontSizeVector": 0.5,
26
+ "lineNumber": 1,
27
+ "textAlign": "center",
28
+ "textAlignVertical": "center"
29
+ }
30
+ */
31
+ property?: BrickBasicProperty & {
32
+ /* The text content */
33
+ text?: string | DataLink | number | DataLink | boolean | DataLink | string | DataLink | DataLink
34
+ /* Data to be used in the text template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
35
+ templateData?: {} | DataLink
36
+ /* The text template type */
37
+ templateType?: '${}' | '{{}}' | DataLink
38
+ /* The text replacement (Regular Expression), can be multiple. */
39
+ replace?:
40
+ | Array<
41
+ | DataLink
42
+ | {
43
+ regex?: string | DataLink
44
+ replaceWith?: string | DataLink
45
+ }
46
+ >
47
+ | DataLink
48
+ /* The text color */
49
+ color?: string | DataLink
50
+ /* 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. */
51
+ fontWeight?:
52
+ | 'normal'
53
+ | 'bold'
54
+ | '100'
55
+ | '200'
56
+ | '300'
57
+ | '400'
58
+ | '500'
59
+ | '600'
60
+ | '700'
61
+ | '800'
62
+ | '900'
63
+ | DataLink
64
+ /* The text font style */
65
+ fontStyle?: 'normal' | 'italic' | DataLink
66
+ /* The text font family */
67
+ fontFamily?: string | DataLink
68
+ /* [Android only] Set to No to remove extra font padding intended to make space for certain ascenders / descenders. */
69
+ fontPadding?: boolean | DataLink
70
+ /* The text font size (grid) */
71
+ fontSize?: number | DataLink
72
+ /* 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. */
73
+ fontSizeVector?: number | DataLink
74
+ /* The text letter spacing (grid) */
75
+ letterSpacing?: number | DataLink
76
+ /* The line height of text content (grid) */
77
+ lineHeight?: number | DataLink
78
+ /* The line number limit of text content */
79
+ lineNumber?: number | DataLink
80
+ /* The text align */
81
+ textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink
82
+ /* The text align vertical */
83
+ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink
84
+ /* Enable vertical rendering */
85
+ verticalRendering?: boolean | DataLink
86
+ }
87
+ events?: BrickBasicEvents & {
88
+ /* Event of the brick press */
89
+ onPress?: Array<EventAction>
90
+ /* Event of the brick press in */
91
+ onPressIn?: Array<EventAction>
92
+ /* Event of the brick press out */
93
+ onPressOut?: Array<EventAction>
94
+ /* Event of the brick focus (Use TV Device with controller) */
95
+ onFocus?: Array<EventAction>
96
+ /* Event of the brick blur (Use TV Device with controller) */
97
+ onBlur?: Array<EventAction>
98
+ /* Event of the text content on change start */
99
+ beforeValueChange?: Array<EventAction>
100
+ /* Event of the text content on change end */
101
+ valueChange?: Array<EventAction>
102
+ }
103
+ outlets?: {
104
+ /* Brick is pressing */
105
+ brickPressing?: () => Data
106
+ /* Brick is focusing (Use TV Device with controller) */
107
+ brickFocusing?: () => Data
108
+ }
109
+ animation?: AnimationBasicEvents & {
110
+ onPress?: Animation
111
+ onPressIn?: Animation
112
+ onPressOut?: Animation
113
+ onFocus?: Animation
114
+ onBlur?: Animation
115
+ beforeValueChange?: Animation
116
+ valueChange?: Animation
117
+ }
118
+ }
119
+
120
+ /* Text brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378574-text)) */
121
+ export type BrickText = Brick &
122
+ BrickTextDef & {
123
+ templateKey: 'BRICK_TEXT'
124
+ switches: Array<
125
+ SwitchDef &
126
+ BrickTextDef & {
127
+ conds?: Array<{
128
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
129
+ cond:
130
+ | SwitchCondInnerStateCurrentCanvas
131
+ | SwitchCondData
132
+ | {
133
+ __typename: 'SwitchCondInnerStateOutlet'
134
+ outlet: 'brickPressing' | 'brickFocusing'
135
+ value: any
136
+ }
137
+ }>
138
+ }
139
+ >
140
+ }
@@ -0,0 +1,231 @@
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
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ /* Focus TextInput */
16
+ export type BrickTextInputActionFocus = Action & {
17
+ __actionName: 'BRICK_TEXT_INPUT_FOCUS'
18
+ }
19
+
20
+ /* Blur TextInput */
21
+ export type BrickTextInputActionBlur = Action & {
22
+ __actionName: 'BRICK_TEXT_INPUT_BLUR'
23
+ }
24
+
25
+ /* Clear TextInput */
26
+ export type BrickTextInputActionClear = Action & {
27
+ __actionName: 'BRICK_TEXT_INPUT_CLEAR'
28
+ }
29
+
30
+ /* Reset TextInput to default value */
31
+ export type BrickTextInputActionResetToDefault = Action & {
32
+ __actionName: 'BRICK_TEXT_INPUT_RESET_TO_DEFAULT'
33
+ }
34
+
35
+ /* Focus the input and select text with regex or start/end */
36
+ export type BrickTextInputActionSelectText = ActionWithParams & {
37
+ __actionName: 'BRICK_TEXT_INPUT_SELECT_TEXT'
38
+ params?: Array<
39
+ | {
40
+ input: 'regex'
41
+ value?: string | DataLink | EventProperty
42
+ mapping?: string
43
+ }
44
+ | {
45
+ input: 'start'
46
+ value?: number | DataLink | EventProperty
47
+ mapping?: string
48
+ }
49
+ | {
50
+ input: 'end'
51
+ value?: number | DataLink | EventProperty
52
+ mapping?: string
53
+ }
54
+ >
55
+ }
56
+
57
+ /* Set text value of the TextInput */
58
+ export type BrickTextInputActionSetText = ActionWithParams & {
59
+ __actionName: 'BRICK_TEXT_INPUT_SET_TEXT'
60
+ params?: Array<{
61
+ input: 'text'
62
+ value?: string | DataLink | EventProperty
63
+ mapping?: string
64
+ }>
65
+ }
66
+
67
+ /* Append text value of the TextInput */
68
+ export type BrickTextInputActionAppendText = ActionWithParams & {
69
+ __actionName: 'BRICK_TEXT_INPUT_APPEND_TEXT'
70
+ params?: Array<{
71
+ input: 'text'
72
+ value?: string | DataLink | EventProperty
73
+ mapping?: string
74
+ }>
75
+ }
76
+
77
+ /* Trigger regex */
78
+ export type BrickTextInputActionTrySubmit = Action & {
79
+ __actionName: 'BRICK_TEXT_INPUT_TRY_SUBMIT'
80
+ }
81
+
82
+ interface BrickTextInputDef {
83
+ /*
84
+ Default property:
85
+ {
86
+ "editable": true,
87
+ "defaultValue": "",
88
+ "color": "#000",
89
+ "fontWeight": "normal",
90
+ "fontStyle": "normal",
91
+ "fontSizeVector": 0.5,
92
+ "lineNumber": 1,
93
+ "textAlign": "center",
94
+ "textAlignVertical": "center",
95
+ "keyboardType": "default",
96
+ "returnKeyType": "done"
97
+ }
98
+ */
99
+ property?: BrickBasicProperty & {
100
+ /* Allow to edit */
101
+ editable?: boolean | DataLink
102
+ /* The default value of the text input */
103
+ defaultValue?: string | DataLink
104
+ /* The text color */
105
+ color?: string | DataLink
106
+ /* 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. */
107
+ fontWeight?:
108
+ | 'normal'
109
+ | 'bold'
110
+ | '100'
111
+ | '200'
112
+ | '300'
113
+ | '400'
114
+ | '500'
115
+ | '600'
116
+ | '700'
117
+ | '800'
118
+ | '900'
119
+ | DataLink
120
+ /* The text font style */
121
+ fontStyle?: 'normal' | 'italic' | DataLink
122
+ /* The text font family */
123
+ fontFamily?: string | DataLink
124
+ /* The text font size (grid) */
125
+ fontSize?: number | DataLink
126
+ /* 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. */
127
+ fontSizeVector?: number | DataLink
128
+ /* The text letter spacing (grid) */
129
+ letterSpacing?: number | DataLink
130
+ /* The line height of text content (grid) */
131
+ lineHeight?: number | DataLink
132
+ /* The line number limit of text content (Use 0 to unlimited) */
133
+ lineNumber?: number | DataLink
134
+ /* The text align */
135
+ textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink
136
+ /* The text align vertical */
137
+ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink
138
+ /* The placeholder text */
139
+ placeholder?: string | DataLink
140
+ /* Color of the placeholder text */
141
+ placeholderTextColor?: string | DataLink
142
+ /* Limits the maximum number of characters that can be entered */
143
+ maxLength?: number | DataLink
144
+ /* The virtual keyboard type */
145
+ keyboardType?:
146
+ | 'default'
147
+ | 'number-pad'
148
+ | 'decimal-pad'
149
+ | 'numeric'
150
+ | 'email-address'
151
+ | 'phone-pad'
152
+ | DataLink
153
+ /* The virtual keyboard return key type The line number should be 1. */
154
+ returnKeyType?: 'done' | 'go' | 'next' | 'search' | 'send' | DataLink
155
+ /* Trigger event on input change after debounce time */
156
+ debounce?: number | DataLink
157
+ /* Regular Expression to match */
158
+ regex?: string | DataLink
159
+ /* The regex matching complete mode */
160
+ completeMode?: 'allMatch' | 'oneMatch' | DataLink
161
+ /* Auto submit when regex match */
162
+ autoSubmitWhenMatch?: boolean | DataLink
163
+ /* Blur TextInput on submit */
164
+ blurOnSubmit?: boolean | DataLink
165
+ }
166
+ events?: BrickBasicEvents & {
167
+ /* Event of the TextInput is focused */
168
+ onFocus?: Array<EventAction>
169
+ /* Event of the input field is blurred */
170
+ onBlur?: Array<EventAction>
171
+ /* Event of the TextInput is empty */
172
+ onEmpty?: Array<EventAction>
173
+ /* Event of the TextInput value change */
174
+ onChange?: Array<EventAction>
175
+ /* Event of the TextInput submit */
176
+ onSubmit?: Array<EventAction>
177
+ /* Event of the TextInput match regex (check every value change) */
178
+ onMatch?: Array<EventAction>
179
+ /* Event of the TextInput not match regex (check every value change) */
180
+ onNotMatch?: Array<EventAction>
181
+ /* Event of the TextInput not match regex (check every submit) */
182
+ onResultNotMatch?: Array<EventAction>
183
+ /* Event of the TextInput reach max length or match regex */
184
+ onFullFill?: Array<EventAction>
185
+ }
186
+ outlets?: {
187
+ /* The raw input */
188
+ rawInput?: () => Data
189
+ /* The regex result */
190
+ resultVariable?: () => Data
191
+ /* Last key in */
192
+ lastKey?: () => Data
193
+ /* Selection of the TextInput (start, end, text) */
194
+ selection?: () => Data
195
+ /* Selection text of the TextInput */
196
+ selectionText?: () => Data
197
+ }
198
+ animation?: AnimationBasicEvents & {
199
+ onFocus?: Animation
200
+ onBlur?: Animation
201
+ onEmpty?: Animation
202
+ onChange?: Animation
203
+ onSubmit?: Animation
204
+ onMatch?: Animation
205
+ onNotMatch?: Animation
206
+ onResultNotMatch?: Animation
207
+ onFullFill?: Animation
208
+ }
209
+ }
210
+
211
+ /* Text Input brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378575-text-input)) */
212
+ export type BrickTextInput = Brick &
213
+ BrickTextInputDef & {
214
+ templateKey: 'BRICK_TEXT_INPUT'
215
+ switches: Array<
216
+ SwitchDef &
217
+ BrickTextInputDef & {
218
+ conds?: Array<{
219
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
220
+ cond:
221
+ | SwitchCondInnerStateCurrentCanvas
222
+ | SwitchCondData
223
+ | {
224
+ __typename: 'SwitchCondInnerStateOutlet'
225
+ outlet: 'rawInput' | 'resultVariable' | 'lastKey' | 'selection' | 'selectionText'
226
+ value: any
227
+ }
228
+ }>
229
+ }
230
+ >
231
+ }
@@ -0,0 +1,167 @@
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
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ /* Play the video */
16
+ export type BrickVideoActionPlay = Action & {
17
+ __actionName: 'BRICK_VIDEO_PLAY'
18
+ }
19
+
20
+ /* Seek the video */
21
+ export type BrickVideoActionSeek = ActionWithParams & {
22
+ __actionName: 'BRICK_VIDEO_SEEK'
23
+ params?: Array<
24
+ | {
25
+ input: 'seekTime'
26
+ value?: number | DataLink | EventProperty
27
+ mapping?: string
28
+ }
29
+ | {
30
+ input: 'play'
31
+ value?: boolean | DataLink | EventProperty
32
+ mapping?: string
33
+ }
34
+ >
35
+ }
36
+
37
+ /* Pause the video */
38
+ export type BrickVideoActionPause = Action & {
39
+ __actionName: 'BRICK_VIDEO_PAUSE'
40
+ }
41
+
42
+ /* Replay the video */
43
+ export type BrickVideoActionReplay = Action & {
44
+ __actionName: 'BRICK_VIDEO_REPLAY'
45
+ }
46
+
47
+ /* Stop the video */
48
+ export type BrickVideoActionStop = Action & {
49
+ __actionName: 'BRICK_VIDEO_STOP'
50
+ }
51
+
52
+ interface BrickVideoDef {
53
+ /*
54
+ Default property:
55
+ {
56
+ "paused": false,
57
+ "volume": 100,
58
+ "muted": false,
59
+ "progressUpdateInterval": 1000,
60
+ "replayTimeout": 500,
61
+ "renderMode": "auto"
62
+ }
63
+ */
64
+ property?: BrickBasicProperty & {
65
+ /* The video path list or single path (File, URL) */
66
+ path?:
67
+ | string
68
+ | DataLink
69
+ | DataLink
70
+ | {
71
+ url?: string | DataLink
72
+ }
73
+ | Array<
74
+ | DataLink
75
+ | {
76
+ url?: string | DataLink
77
+ }
78
+ | string
79
+ | DataLink
80
+ | DataLink
81
+ >
82
+ | DataLink
83
+ | DataLink
84
+ /* The checksum of file */
85
+ md5?: string | DataLink
86
+ /* Controls whether the video is paused */
87
+ paused?: boolean | DataLink
88
+ /* Volume */
89
+ volume?: number | DataLink
90
+ /* Muted */
91
+ muted?: boolean | DataLink
92
+ /* Video resize mode */
93
+ resizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
94
+ /* Repeat the video path list */
95
+ repeat?: boolean | DataLink
96
+ /* Progress Update Interval */
97
+ progressUpdateInterval?: number | DataLink
98
+ /* Replay on playing error */
99
+ replayOnError?: boolean | DataLink
100
+ /* Timeout to replay if repeat or replayOnError is true and video is end or error */
101
+ replayTimeout?: number | DataLink
102
+ /* 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 */
103
+ renderMode?: 'auto' | 'texture' | 'surface' | DataLink
104
+ }
105
+ events?: BrickBasicEvents & {
106
+ /* Event of the brick press */
107
+ onPress?: Array<EventAction>
108
+ /* Event of the brick press in */
109
+ onPressIn?: Array<EventAction>
110
+ /* Event of the brick press out */
111
+ onPressOut?: Array<EventAction>
112
+ /* Event of the brick focus (Use TV Device with controller) */
113
+ onFocus?: Array<EventAction>
114
+ /* Event of the brick blur (Use TV Device with controller) */
115
+ onBlur?: Array<EventAction>
116
+ /* Event of the next video on change start */
117
+ nextVideo?: Array<EventAction>
118
+ /* Event on plays of path are totally end */
119
+ roundEnd?: Array<EventAction>
120
+ /* Event on video load */
121
+ onLoad?: Array<EventAction>
122
+ /* Event of the video playing error */
123
+ onError?: Array<EventAction>
124
+ /* Event of the video progress interval */
125
+ onProgress?: Array<EventAction>
126
+ }
127
+ outlets?: {
128
+ /* Brick is pressing */
129
+ brickPressing?: () => Data
130
+ /* Brick is focusing (Use TV Device with controller) */
131
+ brickFocusing?: () => Data
132
+ }
133
+ animation?: AnimationBasicEvents & {
134
+ onPress?: Animation
135
+ onPressIn?: Animation
136
+ onPressOut?: Animation
137
+ onFocus?: Animation
138
+ onBlur?: Animation
139
+ nextVideo?: Animation
140
+ roundEnd?: Animation
141
+ onLoad?: Animation
142
+ onError?: Animation
143
+ onProgress?: Animation
144
+ }
145
+ }
146
+
147
+ /* Video brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378577-video)) */
148
+ export type BrickVideo = Brick &
149
+ BrickVideoDef & {
150
+ templateKey: 'BRICK_VIDEO'
151
+ switches: Array<
152
+ SwitchDef &
153
+ BrickVideoDef & {
154
+ conds?: Array<{
155
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
156
+ cond:
157
+ | SwitchCondInnerStateCurrentCanvas
158
+ | SwitchCondData
159
+ | {
160
+ __typename: 'SwitchCondInnerStateOutlet'
161
+ outlet: 'brickPressing' | 'brickFocusing'
162
+ value: any
163
+ }
164
+ }>
165
+ }
166
+ >
167
+ }