@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.62

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 (192) hide show
  1. package/package.json +4 -28
  2. package/tools/__tests__/legacy-forwarder.test.js +91 -0
  3. package/tools/_forward.ts +26 -0
  4. package/tools/deploy.ts +3 -175
  5. package/tools/mcp-server.ts +3 -35
  6. package/tools/postinstall.ts +3 -291
  7. package/tools/pull.ts +3 -198
  8. package/tools/push-config.ts +3 -113
  9. package/tools/simulator.ts +3 -149
  10. package/compile/__tests__/config-diff.test.js +0 -100
  11. package/compile/__tests__/index.test.js +0 -461
  12. package/compile/__tests__/util.test.js +0 -450
  13. package/compile/action-name-map.ts +0 -1079
  14. package/compile/config-diff.ts +0 -155
  15. package/compile/index.ts +0 -1594
  16. package/compile/util.ts +0 -482
  17. package/index.ts +0 -6
  18. package/skills/bricks-ctor/SKILL.md +0 -38
  19. package/skills/bricks-ctor/references/animation.md +0 -160
  20. package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
  21. package/skills/bricks-ctor/references/automations.md +0 -232
  22. package/skills/bricks-ctor/references/buttress.md +0 -245
  23. package/skills/bricks-ctor/references/data-calculation.md +0 -252
  24. package/skills/bricks-ctor/references/local-sync.md +0 -129
  25. package/skills/bricks-ctor/references/media-flow.md +0 -165
  26. package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
  27. package/skills/bricks-ctor/references/simulator.md +0 -132
  28. package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
  29. package/skills/bricks-ctor/references/standby-transition.md +0 -124
  30. package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
  31. package/skills/bricks-design/SKILL.md +0 -171
  32. package/skills/bricks-design/references/architecture-truths.md +0 -132
  33. package/skills/bricks-design/references/avoiding-complexity.md +0 -91
  34. package/skills/bricks-design/references/design-critique.md +0 -195
  35. package/skills/bricks-design/references/design-languages.md +0 -265
  36. package/skills/bricks-design/references/performance.md +0 -116
  37. package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
  38. package/skills/bricks-design/references/translating-inputs.md +0 -152
  39. package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
  40. package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
  41. package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
  42. package/skills/bricks-design/references/workflow.md +0 -134
  43. package/skills/bricks-ux/SKILL.md +0 -114
  44. package/skills/bricks-ux/references/accessibility.md +0 -162
  45. package/skills/bricks-ux/references/flow-states.md +0 -175
  46. package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
  47. package/skills/bricks-ux/references/monitoring-screens.md +0 -153
  48. package/skills/bricks-ux/references/pressable-composition.md +0 -126
  49. package/skills/bricks-ux/references/user-journey.md +0 -168
  50. package/skills/bricks-ux/references/ux-critique.md +0 -256
  51. package/skills/rive-marketplace/SKILL.md +0 -99
  52. package/tools/__tests__/_cli-error.test.ts +0 -35
  53. package/tools/__tests__/_mcp-config.test.ts +0 -67
  54. package/tools/__tests__/pull.test.ts +0 -108
  55. package/tools/_cli-error.ts +0 -17
  56. package/tools/_edits-log.ts +0 -41
  57. package/tools/_git-author.ts +0 -37
  58. package/tools/_last-pushed-commit.ts +0 -28
  59. package/tools/_mcp-config.ts +0 -42
  60. package/tools/_shell.ts +0 -180
  61. package/tools/icons/.gitattributes +0 -1
  62. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  63. package/tools/icons/fa6pro-meta.json +0 -1
  64. package/tools/mcp-env.ts +0 -13
  65. package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
  66. package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
  67. package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
  68. package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
  69. package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
  70. package/tools/mcp-tools/_editing-helpers.ts +0 -98
  71. package/tools/mcp-tools/_verify.ts +0 -50
  72. package/tools/mcp-tools/compile.ts +0 -104
  73. package/tools/mcp-tools/data-calc-editing.ts +0 -1311
  74. package/tools/mcp-tools/entry-editing.ts +0 -2297
  75. package/tools/mcp-tools/huggingface.ts +0 -772
  76. package/tools/mcp-tools/icons.ts +0 -97
  77. package/tools/mcp-tools/lottie.ts +0 -102
  78. package/tools/mcp-tools/media.ts +0 -113
  79. package/tools/simulator-main.mjs +0 -488
  80. package/tools/simulator-preload.cjs +0 -16
  81. package/types/animation.d.ts +0 -116
  82. package/types/automation.d.ts +0 -231
  83. package/types/brick-base.d.ts +0 -80
  84. package/types/bricks/Camera.d.ts +0 -246
  85. package/types/bricks/Chart.d.ts +0 -372
  86. package/types/bricks/GenerativeMedia.d.ts +0 -290
  87. package/types/bricks/Icon.d.ts +0 -98
  88. package/types/bricks/Image.d.ts +0 -126
  89. package/types/bricks/Items.d.ts +0 -480
  90. package/types/bricks/Lottie.d.ts +0 -168
  91. package/types/bricks/Maps.d.ts +0 -262
  92. package/types/bricks/QrCode.d.ts +0 -117
  93. package/types/bricks/Rect.d.ts +0 -150
  94. package/types/bricks/RichText.d.ts +0 -131
  95. package/types/bricks/Rive.d.ts +0 -220
  96. package/types/bricks/Scene3D.d.ts +0 -676
  97. package/types/bricks/Sketch.d.ts +0 -256
  98. package/types/bricks/Slideshow.d.ts +0 -201
  99. package/types/bricks/Svg.d.ts +0 -99
  100. package/types/bricks/Text.d.ts +0 -148
  101. package/types/bricks/TextInput.d.ts +0 -242
  102. package/types/bricks/Video.d.ts +0 -242
  103. package/types/bricks/VideoStreaming.d.ts +0 -112
  104. package/types/bricks/WebRtcStream.d.ts +0 -65
  105. package/types/bricks/WebView.d.ts +0 -168
  106. package/types/bricks/index.d.ts +0 -23
  107. package/types/canvas.d.ts +0 -82
  108. package/types/common.d.ts +0 -141
  109. package/types/data-calc-command/base.d.ts +0 -57
  110. package/types/data-calc-command/collection.d.ts +0 -418
  111. package/types/data-calc-command/color.d.ts +0 -432
  112. package/types/data-calc-command/constant.d.ts +0 -50
  113. package/types/data-calc-command/datetime.d.ts +0 -147
  114. package/types/data-calc-command/file.d.ts +0 -129
  115. package/types/data-calc-command/index.d.ts +0 -13
  116. package/types/data-calc-command/iteratee.d.ts +0 -23
  117. package/types/data-calc-command/logictype.d.ts +0 -190
  118. package/types/data-calc-command/math.d.ts +0 -275
  119. package/types/data-calc-command/object.d.ts +0 -119
  120. package/types/data-calc-command/sandbox.d.ts +0 -66
  121. package/types/data-calc-command/string.d.ts +0 -407
  122. package/types/data-calc-script.d.ts +0 -21
  123. package/types/data-calc.d.ts +0 -12
  124. package/types/data.d.ts +0 -97
  125. package/types/generators/AlarmClock.d.ts +0 -110
  126. package/types/generators/Assistant.d.ts +0 -640
  127. package/types/generators/BleCentral.d.ts +0 -247
  128. package/types/generators/BlePeripheral.d.ts +0 -208
  129. package/types/generators/CanvasMap.d.ts +0 -74
  130. package/types/generators/CastlesPay.d.ts +0 -87
  131. package/types/generators/DataBank.d.ts +0 -160
  132. package/types/generators/File.d.ts +0 -432
  133. package/types/generators/GraphQl.d.ts +0 -132
  134. package/types/generators/Http.d.ts +0 -222
  135. package/types/generators/HttpServer.d.ts +0 -230
  136. package/types/generators/Information.d.ts +0 -103
  137. package/types/generators/Intent.d.ts +0 -168
  138. package/types/generators/Iterator.d.ts +0 -108
  139. package/types/generators/Keyboard.d.ts +0 -105
  140. package/types/generators/LlmAnthropicCompat.d.ts +0 -212
  141. package/types/generators/LlmAppleBuiltin.d.ts +0 -159
  142. package/types/generators/LlmGgml.d.ts +0 -903
  143. package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
  144. package/types/generators/LlmMlx.d.ts +0 -228
  145. package/types/generators/LlmOnnx.d.ts +0 -213
  146. package/types/generators/LlmOpenAiCompat.d.ts +0 -312
  147. package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
  148. package/types/generators/Mcp.d.ts +0 -637
  149. package/types/generators/McpServer.d.ts +0 -289
  150. package/types/generators/MediaFlow.d.ts +0 -170
  151. package/types/generators/MqttBroker.d.ts +0 -141
  152. package/types/generators/MqttClient.d.ts +0 -141
  153. package/types/generators/Question.d.ts +0 -408
  154. package/types/generators/RealtimeTranscription.d.ts +0 -287
  155. package/types/generators/RerankerGgml.d.ts +0 -195
  156. package/types/generators/SerialPort.d.ts +0 -151
  157. package/types/generators/SoundPlayer.d.ts +0 -94
  158. package/types/generators/SoundRecorder.d.ts +0 -139
  159. package/types/generators/SpeechToTextGgml.d.ts +0 -424
  160. package/types/generators/SpeechToTextOnnx.d.ts +0 -236
  161. package/types/generators/SpeechToTextPlatform.d.ts +0 -85
  162. package/types/generators/SqLite.d.ts +0 -159
  163. package/types/generators/Step.d.ts +0 -107
  164. package/types/generators/SttAppleBuiltin.d.ts +0 -153
  165. package/types/generators/Tcp.d.ts +0 -126
  166. package/types/generators/TcpServer.d.ts +0 -147
  167. package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
  168. package/types/generators/TextToSpeechGgml.d.ts +0 -221
  169. package/types/generators/TextToSpeechOnnx.d.ts +0 -178
  170. package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
  171. package/types/generators/ThermalPrinter.d.ts +0 -193
  172. package/types/generators/Tick.d.ts +0 -83
  173. package/types/generators/Udp.d.ts +0 -120
  174. package/types/generators/VadGgml.d.ts +0 -260
  175. package/types/generators/VadOnnx.d.ts +0 -231
  176. package/types/generators/VadTraditional.d.ts +0 -138
  177. package/types/generators/VectorStore.d.ts +0 -257
  178. package/types/generators/Watchdog.d.ts +0 -107
  179. package/types/generators/WebCrawler.d.ts +0 -103
  180. package/types/generators/WebRtc.d.ts +0 -181
  181. package/types/generators/WebSocket.d.ts +0 -148
  182. package/types/generators/index.d.ts +0 -57
  183. package/types/index.d.ts +0 -13
  184. package/types/subspace.d.ts +0 -60
  185. package/types/switch.d.ts +0 -51
  186. package/types/system.d.ts +0 -707
  187. package/utils/__tests__/calc.test.js +0 -25
  188. package/utils/__tests__/id.test.js +0 -154
  189. package/utils/calc.ts +0 -130
  190. package/utils/data.ts +0 -495
  191. package/utils/event-props.ts +0 -912
  192. package/utils/id.ts +0 -133
@@ -1,231 +0,0 @@
1
- /**
2
- * Automation (Test) System Types
3
- *
4
- * This module defines TypeScript types for the BRICKS automation/testing system.
5
- * The automation system allows defining automated test sequences that can be
6
- * triggered on launch, anytime, or via cron schedules.
7
- */
8
-
9
- import type { Subspace } from './subspace'
10
- import type { Brick, Generator } from './common'
11
- import type { Canvas } from './canvas'
12
- import type { Data } from './data'
13
-
14
- // Entity reference types - can be string ID or getter function
15
- export type SubspaceRef = string | (() => Subspace)
16
- export type BrickRef = string | (() => Brick)
17
- export type GeneratorRef = string | (() => Generator)
18
- export type CanvasRef = string | (() => Canvas)
19
- export type DataRef = string | (() => Data)
20
-
21
- // Variable types for test variables
22
- export type TestVariableType = 'string' | 'number' | 'array' | 'object' | 'bool' | 'any'
23
-
24
- // Trigger types for when tests should run
25
- export type TestTriggerType = 'launch' | 'anytime' | 'cron'
26
-
27
- // Jump condition operators for conditional test flow
28
- export type JumpConditionOperator = '==' | '!=' | '>' | '>=' | '<' | '<='
29
-
30
- // Jump condition status types
31
- export type JumpConditionStatus = 'finished' | 'failed'
32
-
33
- // Jump condition types
34
- export type JumpConditionType = 'status' | 'variable'
35
-
36
- /**
37
- * Jump condition for controlling test case flow
38
- */
39
- export interface TestCaseJumpCondition {
40
- type: JumpConditionType
41
- // For status-based conditions
42
- status?: JumpConditionStatus
43
- // For variable-based conditions
44
- variable?: string
45
- operator?: JumpConditionOperator
46
- value?: any
47
- // The test case to jump to (getter function for dynamic IDs or string for static IDs)
48
- jump_to?: string | (() => TestCase)
49
- }
50
-
51
- /**
52
- * Test variable definition
53
- */
54
- export interface TestVariable {
55
- __typename: 'TestVariable'
56
- id: string
57
- name: string
58
- type: TestVariableType
59
- value: any
60
- }
61
-
62
- /**
63
- * Post delay rules for test cases
64
- */
65
- export type PostDelayRule = 'include-action-time' | 'exclude-action-time'
66
-
67
- /**
68
- * Test method names (13 methods)
69
- */
70
- export type TestMethodName =
71
- | 'brick_press'
72
- | 'brick_exists'
73
- | 'wait_until_brick_exists'
74
- | 'wait_until_event_trigger'
75
- | 'wait_until_canvas_change'
76
- | 'keydown'
77
- | 'keyup'
78
- | 'http_request'
79
- | 'assert_property'
80
- | 'wait_until_property_change'
81
- | 'execute_action'
82
- | 'match_screenshot'
83
- | 'delay'
84
-
85
- /**
86
- * Union type for all test method run arrays
87
- */
88
- export type TestMethodRun =
89
- | TestMethodRunBrickPress
90
- | TestMethodRunBrickExists
91
- | TestMethodRunWaitUntilBrickExists
92
- | TestMethodRunWaitUntilEventTrigger
93
- | TestMethodRunWaitUntilCanvasChange
94
- | TestMethodRunKeydown
95
- | TestMethodRunKeyup
96
- | TestMethodRunHttpRequest
97
- | TestMethodRunAssertProperty
98
- | TestMethodRunWaitUntilPropertyChange
99
- | TestMethodRunExecuteAction
100
- | TestMethodRunMatchScreenshot
101
- | TestMethodRunDelay
102
-
103
- // [methodName, subspaceId, brickId, options?]
104
- export type TestMethodRunBrickPress = ['brick_press', SubspaceRef, BrickRef, Record<string, any>?]
105
-
106
- // [methodName, subspaceId, brickId, frame?]
107
- export type TestMethodRunBrickExists = ['brick_exists', SubspaceRef, BrickRef, Record<string, any>?]
108
-
109
- // [methodName, subspaceId, brickId, timeout?, frame?]
110
- export type TestMethodRunWaitUntilBrickExists = [
111
- 'wait_until_brick_exists',
112
- SubspaceRef,
113
- BrickRef,
114
- number?,
115
- Record<string, any>?,
116
- ]
117
-
118
- // [methodName, subspaceId, senderId, eventKey, timeout?]
119
- // senderId can be brick or generator
120
- export type TestMethodRunWaitUntilEventTrigger = [
121
- 'wait_until_event_trigger',
122
- SubspaceRef,
123
- BrickRef | GeneratorRef,
124
- string,
125
- number?,
126
- ]
127
-
128
- // [methodName, subspaceId, canvasId, timeout?]
129
- export type TestMethodRunWaitUntilCanvasChange = [
130
- 'wait_until_canvas_change',
131
- SubspaceRef,
132
- CanvasRef,
133
- number?,
134
- ]
135
-
136
- // [methodName, keyCode, pressedKey?, flags?]
137
- export type TestMethodRunKeydown = ['keydown', number, string?, number?]
138
-
139
- // [methodName, keyCode, pressedKey?, flags?]
140
- export type TestMethodRunKeyup = ['keyup', number, string?, number?]
141
-
142
- // [methodName, url, options?]
143
- export type TestMethodRunHttpRequest = ['http_request', string, Record<string, any>?]
144
-
145
- // [methodName, subspaceId, propertyId, value]
146
- export type TestMethodRunAssertProperty = ['assert_property', SubspaceRef, DataRef, any]
147
-
148
- // [methodName, subspaceId, propertyId, value, timeout?]
149
- export type TestMethodRunWaitUntilPropertyChange = [
150
- 'wait_until_property_change',
151
- SubspaceRef,
152
- DataRef,
153
- any,
154
- number?,
155
- ]
156
-
157
- // [methodName, subspaceId, handler, action, params?, options?]
158
- export type TestMethodRunExecuteAction = [
159
- 'execute_action',
160
- SubspaceRef,
161
- string,
162
- string,
163
- Record<string, any>?,
164
- Record<string, any>?,
165
- ]
166
-
167
- // [methodName, screenshotName, threshold?, maxRetry?]
168
- export type TestMethodRunMatchScreenshot = ['match_screenshot', string, number?, number?]
169
-
170
- // [methodName, subspaceId?, propertyId?, defaultValue?]
171
- export type TestMethodRunDelay = ['delay', SubspaceRef?, DataRef?, number?]
172
-
173
- /**
174
- * Test case definition
175
- */
176
- export interface TestCase {
177
- __typename: 'TestCase'
178
- id: string
179
- name: string
180
- hideShortRef?: boolean
181
- run: TestMethodRun
182
- exit_on_failed: boolean
183
- commented: boolean
184
- pre_delay: number
185
- post_delay: number
186
- post_delay_rule?: PostDelayRule
187
- jump_cond: TestCaseJumpCondition[]
188
- }
189
-
190
- /**
191
- * Local sync mode for tests
192
- */
193
- export type LocalSyncMode = 'main-only' | 'minor-only'
194
-
195
- /**
196
- * Automation test definition
197
- */
198
- export interface AutomationTest {
199
- __typename: 'AutomationTest'
200
- id: string
201
- alias?: string
202
- title: string
203
- hideShortRef?: boolean
204
- timeout: number
205
- trigger_type?: TestTriggerType
206
- cron?: string // Cron expression when trigger_type is 'cron'
207
- skip_trigger_type_check?: boolean
208
- local_sync?: LocalSyncMode
209
- cases: TestCase[]
210
- variables: TestVariable[]
211
- meta?: Record<string, any>
212
- }
213
-
214
- /**
215
- * Automation test map (a collection of tests)
216
- */
217
- export interface AutomationTestMap {
218
- __typename: 'AutomationTestMap'
219
- id: string
220
- title: string
221
- hideShortRef?: boolean
222
- createdAt: number
223
- tests: AutomationTest[]
224
- }
225
-
226
- /**
227
- * Root automation map type (record of automation test maps by ID)
228
- */
229
- export type AutomationMap = {
230
- [mapId: string]: AutomationTestMap
231
- }
@@ -1,80 +0,0 @@
1
- /* Auto generated by build script */
2
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'
3
- import type { Data, DataLink } from './data'
4
- import type { Animation, AnimationBasicEvents, AnimationOrGetter } from './animation'
5
- import type {
6
- Brick,
7
- EventAction,
8
- EventActionForItem,
9
- ActionWithDataParams,
10
- ActionWithParams,
11
- Action,
12
- EventProperty,
13
- } from './common'
14
-
15
- export interface BrickBasicProperty {
16
- /* The brick opacity (0 ~ 1) */
17
- opacity?: number | DataLink
18
- /* The brick background color */
19
- backgroundColor?: string | DataLink
20
- /* The brick border style */
21
- borderStyle?: 'solid' | 'dotted' | 'dashed' | DataLink
22
- /* The brick border width (top) */
23
- borderTopSize?: number | DataLink
24
- /* The brick border color (top) */
25
- borderTopColor?: string | DataLink
26
- /* The brick border radius (top left) */
27
- borderTopLeftRadius?: number | DataLink
28
- /* The brick border radius (top right) */
29
- borderTopRightRadius?: number | DataLink
30
- /* The brick border width (bottom) */
31
- borderBottomSize?: number | DataLink
32
- /* The brick border color (bottom) */
33
- borderBottomColor?: string | DataLink
34
- /* The brick border radius (bottom left) */
35
- borderBottomLeftRadius?: number | DataLink
36
- /* The brick border radius (bottom right) */
37
- borderBottomRightRadius?: number | DataLink
38
- /* The brick border width (left) */
39
- borderLeftSize?: number | DataLink
40
- /* The brick border color (bottom) */
41
- borderLeftColor?: string | DataLink
42
- /* The brick border width (right) */
43
- borderRightSize?: number | DataLink
44
- /* The brick border color (right) */
45
- borderRightColor?: string | DataLink
46
- /* The brick rotate (deg) */
47
- rotate?: number | DataLink
48
- /* The brick rotateX (deg) */
49
- rotateX?: number | DataLink
50
- /* The brick rotateY (deg) */
51
- rotateY?: number | DataLink
52
- /* The brick shadow color */
53
- shadowColor?: string | DataLink
54
- /* The brick shadow opacity (0 ~ 1) */
55
- shadowOpacity?: number | DataLink
56
- /* The brick shadow radius */
57
- shadowRadius?: number | DataLink
58
- /* The brick shadow offset width */
59
- shadowOffsetWidth?: number | DataLink
60
- /* The brick shadow offset height */
61
- shadowOffsetHeight?: number | DataLink
62
- /* Brick pressable.
63
- Disabled: Disabled even if event or animation is set.
64
- Bypass: Disable and bypass the touch event on the brick. */
65
- pressable?: 'enabled' | 'disabled' | 'bypass' | DataLink
66
- /* Delay in milliseconds before long press is triggered */
67
- delayLongPress?: number | DataLink
68
- }
69
-
70
- export interface BrickBasicEvents {
71
- showStart?: Array<EventAction>
72
- switchUpdate?: Array<EventAction>
73
- standby?: Array<EventAction>
74
- }
75
-
76
- export interface BrickBasicEventsForItem {
77
- showStart?: Array<EventActionForItem>
78
- switchUpdate?: Array<EventActionForItem>
79
- standby?: Array<EventActionForItem>
80
- }
@@ -1,246 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Camera view with photo capture and barcode scanning capabilities
4
- */
5
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
- import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
- import type {
9
- Brick,
10
- EventAction,
11
- EventActionForItem,
12
- ActionWithDataParams,
13
- ActionWithParams,
14
- Action,
15
- EventProperty,
16
- } from '../common'
17
- import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
18
- import type { TemplateEventPropsMap } from '../../utils/event-props'
19
-
20
- /* Take picture on the Camera */
21
- export type BrickCameraActionTakePicture = ActionWithParams & {
22
- __actionName: 'BRICK_CAMERA_TAKE_PICTURE'
23
- params?: Array<
24
- | {
25
- input: 'width'
26
- value?: number | DataLink | EventProperty
27
- mapping?: string
28
- }
29
- | {
30
- input: 'quality'
31
- value?: string | DataLink | EventProperty
32
- mapping?: string
33
- }
34
- | {
35
- input: 'base64'
36
- value?: boolean | DataLink | EventProperty
37
- mapping?: string
38
- }
39
- | {
40
- input: 'mirrorImage'
41
- value?: boolean | DataLink | EventProperty
42
- mapping?: string
43
- }
44
- >
45
- }
46
-
47
- /* Record video on the Camera */
48
- export type BrickCameraActionRecord = ActionWithParams & {
49
- __actionName: 'BRICK_CAMERA_RECORD'
50
- params?: Array<
51
- | {
52
- input: 'quality'
53
- value?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink | EventProperty
54
- mapping?: string
55
- }
56
- | {
57
- input: 'mirrorVideo'
58
- value?: boolean | DataLink | EventProperty
59
- mapping?: string
60
- }
61
- | {
62
- input: 'videoBitrate'
63
- value?: string | DataLink | EventProperty
64
- mapping?: string
65
- }
66
- | {
67
- input: 'maxDuration'
68
- value?: number | DataLink | EventProperty
69
- mapping?: string
70
- }
71
- | {
72
- input: 'maxFileSize'
73
- value?: string | DataLink | EventProperty
74
- mapping?: string
75
- }
76
- >
77
- }
78
-
79
- /* Record video on the Camera */
80
- export type BrickCameraActionStopRecord = Action & {
81
- __actionName: 'BRICK_CAMERA_STOP_RECORD'
82
- }
83
-
84
- /* Focus the Camera at a specific point */
85
- export type BrickCameraActionFocus = ActionWithParams & {
86
- __actionName: 'BRICK_CAMERA_FOCUS'
87
- params?: Array<
88
- | {
89
- input: 'focusX'
90
- value?: number | DataLink | EventProperty
91
- mapping?: string
92
- }
93
- | {
94
- input: 'focusY'
95
- value?: number | DataLink | EventProperty
96
- mapping?: string
97
- }
98
- >
99
- }
100
-
101
- interface BrickCameraDef {
102
- /*
103
- Default property:
104
- {
105
- "type": "back",
106
- "flashMode": "off",
107
- "captureAudio": false,
108
- "whiteBalance": "auto",
109
- "faceDetectionEnabled": false,
110
- "faceDetectionEventMode": "when-detected"
111
- }
112
- */
113
- property?: BrickBasicProperty & {
114
- /* Camera type */
115
- type?: 'back' | 'front' | 'external' | DataLink
116
- /* Enable or disable camera */
117
- isActive?: boolean | DataLink
118
- /* Camera zoom */
119
- zoom?: number | DataLink
120
- /* Camera flash mode */
121
- flashMode?: 'off' | 'on' | 'torch' | 'auto' | DataLink
122
- /* Camera ratio (Unsupported ratio will be ignored) */
123
- ratio?: string | DataLink
124
- /* Capture audio when start recording */
125
- captureAudio?: boolean | DataLink
126
- /* Allows you to control the color temperature in your photos by cooling down or warming up the colors. */
127
- whiteBalance?:
128
- | 'auto'
129
- | 'sunny'
130
- | 'cloudy'
131
- | 'shadow'
132
- | 'incandescent'
133
- | 'fluorescent'
134
- | DataLink
135
- /* Enable face detection (Note: Barcode detection will be disabled when enabled) */
136
- faceDetectionEnabled?: boolean | DataLink
137
- /* Face detection event mode */
138
- faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink
139
- /* Quality of take picture */
140
- pictureQuality?: number | DataLink
141
- /* Take picture format as base64 */
142
- pictureBase64?: boolean | DataLink
143
- /* Mirror image of take picture */
144
- pictureIsMirrorImage?: boolean | DataLink
145
- /* Quality of record video */
146
- recordQuality?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink
147
- /* Bitrate of record video (bit/s) */
148
- recordVideoBitrate?: number | DataLink
149
- /* Mirror video of record video */
150
- recordMirrorVideo?: boolean | DataLink
151
- /* Max duration of record video (s) */
152
- recordMaxDuration?: number | DataLink
153
- /* Max file size of record video (bytes) */
154
- recordMaxFileSize?: number | DataLink
155
- }
156
- events?: BrickBasicEvents & {
157
- /* Event of the Camera state change */
158
- stateChange?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['stateChange']>>
159
- /* Event of the Camera record start */
160
- recordStart?: Array<EventAction>
161
- /* Event of the Camera record end */
162
- recordEnd?: Array<EventAction>
163
- /* Event of the Camera barcode read */
164
- barcodeRead?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['barcodeRead']>>
165
- /* Event of the Camera picture taken */
166
- pictureTaken?: Array<
167
- EventAction<string & keyof TemplateEventPropsMap['Camera']['pictureTaken']>
168
- >
169
- /* Event of the Camera record finished */
170
- recordFinish?: Array<
171
- EventAction<string & keyof TemplateEventPropsMap['Camera']['recordFinish']>
172
- >
173
- /* Event of the Camera mount error */
174
- mountError?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['mountError']>>
175
- }
176
- outlets?: {
177
- /* Camera device and format information */
178
- info?: () => Data<{ [key: string]: any }>
179
- /* Picture taken result */
180
- pictureTaken?: () => Data<{
181
- width?: number
182
- height?: number
183
- uri?: string
184
- base64?: string
185
- [key: string]: any
186
- }>
187
- /* Record video result */
188
- recordVideo?: () => Data<{
189
- uri?: string
190
- [key: string]: any
191
- }>
192
- /* Barcode read result */
193
- barcodeRead?: () => Data<{
194
- type?: string
195
- data?: string
196
- rawData?: string
197
- bounds?: {
198
- origin?: {
199
- x?: number
200
- y?: number
201
- [key: string]: any
202
- }
203
- size?: {
204
- width?: number
205
- height?: number
206
- [key: string]: any
207
- }
208
- [key: string]: any
209
- }
210
- [key: string]: any
211
- }>
212
- /* Faces detected result */
213
- faceDetected?: () => Data<Array<{ [key: string]: any }>>
214
- }
215
- animation?: AnimationBasicEvents & {
216
- stateChange?: AnimationOrGetter
217
- recordStart?: AnimationOrGetter
218
- recordEnd?: AnimationOrGetter
219
- barcodeRead?: AnimationOrGetter
220
- pictureTaken?: AnimationOrGetter
221
- recordFinish?: AnimationOrGetter
222
- mountError?: AnimationOrGetter
223
- }
224
- }
225
-
226
- /* Camera view with photo capture and barcode scanning capabilities */
227
- export type BrickCamera = Brick &
228
- BrickCameraDef & {
229
- templateKey: 'BRICK_CAMERA'
230
- switches?: Array<
231
- SwitchDef &
232
- BrickCameraDef & {
233
- conds?: Array<{
234
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
235
- cond:
236
- | SwitchCondInnerStateCurrentCanvas
237
- | SwitchCondData
238
- | {
239
- __typename: 'SwitchCondInnerStateOutlet'
240
- outlet: 'info' | 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
241
- value: any
242
- }
243
- }>
244
- }
245
- >
246
- }