@fugood/bricks-project 2.24.0-beta.36 → 2.24.0-beta.39

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 (83) hide show
  1. package/compile/index.ts +14 -6
  2. package/package.json +3 -3
  3. package/tools/preview-main.mjs +129 -2
  4. package/tools/preview.ts +29 -1
  5. package/types/bricks/Camera.ts +10 -5
  6. package/types/bricks/Chart.ts +5 -2
  7. package/types/bricks/GenerativeMedia.ts +20 -7
  8. package/types/bricks/Icon.ts +1 -0
  9. package/types/bricks/Image.ts +2 -1
  10. package/types/bricks/Items.ts +17 -6
  11. package/types/bricks/Lottie.ts +7 -2
  12. package/types/bricks/Maps.ts +8 -3
  13. package/types/bricks/QrCode.ts +1 -0
  14. package/types/bricks/Rect.ts +39 -3
  15. package/types/bricks/RichText.ts +1 -0
  16. package/types/bricks/Rive.ts +15 -8
  17. package/types/bricks/Slideshow.ts +12 -5
  18. package/types/bricks/Svg.ts +1 -0
  19. package/types/bricks/Text.ts +1 -0
  20. package/types/bricks/TextInput.ts +8 -5
  21. package/types/bricks/Video.ts +3 -2
  22. package/types/bricks/VideoStreaming.ts +1 -0
  23. package/types/bricks/WebRtcStream.ts +1 -0
  24. package/types/bricks/WebView.ts +4 -3
  25. package/types/common.ts +10 -8
  26. package/types/generators/AlarmClock.ts +7 -4
  27. package/types/generators/Assistant.ts +7 -4
  28. package/types/generators/BleCentral.ts +14 -5
  29. package/types/generators/BlePeripheral.ts +1 -0
  30. package/types/generators/CanvasMap.ts +2 -1
  31. package/types/generators/CastlesPay.ts +7 -2
  32. package/types/generators/DataBank.ts +8 -3
  33. package/types/generators/File.ts +41 -14
  34. package/types/generators/GraphQl.ts +4 -1
  35. package/types/generators/Http.ts +1 -0
  36. package/types/generators/HttpServer.ts +9 -4
  37. package/types/generators/Information.ts +2 -1
  38. package/types/generators/Intent.ts +3 -2
  39. package/types/generators/Iterator.ts +5 -4
  40. package/types/generators/Keyboard.ts +4 -3
  41. package/types/generators/LlmAnthropicCompat.ts +11 -4
  42. package/types/generators/LlmAppleBuiltin.ts +8 -3
  43. package/types/generators/LlmGgml.ts +12 -5
  44. package/types/generators/LlmMediaTekNeuroPilot.ts +11 -4
  45. package/types/generators/LlmMlx.ts +11 -4
  46. package/types/generators/LlmOnnx.ts +11 -4
  47. package/types/generators/LlmOpenAiCompat.ts +11 -4
  48. package/types/generators/LlmQualcommAiEngine.ts +9 -4
  49. package/types/generators/Mcp.ts +38 -15
  50. package/types/generators/McpServer.ts +15 -6
  51. package/types/generators/MediaFlow.ts +8 -3
  52. package/types/generators/MqttBroker.ts +14 -5
  53. package/types/generators/MqttClient.ts +3 -2
  54. package/types/generators/Question.ts +2 -1
  55. package/types/generators/RealtimeTranscription.ts +22 -7
  56. package/types/generators/RerankerGgml.ts +5 -2
  57. package/types/generators/SerialPort.ts +7 -2
  58. package/types/generators/SoundPlayer.ts +4 -1
  59. package/types/generators/SoundRecorder.ts +3 -2
  60. package/types/generators/SpeechToTextGgml.ts +8 -3
  61. package/types/generators/SpeechToTextOnnx.ts +5 -2
  62. package/types/generators/SpeechToTextPlatform.ts +7 -2
  63. package/types/generators/SqLite.ts +5 -2
  64. package/types/generators/Step.ts +2 -1
  65. package/types/generators/SttAppleBuiltin.ts +5 -2
  66. package/types/generators/Tcp.ts +3 -2
  67. package/types/generators/TcpServer.ts +8 -5
  68. package/types/generators/TextToSpeechAppleBuiltin.ts +5 -2
  69. package/types/generators/TextToSpeechGgml.ts +5 -2
  70. package/types/generators/TextToSpeechOnnx.ts +5 -2
  71. package/types/generators/TextToSpeechOpenAiLike.ts +5 -2
  72. package/types/generators/ThermalPrinter.ts +2 -1
  73. package/types/generators/Tick.ts +3 -2
  74. package/types/generators/Udp.ts +3 -2
  75. package/types/generators/VadGgml.ts +8 -3
  76. package/types/generators/VadOnnx.ts +6 -3
  77. package/types/generators/VadTraditional.ts +8 -3
  78. package/types/generators/VectorStore.ts +2 -1
  79. package/types/generators/Watchdog.ts +3 -2
  80. package/types/generators/WebCrawler.ts +1 -0
  81. package/types/generators/WebRtc.ts +8 -3
  82. package/types/generators/WebSocket.ts +2 -1
  83. package/utils/event-props.ts +833 -1059
@@ -19,6 +19,7 @@ import type {
19
19
  Action,
20
20
  EventProperty,
21
21
  } from '../common'
22
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
22
23
 
23
24
  /* Run text completion */
24
25
  export type GeneratorAnthropicLLMActionCompletion = ActionWithParams & {
@@ -152,13 +153,19 @@ Default property:
152
153
  }
153
154
  events?: {
154
155
  /* Error event */
155
- onError?: Array<EventAction>
156
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onError']>>
156
157
  /* Completion event */
157
- onCompletion?: Array<EventAction>
158
+ onCompletion?: Array<
159
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletion']>
160
+ >
158
161
  /* Completion finished event */
159
- onCompletionFinished?: Array<EventAction>
162
+ onCompletionFinished?: Array<
163
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletionFinished']>
164
+ >
160
165
  /* Tool use event */
161
- onToolUse?: Array<EventAction>
166
+ onToolUse?: Array<
167
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onToolUse']>
168
+ >
162
169
  }
163
170
  outlets?: {
164
171
  /* Evaluating outlet */
@@ -20,6 +20,7 @@ import type {
20
20
  Action,
21
21
  EventProperty,
22
22
  } from '../common'
23
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
23
24
 
24
25
  /* Load model */
25
26
  export type GeneratorAppleLLMActionLoadModel = Action & {
@@ -100,13 +101,17 @@ Default property:
100
101
  }
101
102
  events?: {
102
103
  /* Error event */
103
- onError?: Array<EventAction>
104
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onError']>>
104
105
  /* Model loaded event */
105
106
  onModelLoaded?: Array<EventAction>
106
107
  /* Completion event */
107
- onCompletion?: Array<EventAction>
108
+ onCompletion?: Array<
109
+ EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletion']>
110
+ >
108
111
  /* Completion finished event */
109
- onCompletionFinished?: Array<EventAction>
112
+ onCompletionFinished?: Array<
113
+ EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletionFinished']>
114
+ >
110
115
  }
111
116
  outlets?: {
112
117
  /* Context state outlet */
@@ -23,6 +23,7 @@ import type {
23
23
  Action,
24
24
  EventProperty,
25
25
  } from '../common'
26
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
26
27
 
27
28
  /* Load the model */
28
29
  export type GeneratorLLMActionLoadModel = Action & {
@@ -718,15 +719,21 @@ Default property:
718
719
  }
719
720
  events?: {
720
721
  /* Event triggered when context state changes */
721
- onContextStateChange?: Array<EventAction>
722
+ onContextStateChange?: Array<
723
+ EventAction<string & keyof TemplateEventPropsMap['Llm']['onContextStateChange']>
724
+ >
722
725
  /* Event triggered when error occurs */
723
- onError?: Array<EventAction>
726
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onError']>>
724
727
  /* Event triggered when completion */
725
- onCompletion?: Array<EventAction>
728
+ onCompletion?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletion']>>
726
729
  /* Event triggered when completion finished */
727
- onCompletionFinished?: Array<EventAction>
730
+ onCompletionFinished?: Array<
731
+ EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFinished']>
732
+ >
728
733
  /* Event triggered on get function call request */
729
- onCompletionFunctionCall?: Array<EventAction>
734
+ onCompletionFunctionCall?: Array<
735
+ EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFunctionCall']>
736
+ >
730
737
  }
731
738
  outlets?: {
732
739
  /* Context state */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Load or validate the NeuroPilot model context */
18
19
  export type GeneratorNeuropilotLlmActionLoadModel = ActionWithParams & {
@@ -172,13 +173,19 @@ Default property:
172
173
  }
173
174
  events?: {
174
175
  /* Event triggered when the NeuroPilot context state changes */
175
- onContextStateChange?: Array<EventAction>
176
+ onContextStateChange?: Array<
177
+ EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onContextStateChange']>
178
+ >
176
179
  /* Event triggered when a completion token or partial result is emitted */
177
- onCompletion?: Array<EventAction>
180
+ onCompletion?: Array<
181
+ EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onCompletion']>
182
+ >
178
183
  /* Event triggered when generation finishes */
179
- onCompletionFinished?: Array<EventAction>
184
+ onCompletionFinished?: Array<
185
+ EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onCompletionFinished']>
186
+ >
180
187
  /* Event triggered when a NeuroPilot error occurs */
181
- onError?: Array<EventAction>
188
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onError']>>
182
189
  }
183
190
  outlets?: {
184
191
  /* Current NeuroPilot context state */
@@ -20,6 +20,7 @@ import type {
20
20
  Action,
21
21
  EventProperty,
22
22
  } from '../common'
23
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
23
24
 
24
25
  /* Load model */
25
26
  export type GeneratorMlxLLMActionLoadModel = ActionWithParams & {
@@ -163,13 +164,19 @@ Default property:
163
164
  }
164
165
  events?: {
165
166
  /* Event triggered when context state changes */
166
- onContextStateChange?: Array<EventAction>
167
+ onContextStateChange?: Array<
168
+ EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onContextStateChange']>
169
+ >
167
170
  /* Error event */
168
- onError?: Array<EventAction>
171
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onError']>>
169
172
  /* Completion streaming event (emitted for each token) */
170
- onCompletion?: Array<EventAction>
173
+ onCompletion?: Array<
174
+ EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onCompletion']>
175
+ >
171
176
  /* Completion finished event */
172
- onCompletionFinished?: Array<EventAction>
177
+ onCompletionFinished?: Array<
178
+ EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onCompletionFinished']>
179
+ >
173
180
  }
174
181
  outlets?: {
175
182
  /* Context state */
@@ -14,6 +14,7 @@ import type {
14
14
  Action,
15
15
  EventProperty,
16
16
  } from '../common'
17
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
17
18
 
18
19
  /* Load the model */
19
20
  export type GeneratorOnnxLLMActionLoadModel = Action & {
@@ -153,13 +154,19 @@ Default property:
153
154
  }
154
155
  events?: {
155
156
  /* Event triggered when state change */
156
- onContextStateChange?: Array<EventAction>
157
+ onContextStateChange?: Array<
158
+ EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onContextStateChange']>
159
+ >
157
160
  /* Event triggered on get function call request */
158
- onFunctionCall?: Array<EventAction>
161
+ onFunctionCall?: Array<
162
+ EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onFunctionCall']>
163
+ >
159
164
  /* Event triggered on completion finished */
160
- onCompletionFinished?: Array<EventAction>
165
+ onCompletionFinished?: Array<
166
+ EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onCompletionFinished']>
167
+ >
161
168
  /* Event triggered when error occurs */
162
- onError?: Array<EventAction>
169
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onError']>>
163
170
  }
164
171
  outlets?: {
165
172
  /* Context state */
@@ -23,6 +23,7 @@ import type {
23
23
  Action,
24
24
  EventProperty,
25
25
  } from '../common'
26
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
26
27
 
27
28
  /* Run text completion */
28
29
  export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
@@ -170,13 +171,19 @@ Default property:
170
171
  }
171
172
  events?: {
172
173
  /* Error event */
173
- onError?: Array<EventAction>
174
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onError']>>
174
175
  /* Completion event */
175
- onCompletion?: Array<EventAction>
176
+ onCompletion?: Array<
177
+ EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletion']>
178
+ >
176
179
  /* Completion finished event */
177
- onCompletionFinished?: Array<EventAction>
180
+ onCompletionFinished?: Array<
181
+ EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFinished']>
182
+ >
178
183
  /* Completion function call event */
179
- onCompletionFunctionCall?: Array<EventAction>
184
+ onCompletionFunctionCall?: Array<
185
+ EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFunctionCall']>
186
+ >
180
187
  }
181
188
  outlets?: {
182
189
  /* Evaluating outlet */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Load the model */
18
19
  export type GeneratorQnnLlmActionLoadModel = Action & {
@@ -168,13 +169,17 @@ Default property:
168
169
  }
169
170
  events?: {
170
171
  /* Event triggered when context state changes */
171
- onContextStateChange?: Array<EventAction>
172
+ onContextStateChange?: Array<
173
+ EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onContextStateChange']>
174
+ >
172
175
  /* Event triggered when generate is done */
173
- onGenerate?: Array<EventAction>
176
+ onGenerate?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onGenerate']>>
174
177
  /* Event triggered on get function call request */
175
- onFunctionCall?: Array<EventAction>
178
+ onFunctionCall?: Array<
179
+ EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onFunctionCall']>
180
+ >
176
181
  /* Event triggered when error occurs */
177
- onError?: Array<EventAction>
182
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onError']>>
178
183
  }
179
184
  outlets?: {
180
185
  /* Context state */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Connect to MCP server */
18
19
  export type GeneratorMCPActionConnect = Action & {
@@ -192,37 +193,59 @@ Default property:
192
193
  /* On connected */
193
194
  onConnected?: Array<EventAction>
194
195
  /* On connection error */
195
- onConnectionError?: Array<EventAction>
196
+ onConnectionError?: Array<
197
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onConnectionError']>
198
+ >
196
199
  /* On disconnected */
197
200
  onDisconnected?: Array<EventAction>
198
201
  /* On list resources */
199
- onListResources?: Array<EventAction>
202
+ onListResources?: Array<
203
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResources']>
204
+ >
200
205
  /* On list resources error */
201
- onListResourcesError?: Array<EventAction>
206
+ onListResourcesError?: Array<
207
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourcesError']>
208
+ >
202
209
  /* On list resource templates */
203
- onListResourceTemplates?: Array<EventAction>
210
+ onListResourceTemplates?: Array<
211
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplates']>
212
+ >
204
213
  /* On list resource templates error */
205
- onListResourceTemplatesError?: Array<EventAction>
214
+ onListResourceTemplatesError?: Array<
215
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplatesError']>
216
+ >
206
217
  /* On read resource */
207
- onReadResource?: Array<EventAction>
218
+ onReadResource?: Array<
219
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResource']>
220
+ >
208
221
  /* On read resource error */
209
- onReadResourceError?: Array<EventAction>
222
+ onReadResourceError?: Array<
223
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResourceError']>
224
+ >
210
225
  /* On list tools */
211
- onListTools?: Array<EventAction>
226
+ onListTools?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListTools']>>
212
227
  /* On list tools error */
213
- onListToolsError?: Array<EventAction>
228
+ onListToolsError?: Array<
229
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListToolsError']>
230
+ >
214
231
  /* On call tool */
215
- onCallTool?: Array<EventAction>
232
+ onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallTool']>>
216
233
  /* On call tool error */
217
- onCallToolError?: Array<EventAction>
234
+ onCallToolError?: Array<
235
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallToolError']>
236
+ >
218
237
  /* On list prompts */
219
- onListPrompts?: Array<EventAction>
238
+ onListPrompts?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPrompts']>>
220
239
  /* On list prompts error */
221
- onListPromptsError?: Array<EventAction>
240
+ onListPromptsError?: Array<
241
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPromptsError']>
242
+ >
222
243
  /* On get prompt */
223
- onGetPrompt?: Array<EventAction>
244
+ onGetPrompt?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPrompt']>>
224
245
  /* On get prompt error */
225
- onGetPromptError?: Array<EventAction>
246
+ onGetPromptError?: Array<
247
+ EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPromptError']>
248
+ >
226
249
  }
227
250
  outlets?: {
228
251
  /* Connection state */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */
18
19
  export type GeneratorMCPServerActionRefreshResources = Action & {
@@ -193,17 +194,25 @@ Default property:
193
194
  /* Listening of HTTP server */
194
195
  onListening?: Array<EventAction>
195
196
  /* Error of HTTP server */
196
- onError?: Array<EventAction>
197
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onError']>>
197
198
  /* Client error of HTTP server */
198
- onClientError?: Array<EventAction>
199
+ onClientError?: Array<
200
+ EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientError']>
201
+ >
199
202
  /* Client close of HTTP server */
200
- onClientClose?: Array<EventAction>
203
+ onClientClose?: Array<
204
+ EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientClose']>
205
+ >
201
206
  /* On request resource (Request: { name: string, uri: string, params: object }) */
202
- onRequestResource?: Array<EventAction>
207
+ onRequestResource?: Array<
208
+ EventAction<string & keyof TemplateEventPropsMap['McpServer']['onRequestResource']>
209
+ >
203
210
  /* On call tool (Request: { name: string, params: object }) */
204
- onCallTool?: Array<EventAction>
211
+ onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onCallTool']>>
205
212
  /* On get prompt (Request: { name: string, arguments: object }) */
206
- onGetPrompt?: Array<EventAction>
213
+ onGetPrompt?: Array<
214
+ EventAction<string & keyof TemplateEventPropsMap['McpServer']['onGetPrompt']>
215
+ >
207
216
  }
208
217
  outlets?: {
209
218
  /* Whether the HTTP server is listening */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start fetcn Media box file list */
18
19
  export type GeneratorMediaFlowActionFetch = Action & {
@@ -90,13 +91,17 @@ Default property:
90
91
  }
91
92
  events?: {
92
93
  /* Event of media box fetch error */
93
- fetchError?: Array<EventAction>
94
+ fetchError?: Array<EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['fetchError']>>
94
95
  /* Event of subscribe box change connected (If set `Subscribe Box Change`) */
95
96
  subscribeBoxConnect?: Array<EventAction>
96
97
  /* Event of subscribe box change error (If set `Subscribe Box Change`) */
97
- subscribeBoxError?: Array<EventAction>
98
+ subscribeBoxError?: Array<
99
+ EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxError']>
100
+ >
98
101
  /* Event of subscribe box change connection error (If set `Subscribe Box Change`) */
99
- subscribeBoxConnectError?: Array<EventAction>
102
+ subscribeBoxConnectError?: Array<
103
+ EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxConnectError']>
104
+ >
100
105
  /* Event of file sync completed for used `saveToStorage` */
101
106
  saveStorageCompleted?: Array<EventAction>
102
107
  /* Event when file list size exceed of Load size limit */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start MQTT broker server */
18
19
  export type GeneratorMQTTBrokerActionStart = Action & {
@@ -83,15 +84,23 @@ Default property:
83
84
  /* Event of MQTT server is ready */
84
85
  onReady?: Array<EventAction>
85
86
  /* Event of server or connection error */
86
- onError?: Array<EventAction>
87
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onError']>>
87
88
  /* Event of client connected */
88
- onClientConnected?: Array<EventAction>
89
+ onClientConnected?: Array<
90
+ EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientConnected']>
91
+ >
89
92
  /* Event of client disconnected */
90
- onClientDisconnected?: Array<EventAction>
93
+ onClientDisconnected?: Array<
94
+ EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientDisconnected']>
95
+ >
91
96
  /* Event of message received */
92
- onMessageReceived?: Array<EventAction>
97
+ onMessageReceived?: Array<
98
+ EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessageReceived']>
99
+ >
93
100
  /* Event of message published */
94
- onMessagePublished?: Array<EventAction>
101
+ onMessagePublished?: Array<
102
+ EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessagePublished']>
103
+ >
95
104
  }
96
105
  outlets?: {
97
106
  /* Is server started */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Connect to MQTT broker */
18
19
  export type GeneratorMQTTActionConnect = Action & {
@@ -95,9 +96,9 @@ Default property:
95
96
  /* When disconnected from MQTT broker */
96
97
  onDisconnected?: Array<EventAction>
97
98
  /* When error occurred */
98
- onError?: Array<EventAction>
99
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onError']>>
99
100
  /* When received message from MQTT broker within subscribe topic */
100
- onMessage?: Array<EventAction>
101
+ onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onMessage']>>
101
102
  }
102
103
  outlets?: {
103
104
  /* Connected or not */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start inquire */
18
19
  export type GeneratorQuestionActionStart = Action & {
@@ -370,7 +371,7 @@ Default property:
370
371
  /* Event of completed inquire */
371
372
  onCompleted?: Array<EventAction>
372
373
  /* Event of error occured */
373
- onError?: Array<EventAction>
374
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Question']['onError']>>
374
375
  }
375
376
  outlets?: {
376
377
  /* Result data */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start realtime transcription */
18
19
  export type GeneratorRealtimeTranscriptionActionStart = Action & {
@@ -131,19 +132,33 @@ Default property:
131
132
  }
132
133
  events?: {
133
134
  /* Event triggered when transcription starts, processes, or ends */
134
- onTranscribe?: Array<EventAction>
135
+ onTranscribe?: Array<
136
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onTranscribe']>
137
+ >
135
138
  /* Event triggered on VAD (Voice Activity Detection) events */
136
- onVad?: Array<EventAction>
139
+ onVad?: Array<
140
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onVad']>
141
+ >
137
142
  /* Event triggered when error occurs */
138
- onError?: Array<EventAction>
143
+ onError?: Array<
144
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onError']>
145
+ >
139
146
  /* Event triggered when status changes */
140
- onStatusChange?: Array<EventAction>
147
+ onStatusChange?: Array<
148
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatusChange']>
149
+ >
141
150
  /* Event triggered when statistics update */
142
- onStatsUpdate?: Array<EventAction>
151
+ onStatsUpdate?: Array<
152
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatsUpdate']>
153
+ >
143
154
  /* Event triggered when slice transcription is stabilized */
144
- onStabilized?: Array<EventAction>
155
+ onStabilized?: Array<
156
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStabilized']>
157
+ >
145
158
  /* Event triggered when transcription ends */
146
- onEnd?: Array<EventAction>
159
+ onEnd?: Array<
160
+ EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onEnd']>
161
+ >
147
162
  }
148
163
  outlets?: {
149
164
  /* Is realtime transcription currently active */
@@ -24,6 +24,7 @@ import type {
24
24
  Action,
25
25
  EventProperty,
26
26
  } from '../common'
27
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
27
28
 
28
29
  /* Load the model */
29
30
  export type GeneratorRerankerActionLoadModel = Action & {
@@ -117,9 +118,11 @@ Default property:
117
118
  }
118
119
  events?: {
119
120
  /* Event triggered when the reranker context state changes (loading, ready, error, released) */
120
- onContextStateChange?: Array<EventAction>
121
+ onContextStateChange?: Array<
122
+ EventAction<string & keyof TemplateEventPropsMap['Reranker']['onContextStateChange']>
123
+ >
121
124
  /* Event triggered when an error occurs during reranker operations */
122
- onError?: Array<EventAction>
125
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Reranker']['onError']>>
123
126
  }
124
127
  outlets?: {
125
128
  /* Current state of the reranker context (loading, ready, error, released) */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Get available serial devices */
18
19
  export type GeneratorSerialPortActionGeneratorSerialGetDeviceList = Action & {
@@ -100,9 +101,13 @@ Default property:
100
101
  /* Event for detach the device */
101
102
  generatorSerialOnDetach?: Array<EventAction>
102
103
  /* Event on error */
103
- generatorSerialOnError?: Array<EventAction>
104
+ generatorSerialOnError?: Array<
105
+ EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnError']>
106
+ >
104
107
  /* Event for receive data */
105
- generatorSerialOnData?: Array<EventAction>
108
+ generatorSerialOnData?: Array<
109
+ EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnData']>
110
+ >
106
111
  }
107
112
  outlets?: {
108
113
  /* Available serial devices */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start playing sound */
18
19
  export type GeneratorSoundPlayerActionPlay = Action & {
@@ -56,7 +57,9 @@ Default property:
56
57
  /* Sound file loaded successfully */
57
58
  onLoad?: Array<EventAction>
58
59
  /* Sound file load error */
59
- onLoadError?: Array<EventAction>
60
+ onLoadError?: Array<
61
+ EventAction<string & keyof TemplateEventPropsMap['SoundPlayer']['onLoadError']>
62
+ >
60
63
  /* Sound playback complete */
61
64
  onPlay?: Array<EventAction>
62
65
  /* Sound file playback end */
@@ -13,6 +13,7 @@ import type {
13
13
  Action,
14
14
  EventProperty,
15
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
16
17
 
17
18
  /* Start record */
18
19
  export type GeneratorSoundRecorderActionStart = Action & {
@@ -88,9 +89,9 @@ Default property:
88
89
  }
89
90
  events?: {
90
91
  /* Event for chunk data (Base64 encoded PCM) */
91
- chunk?: Array<EventAction>
92
+ chunk?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['chunk']>>
92
93
  /* Event for recorded file */
93
- recorded?: Array<EventAction>
94
+ recorded?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['recorded']>>
94
95
  }
95
96
  outlets?: {
96
97
  /* Is recording */
@@ -19,6 +19,7 @@ import type {
19
19
  Action,
20
20
  EventProperty,
21
21
  } from '../common'
22
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
22
23
 
23
24
  /* Load the model */
24
25
  export type GeneratorSpeechInferenceActionLoadModel = Action & {
@@ -328,11 +329,15 @@ Default property:
328
329
  }
329
330
  events?: {
330
331
  /* Event triggered when context state changes */
331
- onContextStateChange?: Array<EventAction>
332
+ onContextStateChange?: Array<
333
+ EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onContextStateChange']>
334
+ >
332
335
  /* Event triggered when error occurs */
333
- onError?: Array<EventAction>
336
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onError']>>
334
337
  /* Event triggered when got transcribe result */
335
- onTranscribed?: Array<EventAction>
338
+ onTranscribed?: Array<
339
+ EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onTranscribed']>
340
+ >
336
341
  /* Event triggered when transcribe realtime done */
337
342
  onRealtimeStop?: Array<EventAction>
338
343
  }