@fugood/bricks-project 2.22.0-beta.9 → 2.22.0

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 (86) hide show
  1. package/compile/action-name-map.ts +108 -1
  2. package/compile/index.ts +10 -1
  3. package/package.json +3 -3
  4. package/tools/postinstall.ts +16 -9
  5. package/types/animation.ts +2 -1
  6. package/types/brick-base.ts +79 -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 +240 -0
  11. package/types/bricks/Icon.ts +93 -0
  12. package/types/bricks/Image.ts +104 -0
  13. package/types/bricks/Items.ts +461 -0
  14. package/types/bricks/Lottie.ts +159 -0
  15. package/types/bricks/QrCode.ts +112 -0
  16. package/types/bricks/Rect.ts +110 -0
  17. package/types/bricks/RichText.ts +123 -0
  18. package/types/bricks/Rive.ts +209 -0
  19. package/types/bricks/Slideshow.ts +155 -0
  20. package/types/bricks/Svg.ts +94 -0
  21. package/types/bricks/Text.ts +143 -0
  22. package/types/bricks/TextInput.ts +231 -0
  23. package/types/bricks/Video.ts +170 -0
  24. package/types/bricks/VideoStreaming.ts +107 -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/common.ts +8 -3
  29. package/types/data.ts +6 -0
  30. package/types/generators/AlarmClock.ts +102 -0
  31. package/types/generators/Assistant.ts +546 -0
  32. package/types/generators/BleCentral.ts +225 -0
  33. package/types/generators/BlePeripheral.ts +202 -0
  34. package/types/generators/CanvasMap.ts +57 -0
  35. package/types/generators/CastlesPay.ts +77 -0
  36. package/types/generators/DataBank.ts +123 -0
  37. package/types/generators/File.ts +351 -0
  38. package/types/generators/GraphQl.ts +124 -0
  39. package/types/generators/Http.ts +117 -0
  40. package/types/generators/HttpServer.ts +164 -0
  41. package/types/generators/Information.ts +97 -0
  42. package/types/generators/Intent.ts +107 -0
  43. package/types/generators/Iterator.ts +95 -0
  44. package/types/generators/Keyboard.ts +85 -0
  45. package/types/generators/LlmAnthropicCompat.ts +188 -0
  46. package/types/generators/LlmGgml.ts +719 -0
  47. package/types/generators/LlmOnnx.ts +184 -0
  48. package/types/generators/LlmOpenAiCompat.ts +206 -0
  49. package/types/generators/LlmQualcommAiEngine.ts +213 -0
  50. package/types/generators/Mcp.ts +294 -0
  51. package/types/generators/McpServer.ts +248 -0
  52. package/types/generators/MediaFlow.ts +142 -0
  53. package/types/generators/MqttBroker.ts +121 -0
  54. package/types/generators/MqttClient.ts +129 -0
  55. package/types/generators/Question.ts +395 -0
  56. package/types/generators/RealtimeTranscription.ts +180 -0
  57. package/types/generators/RerankerGgml.ts +153 -0
  58. package/types/generators/SerialPort.ts +141 -0
  59. package/types/generators/SoundPlayer.ts +86 -0
  60. package/types/generators/SoundRecorder.ts +113 -0
  61. package/types/generators/SpeechToTextGgml.ts +462 -0
  62. package/types/generators/SpeechToTextOnnx.ts +227 -0
  63. package/types/generators/SpeechToTextPlatform.ts +75 -0
  64. package/types/generators/SqLite.ts +118 -0
  65. package/types/generators/Step.ts +101 -0
  66. package/types/generators/TapToPayOnIPhone.ts +175 -0
  67. package/types/generators/Tcp.ts +120 -0
  68. package/types/generators/TcpServer.ts +137 -0
  69. package/types/generators/TextToSpeechGgml.ts +182 -0
  70. package/types/generators/TextToSpeechOnnx.ts +169 -0
  71. package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
  72. package/types/generators/ThermalPrinter.ts +185 -0
  73. package/types/generators/Tick.ts +75 -0
  74. package/types/generators/Udp.ts +109 -0
  75. package/types/generators/VadGgml.ts +211 -0
  76. package/types/generators/VectorStore.ts +223 -0
  77. package/types/generators/Watchdog.ts +96 -0
  78. package/types/generators/WebCrawler.ts +97 -0
  79. package/types/generators/WebRtc.ts +165 -0
  80. package/types/generators/WebSocket.ts +142 -0
  81. package/types/generators/index.ts +51 -0
  82. package/types/system.ts +64 -0
  83. package/utils/data.ts +45 -0
  84. package/utils/event-props.ts +89 -0
  85. package/types/bricks.ts +0 -3168
  86. package/types/generators.ts +0 -7633
@@ -0,0 +1,75 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Start speech recognition */
13
+ export type GeneratorPlatformSTTActionStart = Action & {
14
+ __actionName: 'GENERATOR_PLATFORM_STT_START'
15
+ }
16
+
17
+ /* Stop speech recognition */
18
+ export type GeneratorPlatformSTTActionStop = Action & {
19
+ __actionName: 'GENERATOR_PLATFORM_STT_STOP'
20
+ }
21
+
22
+ interface GeneratorPlatformSTTDef {
23
+ /*
24
+ Default property:
25
+ {
26
+ "locale": "en_US"
27
+ }
28
+ */
29
+ property?: {
30
+ /* Locale for speech recognition */
31
+ locale?: string | DataLink
32
+ /* [iOS] An array of phrases that should be recognized, even if they are not in the system vocabulary. */
33
+ iosContextualStrings?: Array<string | DataLink> | DataLink
34
+ }
35
+ events?: {
36
+ /* Event for speech recognition start */
37
+ onSpeechStart?: Array<EventAction>
38
+ /* Event for speech recognition end */
39
+ onSpeechEnd?: Array<EventAction>
40
+ /* Event for speech recognition results */
41
+ onSpeechResults?: Array<EventAction>
42
+ /* Event for speech recognition error */
43
+ onSpeechError?: Array<EventAction>
44
+ }
45
+ outlets?: {
46
+ /* Recognized speech text */
47
+ recognizedText?: () => Data
48
+ /* Error message */
49
+ errorMessage?: () => Data
50
+ /* Listening status */
51
+ listening?: () => Data
52
+ }
53
+ }
54
+
55
+ /* Speech-to-Text using platform's native capabilities */
56
+ export type GeneratorPlatformSTT = Generator &
57
+ GeneratorPlatformSTTDef & {
58
+ templateKey: 'GENERATOR_PLATFORM_STT'
59
+ switches: Array<
60
+ SwitchDef &
61
+ GeneratorPlatformSTTDef & {
62
+ conds?: Array<{
63
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
64
+ cond:
65
+ | SwitchCondInnerStateCurrentCanvas
66
+ | SwitchCondData
67
+ | {
68
+ __typename: 'SwitchCondInnerStateOutlet'
69
+ outlet: 'recognizedText' | 'errorMessage' | 'listening'
70
+ value: any
71
+ }
72
+ }>
73
+ }
74
+ >
75
+ }
@@ -0,0 +1,118 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Execute SQL statement */
13
+ export type GeneratorSqliteActionExecute = ActionWithParams & {
14
+ __actionName: 'GENERATOR_SQLITE_EXECUTE'
15
+ params?: Array<
16
+ | {
17
+ input: 'sql'
18
+ value?: string | DataLink | EventProperty
19
+ mapping?: string
20
+ }
21
+ | {
22
+ input: 'params'
23
+ value?: Array<any> | DataLink | EventProperty
24
+ mapping?: string
25
+ }
26
+ | {
27
+ input: 'paramsString'
28
+ value?: string | DataLink | EventProperty
29
+ mapping?: string
30
+ }
31
+ >
32
+ }
33
+
34
+ /* Query data from database */
35
+ export type GeneratorSqliteActionQuery = ActionWithParams & {
36
+ __actionName: 'GENERATOR_SQLITE_QUERY'
37
+ params?: Array<
38
+ | {
39
+ input: 'sql'
40
+ value?: string | DataLink | EventProperty
41
+ mapping?: string
42
+ }
43
+ | {
44
+ input: 'params'
45
+ value?: Array<any> | DataLink | EventProperty
46
+ mapping?: string
47
+ }
48
+ | {
49
+ input: 'paramsString'
50
+ value?: string | DataLink | EventProperty
51
+ mapping?: string
52
+ }
53
+ >
54
+ }
55
+
56
+ interface GeneratorSqliteDef {
57
+ /*
58
+ Default property:
59
+ {
60
+ "init": false,
61
+ "dbName": "default",
62
+ "storageType": "file",
63
+ "useFile": false
64
+ }
65
+ */
66
+ property?: {
67
+ /* Initialize database on subspace mounted */
68
+ init?: boolean | DataLink
69
+ /* Database name */
70
+ dbName?: string | DataLink
71
+ /* Storage type */
72
+ storageType?: 'file' | 'memory' | DataLink
73
+ /* Use specific file (memory type will be ignored) */
74
+ useFile?: boolean | DataLink
75
+ /* File URI for SQLite database */
76
+ fileUri?: string | DataLink
77
+ /* MD5 hash of file URI */
78
+ fileUriMd5?: string | DataLink
79
+ }
80
+ events?: {
81
+ /* Event triggered when error occurs */
82
+ onError?: Array<EventAction>
83
+ /* Event triggered when query result is ready */
84
+ onQueryResult?: Array<EventAction>
85
+ }
86
+ outlets?: {
87
+ /* Whether the database is ready */
88
+ isReady?: () => Data
89
+ /* Database path */
90
+ dbPath?: () => Data
91
+ /* Error message */
92
+ error?: () => Data
93
+ /* Last query result */
94
+ lastResult?: () => Data
95
+ }
96
+ }
97
+
98
+ /* SQLite - General database operations */
99
+ export type GeneratorSqlite = Generator &
100
+ GeneratorSqliteDef & {
101
+ templateKey: 'GENERATOR_SQLITE'
102
+ switches: Array<
103
+ SwitchDef &
104
+ GeneratorSqliteDef & {
105
+ conds?: Array<{
106
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
107
+ cond:
108
+ | SwitchCondInnerStateCurrentCanvas
109
+ | SwitchCondData
110
+ | {
111
+ __typename: 'SwitchCondInnerStateOutlet'
112
+ outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult'
113
+ value: any
114
+ }
115
+ }>
116
+ }
117
+ >
118
+ }
@@ -0,0 +1,101 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Start execute the step */
13
+ export type GeneratorStepActionStart = Action & {
14
+ __actionName: 'GENERATOR_STEP_START'
15
+ }
16
+
17
+ /* Pause steps */
18
+ export type GeneratorStepActionPause = Action & {
19
+ __actionName: 'GENERATOR_STEP_PAUSE'
20
+ }
21
+
22
+ /* Resume from pause step */
23
+ export type GeneratorStepActionResume = Action & {
24
+ __actionName: 'GENERATOR_STEP_RESUME'
25
+ }
26
+
27
+ /* Skip to the previous step and execute directly */
28
+ export type GeneratorStepActionPerviousStep = Action & {
29
+ __actionName: 'GENERATOR_STEP_PERVIOUS_STEP'
30
+ }
31
+
32
+ /* Skip to the next step and execute directly */
33
+ export type GeneratorStepActionNextStep = Action & {
34
+ __actionName: 'GENERATOR_STEP_NEXT_STEP'
35
+ }
36
+
37
+ /* Skip to the first step and execute directly */
38
+ export type GeneratorStepActionFirstStep = Action & {
39
+ __actionName: 'GENERATOR_STEP_FIRST_STEP'
40
+ }
41
+
42
+ /* Skip to the last step and execute directly */
43
+ export type GeneratorStepActionLastStep = Action & {
44
+ __actionName: 'GENERATOR_STEP_LAST_STEP'
45
+ }
46
+
47
+ interface GeneratorStepDef {
48
+ /*
49
+ Default property:
50
+ {
51
+ "init": false,
52
+ "steps": []
53
+ }
54
+ */
55
+ property?: {
56
+ init?: boolean | DataLink
57
+ /* Step definition list */
58
+ steps?:
59
+ | Array<
60
+ | DataLink
61
+ | {
62
+ duration?: number | DataLink
63
+ action?: 'change-canvas' | 'outlet' | 'event' | DataLink
64
+ payload?: string | DataLink
65
+ }
66
+ >
67
+ | DataLink
68
+ }
69
+ events?: {
70
+ /* Event on step (If action is `event`) */
71
+ onStep?: Array<EventAction>
72
+ }
73
+ outlets?: {
74
+ /* Result of step payload (If action is `outlet`) */
75
+ payload?: () => Data
76
+ /* Result of step index (If action is `outlet`) */
77
+ index?: () => Data
78
+ }
79
+ }
80
+
81
+ /* Trigger change canvas / outlet / event by setup rules */
82
+ export type GeneratorStep = Generator &
83
+ GeneratorStepDef & {
84
+ templateKey: 'GENERATOR_STEP'
85
+ switches: Array<
86
+ SwitchDef &
87
+ GeneratorStepDef & {
88
+ conds?: Array<{
89
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
90
+ cond:
91
+ | SwitchCondInnerStateCurrentCanvas
92
+ | SwitchCondData
93
+ | {
94
+ __typename: 'SwitchCondInnerStateOutlet'
95
+ outlet: 'payload' | 'index'
96
+ value: any
97
+ }
98
+ }>
99
+ }
100
+ >
101
+ }
@@ -0,0 +1,175 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Init */
13
+ export type GeneratorTapPayT2PActionSetup = Action & {
14
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_SETUP'
15
+ }
16
+
17
+ /* <No doc yet> */
18
+ export type GeneratorTapPayT2PActionFetchBindingList = Action & {
19
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_FETCH_BINDING_LIST'
20
+ }
21
+
22
+ /* <No doc yet> */
23
+ export type GeneratorTapPayT2PActionBind = ActionWithParams & {
24
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_BIND'
25
+ params?: Array<
26
+ | {
27
+ input: 'bindId'
28
+ value?: number | DataLink | EventProperty
29
+ mapping?: string
30
+ }
31
+ | {
32
+ input: 'bindDescription'
33
+ value?: string | DataLink | EventProperty
34
+ mapping?: string
35
+ }
36
+ >
37
+ }
38
+
39
+ /* <No doc yet> */
40
+ export type GeneratorTapPayT2PActionBindDelete = Action & {
41
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_BIND_DELETE'
42
+ }
43
+
44
+ /* <No doc yet> */
45
+ export type GeneratorTapPayT2PActionConfigureReader = Action & {
46
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_CONFIGURE_READER'
47
+ }
48
+
49
+ /* <No doc yet> */
50
+ export type GeneratorTapPayT2PActionReadCardAndAuthorization = ActionWithParams & {
51
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_READ_CARD_AND_AUTHORIZATION'
52
+ params?: Array<
53
+ | {
54
+ input: 'amount'
55
+ value?: number | DataLink | EventProperty
56
+ mapping?: string
57
+ }
58
+ | {
59
+ input: 'orderNumber'
60
+ value?: string | DataLink | EventProperty
61
+ mapping?: string
62
+ }
63
+ | {
64
+ input: 'bankTransactionId'
65
+ value?: string | DataLink | EventProperty
66
+ mapping?: string
67
+ }
68
+ >
69
+ }
70
+
71
+ /* <No doc yet> */
72
+ export type GeneratorTapPayT2PActionGetReceipt = ActionWithParams & {
73
+ __actionName: 'GENERATOR_TAPPAY_T2P_IOS_GET_RECEIPT'
74
+ params?: Array<
75
+ | {
76
+ input: 'receiptIdentifier'
77
+ value?: string | DataLink | EventProperty
78
+ mapping?: string
79
+ }
80
+ | {
81
+ input: 'type'
82
+ value?: 'html' | 'pkpass' | DataLink | EventProperty
83
+ mapping?: string
84
+ }
85
+ | {
86
+ input: 'email'
87
+ value?: string | DataLink | EventProperty
88
+ mapping?: string
89
+ }
90
+ >
91
+ }
92
+
93
+ interface GeneratorTapPayT2PDef {
94
+ /*
95
+ Default property:
96
+ {
97
+ "page": 0,
98
+ "countPerPage": 10
99
+ }
100
+ */
101
+ property?: {
102
+ /* Initializtion */
103
+ init?: boolean | DataLink
104
+ /* App Key */
105
+ appKey?: string | DataLink
106
+ /* Enviroment */
107
+ enviroment?: 'sandbox' | 'production' | DataLink
108
+ /* Partner Account */
109
+ partnerAccount?: string | DataLink
110
+ /* Page */
111
+ page?: number | DataLink
112
+ /* Count per page */
113
+ countPerPage?: number | DataLink
114
+ /* Acquirer Merchant ID */
115
+ acquirerMerchantId?: string | DataLink
116
+ /* Acquirer Terminal ID */
117
+ acquirerTerminalId?: string | DataLink
118
+ /* Bind ID */
119
+ bindId?: number | DataLink
120
+ /* Bind Description */
121
+ bindDescription?: string | DataLink
122
+ }
123
+ events?: {
124
+ /* <No doc yet> */
125
+ readerStartConfiguring?: Array<EventAction>
126
+ /* <No doc yet> */
127
+ readerEndConfiguring?: Array<EventAction>
128
+ /* <No doc yet> */
129
+ readerEventDidUpdated?: Array<EventAction>
130
+ /* <No doc yet> */
131
+ onError?: Array<EventAction>
132
+ }
133
+ outlets?: {
134
+ /* undefined */
135
+ error?: () => Data
136
+ /* undefined */
137
+ isReaderBinded?: () => Data
138
+ /* undefined */
139
+ isReaderReady?: () => Data
140
+ /* undefined */
141
+ bindingList?: () => Data
142
+ /* undefined */
143
+ lastTransactionResult?: () => Data
144
+ /* undefined */
145
+ getReceiptResult?: () => Data
146
+ }
147
+ }
148
+
149
+ /* [UNSTABLE] Tap to Pay on iPhone (iOS only) */
150
+ export type GeneratorTapPayT2P = Generator &
151
+ GeneratorTapPayT2PDef & {
152
+ templateKey: 'GENERATOR_TAPPAY_T2P_IOS'
153
+ switches: Array<
154
+ SwitchDef &
155
+ GeneratorTapPayT2PDef & {
156
+ conds?: Array<{
157
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
158
+ cond:
159
+ | SwitchCondInnerStateCurrentCanvas
160
+ | SwitchCondData
161
+ | {
162
+ __typename: 'SwitchCondInnerStateOutlet'
163
+ outlet:
164
+ | 'error'
165
+ | 'isReaderBinded'
166
+ | 'isReaderReady'
167
+ | 'bindingList'
168
+ | 'lastTransactionResult'
169
+ | 'getReceiptResult'
170
+ value: any
171
+ }
172
+ }>
173
+ }
174
+ >
175
+ }
@@ -0,0 +1,120 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type {
4
+ Generator,
5
+ EventAction,
6
+ ActionWithDataParams,
7
+ ActionWithParams,
8
+ Action,
9
+ EventProperty,
10
+ } from '../common'
11
+
12
+ /* Start connect */
13
+ export type GeneratorTCPActionConnect = Action & {
14
+ __actionName: 'GENERATOR_TCP_CONNECT'
15
+ }
16
+
17
+ /* Send data */
18
+ export type GeneratorTCPActionSend = ActionWithParams & {
19
+ __actionName: 'GENERATOR_TCP_SEND'
20
+ params?: Array<{
21
+ input: 'sendData'
22
+ value?: string | DataLink | EventProperty
23
+ mapping?: string
24
+ }>
25
+ }
26
+
27
+ /* End connection */
28
+ export type GeneratorTCPActionEnd = ActionWithParams & {
29
+ __actionName: 'GENERATOR_TCP_END'
30
+ params?: Array<{
31
+ input: 'endWithData'
32
+ value?: string | DataLink | EventProperty
33
+ mapping?: string
34
+ }>
35
+ }
36
+
37
+ interface GeneratorTCPDef {
38
+ /*
39
+ Default property:
40
+ {
41
+ "init": false,
42
+ "dataMode": "raw",
43
+ "encoding": "utf8",
44
+ "idleTimeout": 0,
45
+ "bufferSize": 1024,
46
+ "tls": false,
47
+ "tlsCheckValidity": false,
48
+ "tlsCert": ""
49
+ }
50
+ */
51
+ property?: {
52
+ /* Start connect on generator initialized */
53
+ init?: boolean | DataLink
54
+ /* Connection target host or IP assress */
55
+ host?: string | DataLink
56
+ /* Connection target port */
57
+ port?: number | DataLink
58
+ /* Data mode
59
+ CRLF: Receive until CRLF
60
+ LF: Receive until LF
61
+ raw: Raw packet */
62
+ dataMode?: 'CRLF' | 'LF' | 'raw' | DataLink
63
+ /* Encoding of data */
64
+ encoding?: 'base64' | 'utf8' | 'ascii' | DataLink
65
+ /* Max connection idle time, 0 is disable */
66
+ idleTimeout?: number | DataLink
67
+ /* Enable keepalive */
68
+ keepAlive?: boolean | DataLink
69
+ /* Buffer size limit of receive plaintext line */
70
+ bufferSize?: number | DataLink
71
+ /* Enable TLS */
72
+ tls?: boolean | DataLink
73
+ /* Enable TLS certificate verify */
74
+ tlsCheckValidity?: boolean | DataLink
75
+ /* Trust certificate list (PEM format) */
76
+ tlsCert?: string | DataLink
77
+ }
78
+ events?: {
79
+ /* Event of connect successful */
80
+ onConnected?: Array<EventAction>
81
+ /* Event of receive data */
82
+ onData?: Array<EventAction>
83
+ /* Event of connection idle timeout */
84
+ onTimeout?: Array<EventAction>
85
+ /* Event of connection close */
86
+ onClose?: Array<EventAction>
87
+ /* Event of connection error */
88
+ onError?: Array<EventAction>
89
+ }
90
+ outlets?: {
91
+ /* Connection status */
92
+ status?: () => Data
93
+ /* Last received data */
94
+ lastData?: () => Data
95
+ /* Error message */
96
+ errorMessage?: () => Data
97
+ }
98
+ }
99
+
100
+ /* TCP */
101
+ export type GeneratorTCP = Generator &
102
+ GeneratorTCPDef & {
103
+ templateKey: 'GENERATOR_TCP'
104
+ switches: Array<
105
+ SwitchDef &
106
+ GeneratorTCPDef & {
107
+ conds?: Array<{
108
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
109
+ cond:
110
+ | SwitchCondInnerStateCurrentCanvas
111
+ | SwitchCondData
112
+ | {
113
+ __typename: 'SwitchCondInnerStateOutlet'
114
+ outlet: 'status' | 'lastData' | 'errorMessage'
115
+ value: any
116
+ }
117
+ }>
118
+ }
119
+ >
120
+ }