1
1
/* tslint:disable */
2
2
/* eslint-disable */
3
3
/**
4
- * Setups the WASM module
5
- */
4
+ * Setups the WASM module
5
+ */
6
6
export function start ( ) : void ;
7
7
/**
8
- * This will set the log level of the overall log subscriber.
9
- * @param {LogLevel } level
10
- */
8
+ * This will set the log level of the overall log subscriber.
9
+ */
11
10
export function set_log_level ( level : LogLevel ) : void ;
12
- /**
13
- */
11
+ export function cancel_handle ( ) : number ;
14
12
export enum LogLevel {
15
13
TRACE = 0 ,
16
14
DEBUG = 1 ,
@@ -23,8 +21,6 @@ export interface WasmFailure {
23
21
message : string ;
24
22
}
25
23
26
- export type WasmSendHandle = number ;
27
-
28
24
export interface WasmExponentialRetryConfig {
29
25
initial_interval : number | undefined ;
30
26
factor : number ;
@@ -38,256 +34,79 @@ export interface WasmAwakeable {
38
34
handle : number ;
39
35
}
40
36
41
- export type WasmAsyncResultValue = "NotReady" | "Empty" | { Success : Uint8Array } | { Failure : WasmFailure } | { StateKeys : string [ ] } | { InvocationId : string } | { CombinatorResult : WasmAsyncResultHandle [ ] } ;
37
+ export type WasmAsyncResultValue = "NotReady" | "Empty" | { Success : Uint8Array } | { Failure : WasmFailure } | { StateKeys : string [ ] } | { InvocationId : string } ;
42
38
43
- export type WasmRunEnterResult = { ExecutedWithSuccess : Uint8Array } | { ExecutedWithFailure : WasmFailure } | "NotExecuted" ;
39
+ export type WasmDoProgressResult = "AnyCompleted" | "ReadFromInput" | "WaitingPendingRun" | { ExecuteRun : number } | "CancelSignalReceived" ;
40
+
41
+ export interface WasmCallHandle {
42
+ invocation_id_completion_id : number ;
43
+ call_completion_id : number ;
44
+ }
45
+
46
+ export interface WasmSendHandle {
47
+ invocation_id_completion_id : number ;
48
+ }
44
49
45
- /**
46
- */
47
50
export class WasmHeader {
48
51
free ( ) : void ;
49
- /**
50
- * @param {string } key
51
- * @param {string } value
52
- */
53
52
constructor ( key : string , value : string ) ;
54
- /**
55
- */
56
53
readonly key : string ;
57
- /**
58
- */
59
54
readonly value : string ;
60
55
}
61
- /**
62
- */
63
56
export class WasmIdentityVerifier {
64
57
free ( ) : void ;
65
- /**
66
- * @param {(string)[] } keys
67
- */
68
- constructor ( keys : ( string ) [ ] ) ;
69
- /**
70
- * @param {string } path
71
- * @param {(WasmHeader)[] } headers
72
- */
73
- verify_identity ( path : string , headers : ( WasmHeader ) [ ] ) : void ;
58
+ constructor ( keys : string [ ] ) ;
59
+ verify_identity ( path : string , headers : WasmHeader [ ] ) : void ;
74
60
}
75
- /**
76
- */
77
61
export class WasmInput {
62
+ private constructor ( ) ;
78
63
free ( ) : void ;
79
- /**
80
- */
81
- readonly headers : ( WasmHeader ) [ ] ;
82
- /**
83
- */
84
- readonly input : Uint8Array ;
85
- /**
86
- */
87
64
readonly invocation_id : string ;
88
- /**
89
- */
90
65
readonly key : string ;
66
+ readonly headers : WasmHeader [ ] ;
67
+ readonly input : Uint8Array ;
91
68
}
92
- /**
93
- */
94
69
export class WasmResponseHead {
70
+ private constructor ( ) ;
95
71
free ( ) : void ;
96
- /**
97
- */
98
- readonly headers : ( WasmHeader ) [ ] ;
99
- /**
100
- */
101
72
readonly status_code : number ;
73
+ readonly headers : WasmHeader [ ] ;
102
74
}
103
- /**
104
- */
105
75
export class WasmVM {
106
76
free ( ) : void ;
107
- /**
108
- * @param {(WasmHeader)[] } headers
109
- * @param {LogLevel } log_level
110
- * @param {number } logger_id
111
- */
112
- constructor ( headers : ( WasmHeader ) [ ] , log_level : LogLevel , logger_id : number ) ;
113
- /**
114
- * @returns {WasmResponseHead }
115
- */
77
+ constructor ( headers : WasmHeader [ ] , log_level : LogLevel , logger_id : number ) ;
116
78
get_response_head ( ) : WasmResponseHead ;
117
- /**
118
- * @param {Uint8Array } buffer
119
- */
120
79
notify_input ( buffer : Uint8Array ) : void ;
121
- /**
122
- */
123
80
notify_input_closed ( ) : void ;
124
- /**
125
- * @param {string } error_message
126
- * @param {string | undefined } [error_description]
127
- */
128
- notify_error ( error_message : string , error_description ?: string ) : void ;
129
- /**
130
- * @returns {any }
131
- */
81
+ notify_error ( error_message : string , stacktrace ?: string | null ) : void ;
132
82
take_output ( ) : any ;
133
- /**
134
- * @returns {boolean }
135
- */
136
83
is_ready_to_execute ( ) : boolean ;
137
- /**
138
- * @param {number } handle
139
- */
140
- notify_await_point ( handle : number ) : void ;
141
- /**
142
- * @param {number } handle
143
- * @returns {WasmAsyncResultValue }
144
- */
145
- take_async_result ( handle : number ) : WasmAsyncResultValue ;
146
- /**
147
- * @returns {WasmInput }
148
- */
84
+ is_completed ( handle : number ) : boolean ;
85
+ do_progress ( handles : Uint32Array ) : WasmDoProgressResult ;
86
+ take_notification ( handle : number ) : WasmAsyncResultValue ;
149
87
sys_input ( ) : WasmInput ;
150
- /**
151
- * @param {string } key
152
- * @returns {number }
153
- */
154
88
sys_get_state ( key : string ) : number ;
155
- /**
156
- * @returns {number }
157
- */
158
89
sys_get_state_keys ( ) : number ;
159
- /**
160
- * @param {string } key
161
- * @param {Uint8Array } buffer
162
- */
163
90
sys_set_state ( key : string , buffer : Uint8Array ) : void ;
164
- /**
165
- * @param {string } key
166
- */
167
91
sys_clear_state ( key : string ) : void ;
168
- /**
169
- */
170
92
sys_clear_all_state ( ) : void ;
171
- /**
172
- * @param {bigint } millis
173
- * @returns {number }
174
- */
175
93
sys_sleep ( millis : bigint ) : number ;
176
- /**
177
- * @param {string } service
178
- * @param {string } handler
179
- * @param {Uint8Array } buffer
180
- * @param {string | undefined } key
181
- * @param {(WasmHeader)[] } headers
182
- * @returns {number }
183
- */
184
- sys_call ( service : string , handler : string , buffer : Uint8Array , key : string | undefined , headers : ( WasmHeader ) [ ] ) : number ;
185
- /**
186
- * @param {string } service
187
- * @param {string } handler
188
- * @param {Uint8Array } buffer
189
- * @param {string | undefined } key
190
- * @param {(WasmHeader)[] } headers
191
- * @param {bigint | undefined } [delay]
192
- * @returns {WasmSendHandle }
193
- */
194
- sys_send ( service : string , handler : string , buffer : Uint8Array , key : string | undefined , headers : ( WasmHeader ) [ ] , delay ?: bigint ) : WasmSendHandle ;
195
- /**
196
- * @returns {WasmAwakeable }
197
- */
94
+ sys_call ( service : string , handler : string , buffer : Uint8Array , key : string | null | undefined , headers : WasmHeader [ ] ) : WasmCallHandle ;
95
+ sys_send ( service : string , handler : string , buffer : Uint8Array , key : string | null | undefined , headers : WasmHeader [ ] , delay ?: bigint | null ) : WasmSendHandle ;
198
96
sys_awakeable ( ) : WasmAwakeable ;
199
- /**
200
- * @param {string } id
201
- * @param {Uint8Array } buffer
202
- */
203
97
sys_complete_awakeable_success ( id : string , buffer : Uint8Array ) : void ;
204
- /**
205
- * @param {string } id
206
- * @param {WasmFailure } value
207
- */
208
98
sys_complete_awakeable_failure ( id : string , value : WasmFailure ) : void ;
209
- /**
210
- * @param {string } key
211
- * @returns {number }
212
- */
213
99
sys_get_promise ( key : string ) : number ;
214
- /**
215
- * @param {string } key
216
- * @returns {number }
217
- */
218
100
sys_peek_promise ( key : string ) : number ;
219
- /**
220
- * @param {string } key
221
- * @param {Uint8Array } buffer
222
- * @returns {number }
223
- */
224
101
sys_complete_promise_success ( key : string , buffer : Uint8Array ) : number ;
225
- /**
226
- * @param {string } key
227
- * @param {WasmFailure } value
228
- * @returns {number }
229
- */
230
102
sys_complete_promise_failure ( key : string , value : WasmFailure ) : number ;
231
- /**
232
- * @param {string } name
233
- * @returns {WasmRunEnterResult }
234
- */
235
- sys_run_enter ( name : string ) : WasmRunEnterResult ;
236
- /**
237
- * @param {Uint8Array } buffer
238
- * @returns {number }
239
- */
240
- sys_run_exit_success ( buffer : Uint8Array ) : number ;
241
- /**
242
- * @param {WasmFailure } value
243
- * @returns {number }
244
- */
245
- sys_run_exit_failure ( value : WasmFailure ) : number ;
246
- /**
247
- * @param {string } error_message
248
- * @param {string | undefined } error_description
249
- * @param {bigint } attempt_duration
250
- * @param {WasmExponentialRetryConfig } config
251
- * @returns {number }
252
- */
253
- sys_run_exit_failure_transient ( error_message : string , error_description : string | undefined , attempt_duration : bigint , config : WasmExponentialRetryConfig ) : number ;
254
- /**
255
- * @param {Uint8Array } buffer
256
- */
103
+ sys_run ( name : string ) : number ;
104
+ propose_run_completion_success ( handle : number , buffer : Uint8Array ) : void ;
105
+ propose_run_completion_failure ( handle : number , value : WasmFailure ) : void ;
106
+ propose_run_completion_failure_transient ( handle : number , error_message : string , error_stacktrace : string | null | undefined , attempt_duration : bigint , config : WasmExponentialRetryConfig ) : void ;
107
+ sys_cancel_invocation ( target_invocation_id : string ) : void ;
257
108
sys_write_output_success ( buffer : Uint8Array ) : void ;
258
- /**
259
- * @param {WasmFailure } value
260
- */
261
109
sys_write_output_failure ( value : WasmFailure ) : void ;
262
- /**
263
- */
264
110
sys_end ( ) : void ;
265
- /**
266
- * @returns {boolean }
267
- */
268
111
is_processing ( ) : boolean ;
269
- /**
270
- * @returns {boolean }
271
- */
272
- is_inside_run ( ) : boolean ;
273
- /**
274
- * @param {Uint32Array } handles
275
- * @returns {number | undefined }
276
- */
277
- sys_try_complete_all_combinator ( handles : Uint32Array ) : number | undefined ;
278
- /**
279
- * @param {Uint32Array } handles
280
- * @returns {number | undefined }
281
- */
282
- sys_try_complete_any_combinator ( handles : Uint32Array ) : number | undefined ;
283
- /**
284
- * @param {Uint32Array } handles
285
- * @returns {number | undefined }
286
- */
287
- sys_try_complete_all_settled_combinator ( handles : Uint32Array ) : number | undefined ;
288
- /**
289
- * @param {Uint32Array } handles
290
- * @returns {number | undefined }
291
- */
292
- sys_try_complete_race_combinator ( handles : Uint32Array ) : number | undefined ;
293
112
}
0 commit comments