@fugood/bricks-ctor 2.25.0-beta.7 → 2.25.0-beta.70

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 (135) hide show
  1. package/package.json +4 -24
  2. package/tools/__tests__/legacy-forwarder.test.js +91 -0
  3. package/tools/_forward.ts +26 -0
  4. package/tools/deploy.ts +3 -164
  5. package/tools/mcp-server.ts +3 -27
  6. package/tools/postinstall.ts +3 -234
  7. package/tools/pull.ts +3 -121
  8. package/tools/push-config.ts +4 -0
  9. package/tools/simulator.ts +4 -0
  10. package/compile/action-name-map.ts +0 -1015
  11. package/compile/index.ts +0 -1278
  12. package/compile/util.ts +0 -358
  13. package/index.ts +0 -6
  14. package/skills/bricks-ctor/SKILL.md +0 -32
  15. package/skills/bricks-ctor/rules/animation.md +0 -159
  16. package/skills/bricks-ctor/rules/architecture-patterns.md +0 -69
  17. package/skills/bricks-ctor/rules/automations.md +0 -221
  18. package/skills/bricks-ctor/rules/buttress.md +0 -156
  19. package/skills/bricks-ctor/rules/data-calculation.md +0 -209
  20. package/skills/bricks-ctor/rules/local-sync.md +0 -129
  21. package/skills/bricks-ctor/rules/media-flow.md +0 -158
  22. package/skills/bricks-ctor/rules/remote-data-bank.md +0 -196
  23. package/skills/bricks-ctor/rules/standby-transition.md +0 -124
  24. package/skills/bricks-design/LICENSE.txt +0 -180
  25. package/skills/bricks-design/SKILL.md +0 -66
  26. package/skills/rive-marketplace/SKILL.md +0 -99
  27. package/tools/_git-author.ts +0 -29
  28. package/tools/_shell.ts +0 -173
  29. package/tools/icons/.gitattributes +0 -1
  30. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  31. package/tools/icons/fa6pro-meta.json +0 -1
  32. package/tools/mcp-tools/compile.ts +0 -92
  33. package/tools/mcp-tools/huggingface.ts +0 -762
  34. package/tools/mcp-tools/icons.ts +0 -81
  35. package/tools/mcp-tools/lottie.ts +0 -102
  36. package/tools/mcp-tools/media.ts +0 -110
  37. package/tools/preview-main.mjs +0 -293
  38. package/tools/preview.ts +0 -150
  39. package/types/animation.ts +0 -100
  40. package/types/automation.ts +0 -235
  41. package/types/brick-base.ts +0 -80
  42. package/types/bricks/Camera.ts +0 -246
  43. package/types/bricks/Chart.ts +0 -372
  44. package/types/bricks/GenerativeMedia.ts +0 -290
  45. package/types/bricks/Icon.ts +0 -98
  46. package/types/bricks/Image.ts +0 -126
  47. package/types/bricks/Items.ts +0 -476
  48. package/types/bricks/Lottie.ts +0 -168
  49. package/types/bricks/Maps.ts +0 -262
  50. package/types/bricks/QrCode.ts +0 -117
  51. package/types/bricks/Rect.ts +0 -150
  52. package/types/bricks/RichText.ts +0 -128
  53. package/types/bricks/Rive.ts +0 -220
  54. package/types/bricks/Sketch.ts +0 -254
  55. package/types/bricks/Slideshow.ts +0 -201
  56. package/types/bricks/Svg.ts +0 -99
  57. package/types/bricks/Text.ts +0 -148
  58. package/types/bricks/TextInput.ts +0 -242
  59. package/types/bricks/Video.ts +0 -175
  60. package/types/bricks/VideoStreaming.ts +0 -112
  61. package/types/bricks/WebRtcStream.ts +0 -65
  62. package/types/bricks/WebView.ts +0 -168
  63. package/types/bricks/index.ts +0 -22
  64. package/types/canvas.ts +0 -82
  65. package/types/common.ts +0 -144
  66. package/types/data-calc-command.ts +0 -7005
  67. package/types/data-calc-script.ts +0 -21
  68. package/types/data-calc.ts +0 -11
  69. package/types/data.ts +0 -95
  70. package/types/generators/AlarmClock.ts +0 -110
  71. package/types/generators/Assistant.ts +0 -621
  72. package/types/generators/BleCentral.ts +0 -247
  73. package/types/generators/BlePeripheral.ts +0 -208
  74. package/types/generators/CanvasMap.ts +0 -74
  75. package/types/generators/CastlesPay.ts +0 -87
  76. package/types/generators/DataBank.ts +0 -160
  77. package/types/generators/File.ts +0 -432
  78. package/types/generators/GraphQl.ts +0 -132
  79. package/types/generators/Http.ts +0 -222
  80. package/types/generators/HttpServer.ts +0 -176
  81. package/types/generators/Information.ts +0 -103
  82. package/types/generators/Intent.ts +0 -168
  83. package/types/generators/Iterator.ts +0 -108
  84. package/types/generators/Keyboard.ts +0 -105
  85. package/types/generators/LlmAnthropicCompat.ts +0 -212
  86. package/types/generators/LlmAppleBuiltin.ts +0 -159
  87. package/types/generators/LlmGgml.ts +0 -861
  88. package/types/generators/LlmMediaTekNeuroPilot.ts +0 -235
  89. package/types/generators/LlmMlx.ts +0 -227
  90. package/types/generators/LlmOnnx.ts +0 -213
  91. package/types/generators/LlmOpenAiCompat.ts +0 -312
  92. package/types/generators/LlmQualcommAiEngine.ts +0 -247
  93. package/types/generators/Mcp.ts +0 -637
  94. package/types/generators/McpServer.ts +0 -289
  95. package/types/generators/MediaFlow.ts +0 -170
  96. package/types/generators/MqttBroker.ts +0 -141
  97. package/types/generators/MqttClient.ts +0 -141
  98. package/types/generators/Question.ts +0 -408
  99. package/types/generators/RealtimeTranscription.ts +0 -287
  100. package/types/generators/RerankerGgml.ts +0 -191
  101. package/types/generators/SerialPort.ts +0 -151
  102. package/types/generators/SoundPlayer.ts +0 -94
  103. package/types/generators/SoundRecorder.ts +0 -130
  104. package/types/generators/SpeechToTextGgml.ts +0 -419
  105. package/types/generators/SpeechToTextOnnx.ts +0 -236
  106. package/types/generators/SpeechToTextPlatform.ts +0 -85
  107. package/types/generators/SqLite.ts +0 -159
  108. package/types/generators/Step.ts +0 -107
  109. package/types/generators/SttAppleBuiltin.ts +0 -130
  110. package/types/generators/Tcp.ts +0 -126
  111. package/types/generators/TcpServer.ts +0 -147
  112. package/types/generators/TextToSpeechAppleBuiltin.ts +0 -127
  113. package/types/generators/TextToSpeechGgml.ts +0 -221
  114. package/types/generators/TextToSpeechOnnx.ts +0 -178
  115. package/types/generators/TextToSpeechOpenAiLike.ts +0 -121
  116. package/types/generators/ThermalPrinter.ts +0 -191
  117. package/types/generators/Tick.ts +0 -83
  118. package/types/generators/Udp.ts +0 -120
  119. package/types/generators/VadGgml.ts +0 -250
  120. package/types/generators/VadOnnx.ts +0 -231
  121. package/types/generators/VadTraditional.ts +0 -138
  122. package/types/generators/VectorStore.ts +0 -257
  123. package/types/generators/Watchdog.ts +0 -107
  124. package/types/generators/WebCrawler.ts +0 -103
  125. package/types/generators/WebRtc.ts +0 -181
  126. package/types/generators/WebSocket.ts +0 -148
  127. package/types/generators/index.ts +0 -57
  128. package/types/index.ts +0 -13
  129. package/types/subspace.ts +0 -60
  130. package/types/switch.ts +0 -51
  131. package/types/system.ts +0 -707
  132. package/utils/calc.ts +0 -126
  133. package/utils/data.ts +0 -497
  134. package/utils/event-props.ts +0 -886
  135. package/utils/id.ts +0 -80
@@ -1,160 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Access and subscribe to shared Data properties from the project Data Bank
4
- */
5
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
- import type { Data, DataLink } from '../data'
7
- import type {
8
- Brick,
9
- Generator,
10
- EventAction,
11
- ActionWithDataParams,
12
- ActionWithParams,
13
- Action,
14
- EventProperty,
15
- } from '../common'
16
- import type { TemplateEventPropsMap } from '../../utils/event-props'
17
-
18
- /* Run Data Bank fetch */
19
- export type GeneratorDataBankActionFetch = Action & {
20
- __actionName: 'GENERATOR_DATA_BANK_FETCH'
21
- }
22
-
23
- /* Run Data Bank update */
24
- export type GeneratorDataBankActionUpdateProperty = ActionWithParams & {
25
- __actionName: 'GENERATOR_DATA_BANK_UPDATE_PROPERTY'
26
- params?: Array<
27
- | {
28
- input: 'propertyId'
29
- value?: string | DataLink | EventProperty
30
- mapping?: string
31
- }
32
- | {
33
- input: 'propertyValue'
34
- value?: any | EventProperty
35
- mapping?: string
36
- }
37
- >
38
- }
39
-
40
- /* Run Data Bank remove */
41
- export type GeneratorDataBankActionRemoveProperty = ActionWithParams & {
42
- __actionName: 'GENERATOR_DATA_BANK_REMOVE_PROPERTY'
43
- params?: Array<{
44
- input: 'propertyId'
45
- value?: string | DataLink | EventProperty
46
- mapping?: string
47
- }>
48
- }
49
-
50
- /* Reset cache of Data Bank */
51
- export type GeneratorDataBankActionResetCache = Action & {
52
- __actionName: 'GENERATOR_DATA_BANK_RESET_CACHE'
53
- }
54
-
55
- /* Cancel current running subscription */
56
- export type GeneratorDataBankActionCancelSubscription = Action & {
57
- __actionName: 'GENERATOR_DATA_BANK_CANCEL_SUBSCRIPTION'
58
- }
59
-
60
- interface GeneratorDataBankDef {
61
- /*
62
- Default property:
63
- {
64
- "init": false,
65
- "fetchPolicy": "cache-first",
66
- "subscribeDataChange": false
67
- }
68
- */
69
- property?: {
70
- /* Start generator initialization execution immediately */
71
- init?: boolean | DataLink
72
- /* Data Bank Space ID */
73
- spacename?: string | DataLink
74
- /* Data Bank Space secret key */
75
- spacekey?: string | DataLink
76
- /* Data need to be fetched */
77
- properties?: Array<string | DataLink> | DataLink
78
- /* Determine the cache behavior
79
-
80
- cache-first: Cache first if existing, then fetch from network
81
- network-and-cache: Fetch from network, then save cache
82
- network-only: Fetch from network only */
83
- fetchPolicy?: 'cache-first' | 'network-and-cache' | 'network-only' | DataLink
84
- /* Subscribe Data change */
85
- subscribeDataChange?: boolean | DataLink
86
- }
87
- events?: {
88
- /* Event of Data Bank fetch response */
89
- onFetchResponse?: Array<
90
- EventAction<string & keyof TemplateEventPropsMap['DataBank']['onFetchResponse']>
91
- >
92
- /* Event of Data Bank change from subscription */
93
- onChange?: Array<EventAction>
94
- /* Event of Data Bank fetch error */
95
- onFetchError?: Array<EventAction>
96
- /* Event of error */
97
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['DataBank']['onError']>>
98
- /* Event of subscription on connection */
99
- subscribeDataOnConnect?: Array<EventAction>
100
- /* Server connections error of subscription */
101
- subscribeDataOnConnectError?: Array<
102
- EventAction<string & keyof TemplateEventPropsMap['DataBank']['subscribeDataOnConnectError']>
103
- >
104
- }
105
- outlets?: {
106
- /* Response for Data Bank fetch request, it will save to Data */
107
- response?: () => Data<
108
- Array<{
109
- __typename?: string
110
- id?: string
111
- createAt?: string
112
- updateAt?: string
113
- spaceId?: string
114
- propertyId?: string
115
- definition?: {
116
- type?: string
117
- title?: string
118
- schema?: { [key: string]: any }
119
- [key: string]: any
120
- }
121
- meta?: string
122
- value?: any
123
- lastUpdateHash?: string
124
- lastUpdateNote?: string
125
- lastUpdateKey?: {
126
- name?: string
127
- enable_expired?: boolean
128
- expired_at?: any
129
- jwt?: boolean
130
- [key: string]: any
131
- }
132
- [key: string]: any
133
- }>
134
- >
135
- /* Server response error of Data Bank fetch request, it will save to Data */
136
- error?: () => Data<string>
137
- }
138
- }
139
-
140
- /* Access and subscribe to shared Data properties from the project Data Bank */
141
- export type GeneratorDataBank = Generator &
142
- GeneratorDataBankDef & {
143
- templateKey: 'GENERATOR_DATA_BANK'
144
- switches?: Array<
145
- SwitchDef &
146
- GeneratorDataBankDef & {
147
- conds?: Array<{
148
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
149
- cond:
150
- | SwitchCondInnerStateCurrentCanvas
151
- | SwitchCondData
152
- | {
153
- __typename: 'SwitchCondInnerStateOutlet'
154
- outlet: 'response' | 'error'
155
- value: any
156
- }
157
- }>
158
- }
159
- >
160
- }
@@ -1,432 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * File system operations: read, write, copy, delete, and list files
4
- */
5
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
- import type { Data, DataLink } from '../data'
7
- import type {
8
- Brick,
9
- Generator,
10
- EventAction,
11
- ActionWithDataParams,
12
- ActionWithParams,
13
- Action,
14
- EventProperty,
15
- } from '../common'
16
- import type { TemplateEventPropsMap } from '../../utils/event-props'
17
-
18
- /* Read stats */
19
- export type GeneratorFileActionReadStats = Action & {
20
- __actionName: 'GENERATOR_FILE_READ_STATS'
21
- }
22
-
23
- /* Read (Currently only support text file) */
24
- export type GeneratorFileActionReadContent = ActionWithParams & {
25
- __actionName: 'GENERATOR_FILE_READ_CONTENT'
26
- params?: Array<{
27
- input: 'encoding'
28
- value?: 'utf8' | 'base64' | DataLink | EventProperty
29
- mapping?: string
30
- }>
31
- }
32
-
33
- /* Delete */
34
- export type GeneratorFileActionDelete = Action & {
35
- __actionName: 'GENERATOR_FILE_DELETE'
36
- }
37
-
38
- /* Append (Currently only support text file) */
39
- export type GeneratorFileActionAppendContent = ActionWithParams & {
40
- __actionName: 'GENERATOR_FILE_APPEND_CONTENT'
41
- params?: Array<
42
- | {
43
- input: 'content'
44
- value?: string | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- | {
48
- input: 'encoding'
49
- value?: 'utf8' | 'base64' | DataLink | EventProperty
50
- mapping?: string
51
- }
52
- | {
53
- input: 'contentList'
54
- value?: Array<any> | DataLink | EventProperty
55
- mapping?: string
56
- }
57
- >
58
- }
59
-
60
- /* Write (Currently only support text file) */
61
- export type GeneratorFileActionWriteContent = ActionWithParams & {
62
- __actionName: 'GENERATOR_FILE_WRITE_CONTENT'
63
- params?: Array<
64
- | {
65
- input: 'content'
66
- value?: string | DataLink | EventProperty
67
- mapping?: string
68
- }
69
- | {
70
- input: 'encoding'
71
- value?: 'utf8' | 'base64' | DataLink | EventProperty
72
- mapping?: string
73
- }
74
- | {
75
- input: 'position'
76
- value?: number | DataLink | EventProperty
77
- mapping?: string
78
- }
79
- | {
80
- input: 'contentList'
81
- value?: Array<any> | DataLink | EventProperty
82
- mapping?: string
83
- }
84
- >
85
- }
86
-
87
- /* Start upload (All or By ID or By Index) */
88
- export type GeneratorFileActionStartUpload = ActionWithParams & {
89
- __actionName: 'GENERATOR_FILE_START_UPLOAD'
90
- params?: Array<
91
- | {
92
- input: 'withAll'
93
- value?: boolean | DataLink | EventProperty
94
- mapping?: string
95
- }
96
- | {
97
- input: 'withId'
98
- value?: string | DataLink | EventProperty
99
- mapping?: string
100
- }
101
- | {
102
- input: 'withIndex'
103
- value?: number | DataLink | EventProperty
104
- mapping?: string
105
- }
106
- >
107
- }
108
-
109
- /* Stop upload (All or By ID or By Index) */
110
- export type GeneratorFileActionStopUpload = ActionWithParams & {
111
- __actionName: 'GENERATOR_FILE_STOP_UPLOAD'
112
- params?: Array<
113
- | {
114
- input: 'withAll'
115
- value?: boolean | DataLink | EventProperty
116
- mapping?: string
117
- }
118
- | {
119
- input: 'withId'
120
- value?: string | DataLink | EventProperty
121
- mapping?: string
122
- }
123
- | {
124
- input: 'withIndex'
125
- value?: number | DataLink | EventProperty
126
- mapping?: string
127
- }
128
- >
129
- }
130
-
131
- /* Start download (All or By ID or By Index) */
132
- export type GeneratorFileActionStartDownload = ActionWithParams & {
133
- __actionName: 'GENERATOR_FILE_START_DOWNLOAD'
134
- params?: Array<
135
- | {
136
- input: 'withAll'
137
- value?: boolean | DataLink | EventProperty
138
- mapping?: string
139
- }
140
- | {
141
- input: 'withId'
142
- value?: string | DataLink | EventProperty
143
- mapping?: string
144
- }
145
- | {
146
- input: 'withIndex'
147
- value?: number | DataLink | EventProperty
148
- mapping?: string
149
- }
150
- >
151
- }
152
-
153
- /* Stop download (All or By ID or By Index) */
154
- export type GeneratorFileActionStopDownload = ActionWithParams & {
155
- __actionName: 'GENERATOR_FILE_STOP_DOWNLOAD'
156
- params?: Array<
157
- | {
158
- input: 'withAll'
159
- value?: boolean | DataLink | EventProperty
160
- mapping?: string
161
- }
162
- | {
163
- input: 'withId'
164
- value?: string | DataLink | EventProperty
165
- mapping?: string
166
- }
167
- | {
168
- input: 'withIndex'
169
- value?: number | DataLink | EventProperty
170
- mapping?: string
171
- }
172
- >
173
- }
174
-
175
- /* Clear download */
176
- export type GeneratorFileActionClearDownload = Action & {
177
- __actionName: 'GENERATOR_FILE_CLEAR_DOWNLOAD'
178
- }
179
-
180
- interface GeneratorFileDef {
181
- /*
182
- Default property:
183
- {
184
- "type": "single",
185
- "targetDirectory": "none",
186
- "hashType": "sha256",
187
- "header": {},
188
- "fields": {},
189
- "list": [],
190
- "downloadAllowLoadSizeLimitExceed": false,
191
- "downloadRetryCount": 3,
192
- "downloadMode": "sequence",
193
- "downloadProgressFrequency": 1000,
194
- "uploadRetryCount": 3,
195
- "uploadMode": "sequence",
196
- "uploadProgressFrequency": 1000
197
- }
198
- */
199
- property?: {
200
- /* Type (Single or Multiple) */
201
- type?: 'single' | 'multiple' | DataLink
202
- /* Target directory (Default: document directory in app) */
203
- targetDirectory?: 'none' | 'custom' | 'document' | 'cache' | 'tmp' | DataLink
204
- /* Target directory (Default: document directory in app) */
205
- customTargetDirectory?: string | DataLink
206
- /* File path (If type is single) */
207
- path?: string | DataLink
208
- /* File encoding (If type is single) */
209
- encoding?: 'utf8' | 'base64' | DataLink
210
- /* URL (If type is single) */
211
- url?: string | DataLink
212
- /* Hash value */
213
- hash?: string | DataLink
214
- /* Hash type */
215
- hashType?: 'md5' | 'sha256' | 'sha1' | DataLink
216
- /* Request method */
217
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink
218
- /* Header */
219
- header?: {} | DataLink
220
- /* Fields */
221
- fields?: {} | DataLink
222
- /* File list (If type is multiple) */
223
- list?:
224
- | Array<
225
- | DataLink
226
- | {
227
- id?: string | DataLink
228
- path?: string | DataLink
229
- encoding?: 'utf8' | 'base64' | DataLink
230
- url?: string | DataLink
231
- hash?: string | DataLink
232
- hashType?: 'sha256' | 'sha1' | 'md5' | DataLink
233
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink
234
- header?: {} | DataLink
235
- fields?: {} | DataLink
236
- }
237
- >
238
- | DataLink
239
- /* Enable download (URL is required) */
240
- downloadEnabled?: boolean | DataLink
241
- /* Download load size limit */
242
- downloadLoadSizeLimit?: number | DataLink
243
- /* Download allow load size limit exceed */
244
- downloadAllowLoadSizeLimitExceed?: boolean | DataLink
245
- /* Download retry count */
246
- downloadRetryCount?: number | DataLink
247
- /* Download mode (if type is multiple) */
248
- downloadMode?: 'concurrent' | 'sequence' | DataLink
249
- /* Limit of download concurrent mode */
250
- downloadConcurrentLimit?: number | DataLink
251
- /* Download progress frequency */
252
- downloadProgressFrequency?: number | DataLink
253
- /* Enable upload (Path & URL is required) */
254
- uploadEnabled?: boolean | DataLink
255
- /* Upload retry count */
256
- uploadRetryCount?: number | DataLink
257
- /* Upload mode (if type is multiple) */
258
- uploadMode?: 'concurrent' | 'sequence' | DataLink
259
- /* Limit of upload concurrent mode */
260
- uploadConcurrentLimit?: number | DataLink
261
- /* Upload progress frequency */
262
- uploadProgressFrequency?: number | DataLink
263
- }
264
- events?: {
265
- /* On file handler init error */
266
- initError?: Array<EventAction<string & keyof TemplateEventPropsMap['File']['initError']>>
267
- /* On file status change */
268
- onFileStatusChange?: Array<
269
- EventAction<string & keyof TemplateEventPropsMap['File']['onFileStatusChange']>
270
- >
271
- /* On read stats error */
272
- onReadStatsError?: Array<
273
- EventAction<string & keyof TemplateEventPropsMap['File']['onReadStatsError']>
274
- >
275
- /* On read content error */
276
- onReadContentError?: Array<
277
- EventAction<string & keyof TemplateEventPropsMap['File']['onReadContentError']>
278
- >
279
- /* On read content error */
280
- onAppendContentError?: Array<
281
- EventAction<string & keyof TemplateEventPropsMap['File']['onAppendContentError']>
282
- >
283
- /* On write content error */
284
- onWriteContentError?: Array<
285
- EventAction<string & keyof TemplateEventPropsMap['File']['onWriteContentError']>
286
- >
287
- /* On upload progress */
288
- onUploadProgress?: Array<
289
- EventAction<string & keyof TemplateEventPropsMap['File']['onUploadProgress']>
290
- >
291
- /* On upload error */
292
- onUploadError?: Array<
293
- EventAction<string & keyof TemplateEventPropsMap['File']['onUploadError']>
294
- >
295
- /* On upload complete */
296
- onUploadComplete?: Array<
297
- EventAction<string & keyof TemplateEventPropsMap['File']['onUploadComplete']>
298
- >
299
- /* On upload all done */
300
- onUploadAllComplete?: Array<
301
- EventAction<string & keyof TemplateEventPropsMap['File']['onUploadAllComplete']>
302
- >
303
- /* On download progress */
304
- onDownloadProgress?: Array<
305
- EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadProgress']>
306
- >
307
- /* On download error */
308
- onDownloadError?: Array<
309
- EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadError']>
310
- >
311
- /* On download complete */
312
- onDownloadComplete?: Array<
313
- EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadComplete']>
314
- >
315
- /* On download all done */
316
- onDownloadAllComplete?: Array<
317
- EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadAllComplete']>
318
- >
319
- }
320
- outlets?: {
321
- /* File init error result will be stored in Data */
322
- initError?: () => Data<string>
323
- /* File read stats result will be stored in Data */
324
- readStats?: () => Data<{
325
- path?: string
326
- size?: number
327
- isDirectory?: boolean
328
- mtime?: string
329
- ctime?: string
330
- mode?: number
331
- originalFilepath?: string
332
- [key: string]: any
333
- }>
334
- /* File read content result will be stored in Data */
335
- readContent?: () => Data<any>
336
- /* File read details result will be stored in Data */
337
- readDetails?: () => Data<{
338
- path?: string
339
- content?: any
340
- size?: number
341
- exists?: boolean
342
- [key: string]: any
343
- }>
344
- /* File read error result will be stored in Data */
345
- readError?: () => Data<string>
346
- /* File append content result will be stored in Data */
347
- appendDetails?: () => Data<{
348
- path?: string
349
- appended?: boolean
350
- contentLength?: number
351
- [key: string]: any
352
- }>
353
- /* File append error result will be stored in Data */
354
- appendError?: () => Data<string>
355
- /* File write details result will be stored in Data */
356
- writeDetails?: () => Data<{
357
- path?: string
358
- written?: boolean
359
- contentLength?: number
360
- [key: string]: any
361
- }>
362
- /* File write error result will be stored in Data */
363
- writeError?: () => Data<string>
364
- /* File upload progress result will be stored in Data */
365
- uploadProgress?: () => Data<{
366
- id?: string
367
- path?: string
368
- uri?: string
369
- hash?: string
370
- hashType?: string
371
- headers?: { [key: string]: any }
372
- fields?: { [key: string]: any }
373
- method?: string
374
- progress?: number
375
- isLastUpdated?: boolean
376
- [key: string]: any
377
- }>
378
- /* File upload complete result will be stored in Data */
379
- uploadResult?: () => Data<any>
380
- /* File download progress result will be stored in Data */
381
- downloadProgress?: () => Data<{
382
- id?: string
383
- path?: string
384
- uri?: string
385
- hash?: string
386
- hashType?: string
387
- headers?: { [key: string]: any }
388
- fields?: { [key: string]: any }
389
- method?: string
390
- progress?: number
391
- isLastUpdated?: boolean
392
- [key: string]: any
393
- }>
394
- /* File download complete result will be stored in Data */
395
- downloadResult?: () => Data<any>
396
- }
397
- }
398
-
399
- /* File system operations: read, write, copy, delete, and list files */
400
- export type GeneratorFile = Generator &
401
- GeneratorFileDef & {
402
- templateKey: 'GENERATOR_FILE'
403
- switches?: Array<
404
- SwitchDef &
405
- GeneratorFileDef & {
406
- conds?: Array<{
407
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
408
- cond:
409
- | SwitchCondInnerStateCurrentCanvas
410
- | SwitchCondData
411
- | {
412
- __typename: 'SwitchCondInnerStateOutlet'
413
- outlet:
414
- | 'initError'
415
- | 'readStats'
416
- | 'readContent'
417
- | 'readDetails'
418
- | 'readError'
419
- | 'appendDetails'
420
- | 'appendError'
421
- | 'writeDetails'
422
- | 'writeError'
423
- | 'uploadProgress'
424
- | 'uploadResult'
425
- | 'downloadProgress'
426
- | 'downloadResult'
427
- value: any
428
- }
429
- }>
430
- }
431
- >
432
- }