@dusted/anqst 0.1.3 → 1.0.1

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.
@@ -1,249 +1,328 @@
1
- /**
2
- * AnQst-Spec Language - Canonical source of truth for the language.
3
- *
4
- * @remarks
5
- * - DSL for Widget generation, transported as TypeScript definition.
6
- * - For AnQSt Widget Specifications only.
7
- * - Exactly one toplevel namespace must be declared: It names the Widget.
8
- * - Service interfaces are optional. Namespace-local type declarations are valid generation roots.
9
- * - Imported/external types are generation-relevant when transitively reachable from namespace declarations.
10
- * - This is not an input file to the generator, it is the description of the language that describes the widget.
11
- * Not for use by TypeScript application implementation.
12
- * @example
13
- * package.json:
14
- * - "AnQst": "./AnQst/MyUserMgmtWidget.settings.json"
15
- */
16
-
17
- export namespace AnQst {
18
-
19
- /**
20
- * Declare service `InterfaceName`
21
- *
22
- * @remarks
23
- * Multiple allowed.
24
- * Affords developers of advanced widgets the ability to create domain-informed categories.
25
- * - Duplicate method declarations with identical parameter lists are invalid in normative AnQst-Spec input.
26
- *
27
- * @example
28
- * export interface UserService extends Widget.Service { }
29
- * // Generates UserService.
30
- */
31
- interface Service { }
32
-
33
- /**
34
- * Declare service `InterfaceName` as development-mode capable transport service.
35
- *
36
- * @remarks
37
- * - Extends the same method/property semantics as `AnQst.Service`.
38
- * - Signals to the generator/runtime that this widget should emit dual-transport bridge support
39
- * (Qt WebChannel + HTTP/WebSocket development bridge).
40
- * - Existing generated service APIs remain unchanged.
41
- *
42
- * @example
43
- * export interface UserService extends AnQst.AngularHTTPBaseServerClass { }
44
- */
45
- interface AngularHTTPBaseServerClass extends Service { }
46
-
47
- type CallConfig = { timeoutSeconds: number } | { timeoutMilliseconds: number } | {};
48
-
49
- /**
50
- * Declare non-blocking service method `MethodName`(`MethodArguments`): Promise<`MethodReturnType`>.
51
- * @remarks
52
- * - **Widget** -> Parent
53
- * - Flow:
54
- * - Widget: Call to service method `MethodName`(`MethodArguments`).
55
- * - Widget: Returns Promise<`MethodReturnType`>.
56
- * - Parent: Registered callback receives args and returns `T` synchronously.
57
- * - Widget: Promise resolves with payload `T` or rejects with plain error object.
58
- * - Optional config supports timeout tuning:
59
- * - `AnQst.Call<T, { timeoutSeconds: N }>`
60
- * - `AnQst.Call<T, { timeoutMilliseconds: N }>`
61
- * - Exactly one timeout key is allowed. Value must be integer >= 0.
62
- * - Default timeout is 120s. `0` means wait forever.
63
- * @example
64
- * // AnQst spec:
65
- * getUserById(userId: string): AnQst.Call<User>
66
- * //Angular app:
67
- * const user: User = await this.userService.getUserById("abc");
68
- */
69
- interface Call<T, Config extends CallConfig = {}> { dummy: T; config?: Config }
70
-
71
- /**
72
- * Declare blocking service method onSlot.`MethodName`( handler(`MethodArguments`):`MethodReturnType` ): void
73
- * @remarks
74
- * - **Parent** -> Widget
75
- * - Impl note: Autogenerated stub handler queues until handler is set (set method calls spools queue through handler)
76
- * - Flow:
77
- * - Parent: Call to generated widget method `MethodName`(`MethodArguments`).
78
- * - Widget: Registered handler(`MethodArguments`) is called.
79
- * - Widget: Handler return forms:
80
- * - `T` -> success payload
81
- * - `Promise<T>` -> awaited, success payload on resolve
82
- * - `Error` -> failure
83
- * - throw -> failure
84
- * - rejected promise -> failure
85
- * - Parent: `MethodName` call returns with result.
86
- * - Generated C++ Slot methods do not expose `ok/error` out parameters.
87
- * - Default Slot timeout is 1000ms.
88
- * Note: One active handler, calling will replace existing and is valid and allowed.
89
- * @example
90
- * // AnQst spec:
91
- * getUsernameSubstring(from: number, to:number ): AnQst.Slot<string>
92
- * //Angular app:
93
- * this.userService.onSlot.getUsername( provider );
94
- * //Parent:
95
- * auto currentFormUsername = userMgmt.getUsername();
96
- */
97
- interface Slot<T> { dummy: T }
98
-
99
-
100
-
101
- /**
102
- * Declare message emission method `MethodName`(`MethodArguments`): void
103
- * @remarks
104
- * - **Widget** -> ?Parent
105
- * True Qt signal semantics (Message is emitted, no return path, no registration requirement)
106
- * - Flow:
107
- * - Widget: Call to service method `MethodName`(`MethodArguments`).
108
- * - Widget: Returns void.
109
- * - Parent: Might have something connected to the signal, might not.
110
- * - If no listener is connected, event is dropped.
111
- * @example
112
- * // AnQst spec:
113
- * complain(whine: string): AnQst.Emitter;
114
- * //Angular app:
115
- * this.userService.complain("Why won't you LISTEN!");
116
- */
117
- interface Emitter { }
118
-
119
-
120
- /**
121
- * Declare reactive `PropertyName`:`OutputType` and set.`PropertyName`(arg: `OutputType`)
122
- * @remarks
123
- * - **Parent** -> Widget
124
- * True Angular signal semantics (Property updates, signal emits, no return path, no registration requirement)
125
- * - Flow:
126
- * - Parent: Sets generated widget property `PropertyName`.
127
- * - Widget: Service updates readonly property `PropertyName` and emits signal.
128
- * @example
129
- * // AnQst spec:
130
- * activeUsers: AnQst.Output<number>;
131
- * //Angular app template:
132
- * <p>{{ userService.activeUsers() }}</p>
133
- * //Parent:
134
- * int users = userMgmt.activeUsers;
135
- * userMgmt.activeUsers = 99;
136
- */
137
- interface Output<OutputType> {}
138
-
139
-
140
- /**
141
- * Declare Input bindable set.`PropertyName`(input:`InputType`): void and `PropertyName`:`InputType`
142
- * @remarks
143
- * - **Widget** -> Parent
144
- * - Convenience method, for symmetry with Output.
145
- * - Flow:
146
- * - Widget: Calls service set.`PropertyName`(`InputType`) to publish current value.
147
- * - Parent: Mirrored generated widget property `PropertyName` is updated and emits change notification.
148
- * @example
149
- * // AnQst spec:
150
- * currentUsername: AnQst.Input<string>;
151
- * //Angular app template:
152
- * <input type="text" placeholder="Your Name Here" (input)="userService.set.currentUsername(($event.target as HTMLInputElement).value)" />
153
- * //Parent:
154
- * QString userName = userMgmt.currentUsername;
155
- */
156
- interface Input<InputType> {}
157
-
158
- /**
159
- * AnQst-Spec type mapping overview and control.
160
- *
161
- * @remarks
162
- * Any Type that be mapped between TypeScript and Qt, C++ standard types or
163
- * Plain Old Data (POD) types (in that order of preference) will be mapped by default.
164
- *
165
- * Canonical mapping directive namespace is AnQst.Type.<type>.
166
- * To express advisory mapping preference, use AnQst.Type.<type>.
167
- * Advisory means generator SHOULD honor it, but MAY fall back to inferred/default mapping and emit diagnostic.
168
- * Array forms are equivalent: T[] == Array<T>, and AnQst.Type.X[] == Array<AnQst.Type.X>.
169
- *
170
- * TypeScript definitions+classes and C++ structs are generated for each
171
- * structured TypeScript type ( type = {...} or interface { ... } )
172
- * referenced in an AnQst spec.
173
- *
174
- */
175
- enum Type {
176
- object = "JavaScript Object <-> QVariantMap (JSON.stringify/parse semantics)",
177
- json = "JavaScript Object <-> QJsonObject (JSON.stringify/parse semantics)",
178
- string = "JavaScript String <-> QString",
179
- stringArray = "JavaScript String[] <-> QStringList",
180
- number = "JavaScript Number <-> double",
181
- qint64 = "JavaScript BigInt <-> qint64 (Default, for symmetry, same as direct use of <BigInt> which is allowed.)",
182
- quint64 = "JavaScript BigInt <-> quint64",
183
- qint32 = "JavaScript Number <-> qint32",
184
- quint32 = "JavaScript Number <-> quint32",
185
- qint16 = "JavaScript Number <-> qint16",
186
- quint16 = "JavaScript Number <-> quint16",
187
- qint8 = "JavaScript Number <-> qint8",
188
- quint8 = "JavaScript Number <-> quint8",
189
- int32 = "JavaScript Number <-> int32_t",
190
- uint32 = "JavaScript Number <-> uint32_t",
191
- int16 = "JavaScript Number <-> int16_t",
192
- uint16 = "JavaScript Number <-> uint16_t",
193
- int8 = "JavaScript Number <-> int8_t",
194
- uint8 = "JavaScript Number <-> uint8_t",
195
- buffer = "JavaScript ArrayBuffer <-> QByteArray (Default, for symmetry, same as direct use of <ArrayBuffer> which is allowed.)",
196
- blob = "JavaScript ArrayBuffer <-> QByteArray",
197
- typedArray = "JavaScript TypedArray <-> QByteArray",
198
- uint8Array = "JavaScript Uint8Array <-> QByteArray",
199
- int8Array = "JavaScript Int8Array <-> QByteArray",
200
- uint16Array = "JavaScript Uint16Array <-> QByteArray",
201
- int16Array = "JavaScript Int16Array <-> QByteArray",
202
- uint32Array = "JavaScript Uint32Array <-> QByteArray",
203
- int32Array = "JavaScript Int32Array <-> QByteArray",
204
- float32Array = "JavaScript Float32Array <-> QByteArray",
205
- float64Array = "JavaScript Float64Array <-> QByteArray",
206
- }
207
-
208
-
209
- /**
210
- * These are explicitly forbidden argument/return types.
211
- *
212
- * @remarks
213
- * - They may not be referenced in AnQst specs or imported types.
214
- * - Service methods cannot accept them as arguments
215
- * - Service methods cannot return them.
216
- * - Service properties of their type cannot be declared.
217
- *
218
- * - For Objects/Maps/Sets use AnQst.Type.<Type> instead.
219
- */
220
- export enum ForbiddenType {
221
- Function = "Passing callbacks across the boundary is not allowed.",
222
- Class = "Passing classes across the boundary is not allowed.",
223
- Type = "Passing types across the boundary is not allowed.",
224
- Promise = "Passing Promises across the boundary is not allowed",
225
- Callable = "Passing Callable objects across the boundary is not allowed",
226
- any = "Passing 'any' type across the boundary is not allowed",
227
- }
228
-
229
- /**
230
- * JS/TS Error instances can be returned, but they have special meaning.
231
- *
232
- * @remarks
233
- * AnQst is opinionated, Errors are not for control flow. They are for signalling unrecoverable and unhandled circumstance.
234
- * Use: To indicate unrecoverable program error/wrong use.
235
- * Don't use: To communicate expected and/or ignorable/handable situations, define a domain-specific transport type instad.
236
- * When else encountered: Unhandled Errors.
237
- * Effect: The receiving end throws an exception with message `<service>.<member> emitted error: <WidgetStackTrace>`
238
- * AnQst internal behavior:
239
- * When AnQst type translation/mapping encounters a true Error object instance, the Error object is not transported, instead
240
- * the sending AnQst code signals to the receiving AnQst code a message, and the receiving AnQst code throws a runtime exception on
241
- * the call or callback site in the Parent.
242
-
243
- */
244
- export enum ExceptionalType {
245
- Error = "AnQst will not transport an Error object, but will cause an exception to be thrown on reception site."
246
- }
247
-
248
- }
249
-
1
+ /**
2
+ * AnQst-Spec Language - Canonical source of truth for the language.
3
+ *
4
+ * @remarks
5
+ * - DSL for Widget generation, transported as TypeScript definition.
6
+ * - For AnQSt Widget Specifications only.
7
+ * - Exactly one toplevel namespace must be declared: It names the Widget.
8
+ * - Service interfaces are optional. Namespace-local type declarations are valid generation roots.
9
+ * - Imported/external types are generation-relevant when transitively reachable from namespace declarations.
10
+ * - This is not an input file to the generator, it is the description of the language that describes the widget.
11
+ * Not for use by TypeScript application implementation.
12
+ * @example
13
+ * package.json:
14
+ * - "AnQst": "./AnQst/MyUserMgmtWidget.settings.json"
15
+ */
16
+
17
+ export namespace AnQst {
18
+
19
+ /**
20
+ * Declare service `InterfaceName`
21
+ *
22
+ * @remarks
23
+ * Multiple allowed.
24
+ * Affords developers of advanced widgets the ability to create domain-informed categories.
25
+ * - Duplicate method declarations with identical parameter lists are invalid in normative AnQst-Spec input.
26
+ *
27
+ * @example
28
+ * export interface UserService extends Widget.Service { }
29
+ * // Generates UserService.
30
+ */
31
+ interface Service { }
32
+
33
+ /**
34
+ * Declare service `InterfaceName` as development-mode capable transport service.
35
+ *
36
+ * @remarks
37
+ * - Extends the same method/property semantics as `AnQst.Service`.
38
+ * - Signals to the generator/runtime that this widget should emit dual-transport bridge support
39
+ * (Qt WebChannel + HTTP/WebSocket development bridge).
40
+ * - Existing generated service APIs remain unchanged.
41
+ *
42
+ * @example
43
+ * export interface UserService extends AnQst.AngularHTTPBaseServerClass { }
44
+ */
45
+ interface AngularHTTPBaseServerClass extends Service { }
46
+
47
+ type CallConfig = { timeoutSeconds: number } | { timeoutMilliseconds: number } | {};
48
+
49
+ /**
50
+ * Declare non-blocking service method `MethodName`(`MethodArguments`): Promise<`MethodReturnType`>.
51
+ * @remarks
52
+ * - **Widget** -> Parent
53
+ * - Flow:
54
+ * - Widget: Call to service method `MethodName`(`MethodArguments`).
55
+ * - Widget: Returns Promise<`MethodReturnType`>.
56
+ * - Parent: Registered callback receives args and returns `T` synchronously.
57
+ * - Widget: Promise resolves with payload `T` or rejects with plain error object.
58
+ * - Optional config supports timeout tuning:
59
+ * - `AnQst.Call<T, { timeoutSeconds: N }>`
60
+ * - `AnQst.Call<T, { timeoutMilliseconds: N }>`
61
+ * - Exactly one timeout key is allowed. Value must be integer >= 0.
62
+ * - Default timeout is 120s. `0` means wait forever.
63
+ * @example
64
+ * // AnQst spec:
65
+ * getUserById(userId: string): AnQst.Call<User>
66
+ * //Angular app:
67
+ * const user: User = await this.userService.getUserById("abc");
68
+ */
69
+ interface Call<T, Config extends CallConfig = {}> { dummy: T; config?: Config }
70
+
71
+ /**
72
+ * Declare blocking service method onSlot.`MethodName`( handler(`MethodArguments`):`MethodReturnType` ): void
73
+ * @remarks
74
+ * - **Parent** -> Widget
75
+ * - Impl note: Autogenerated stub handler queues until handler is set (set method calls spools queue through handler)
76
+ * - Flow:
77
+ * - Parent: Call to generated widget method `MethodName`(`MethodArguments`).
78
+ * - Widget: Registered handler(`MethodArguments`) is called.
79
+ * - Widget: Handler return forms:
80
+ * - `T` -> success payload
81
+ * - `Promise<T>` -> awaited, success payload on resolve
82
+ * - `Error` -> failure
83
+ * - throw -> failure
84
+ * - rejected promise -> failure
85
+ * - Parent: `MethodName` call returns with result.
86
+ * - Generated C++ Slot methods do not expose `ok/error` out parameters.
87
+ * - Default Slot timeout is 1000ms.
88
+ * Note: One active handler, calling will replace existing and is valid and allowed.
89
+ * @example
90
+ * // AnQst spec:
91
+ * getUsernameSubstring(from: number, to:number ): AnQst.Slot<string>
92
+ * //Angular app:
93
+ * this.userService.onSlot.getUsername( provider );
94
+ * //Parent:
95
+ * auto currentFormUsername = userMgmt.getUsername();
96
+ */
97
+ interface Slot<T> { dummy: T }
98
+
99
+
100
+
101
+ /**
102
+ * Declare message emission method `MethodName`(`MethodArguments`): void
103
+ * @remarks
104
+ * - **Widget** -> ?Parent
105
+ * True Qt signal semantics (Message is emitted, no return path, no registration requirement)
106
+ * - Flow:
107
+ * - Widget: Call to service method `MethodName`(`MethodArguments`).
108
+ * - Widget: Returns void.
109
+ * - Parent: Might have something connected to the signal, might not.
110
+ * - If no listener is connected, event is dropped.
111
+ * @example
112
+ * // AnQst spec:
113
+ * complain(whine: string): AnQst.Emitter;
114
+ * //Angular app:
115
+ * this.userService.complain("Why won't you LISTEN!");
116
+ */
117
+ interface Emitter { }
118
+
119
+
120
+ /**
121
+ * Declare reactive `PropertyName`:`OutputType` and set.`PropertyName`(arg: `OutputType`)
122
+ * @remarks
123
+ * - **Parent** -> Widget
124
+ * True Angular signal semantics (Property updates, signal emits, no return path, no registration requirement)
125
+ * - Flow:
126
+ * - Parent: Sets generated widget property `PropertyName`.
127
+ * - Widget: Service updates readonly property `PropertyName` and emits signal.
128
+ * @example
129
+ * // AnQst spec:
130
+ * activeUsers: AnQst.Output<number>;
131
+ * //Angular app template:
132
+ * <p>{{ userService.activeUsers() }}</p>
133
+ * //Parent:
134
+ * int users = userMgmt.activeUsers;
135
+ * userMgmt.activeUsers = 99;
136
+ */
137
+ interface Output<OutputType> {}
138
+
139
+
140
+ /**
141
+ * Declare Input bindable set.`PropertyName`(input:`InputType`): void and `PropertyName`:`InputType`
142
+ * @remarks
143
+ * - **Widget** -> Parent
144
+ * - Convenience method, for symmetry with Output.
145
+ * - Flow:
146
+ * - Widget: Calls service set.`PropertyName`(`InputType`) to publish current value.
147
+ * - Parent: Mirrored generated widget property `PropertyName` is updated and emits change notification.
148
+ * @example
149
+ * // AnQst spec:
150
+ * currentUsername: AnQst.Input<string>;
151
+ * //Angular app template:
152
+ * <input type="text" placeholder="Your Name Here" (input)="userService.set.currentUsername(($event.target as HTMLInputElement).value)" />
153
+ * //Parent:
154
+ * QString userName = userMgmt.currentUsername;
155
+ */
156
+ interface Input<InputType> {}
157
+
158
+
159
+ /**
160
+ * Declare drop-target `PropertyName`:`PayloadType`
161
+ * @remarks
162
+ * - **Parent** -> Widget (framework-mediated)
163
+ * - True Angular signal semantics.
164
+ * - Flow:
165
+ * - External: A Qt widget initiates a QDrag carrying QMimeData.
166
+ * - Parent: AnQstWebHostBase intercepts the drop via event filter on the
167
+ * embedded QWebEngineView's rendering surface.
168
+ * - Parent: QMimeData for the accepted format is deserialized (JSON) into
169
+ * the generated C++ struct and forwarded through the bridge.
170
+ * - Widget: Service updates signal `PropertyName` with the deserialized
171
+ * payload and drop coordinates. Angular components react via effect() / template binding.
172
+ * - MIME type is convention-derived: `application/anqst-dragdropevent_<ServiceName>-<TypeName>`.
173
+ * - The source QWidget must serialize the drag payload as JSON under the same MIME type.
174
+ * - Multiple DropTarget members per service are allowed (each accepting a different type).
175
+ * @example
176
+ * // AnQst spec:
177
+ * trackDropped: AnQst.DropTarget<Track>;
178
+ * // Angular app:
179
+ * effect(() => {
180
+ * const drop = this.service.trackDropped();
181
+ * if (drop !== null) { console.log(drop.payload, drop.x, drop.y); }
182
+ * });
183
+ */
184
+ interface DropTarget<T> { dummy: T }
185
+
186
+
187
+ /**
188
+ * Declare hover-target `PropertyName`:`PayloadType`
189
+ * @remarks
190
+ * - **Parent** -> Widget (framework-mediated)
191
+ * - True Angular signal semantics.
192
+ * - Flow:
193
+ * - External: A Qt widget initiates a QDrag carrying QMimeData.
194
+ * - Parent: AnQstWebHostBase intercepts drag-move events via event filter on the
195
+ * embedded QWebEngineView's rendering surface. Events are throttled (trailing edge).
196
+ * - Parent: Payload is deserialized once on DragEnter; subsequent DragMove events
197
+ * forward only the updated position.
198
+ * - Widget: Service updates signal `PropertyName` with the payload and current
199
+ * coordinates. Signal becomes null on DragLeave.
200
+ * - Shares the same MIME type convention as DropTarget: `application/anqst-dragdropevent_<ServiceName>-<TypeName>`.
201
+ * - A HoverTarget without a corresponding DropTarget means "show previews but reject the drop".
202
+ * - Optional config supports throttle tuning:
203
+ * - `AnQst.HoverTarget<T, { maxRateHz: N }>` — maximum rate of hover position updates
204
+ * forwarded across the bridge, in hertz. The generator converts this to a millisecond
205
+ * interval at build time (e.g. 60 Hz -> 17 ms, 10 Hz -> 100 ms).
206
+ * - Default is 60 Hz (~17 ms throttle interval).
207
+ * - `0` means no throttling: every QDragMoveEvent is forwarded immediately.
208
+ * - There is no upper bound on the value.
209
+ * @example
210
+ * // AnQst spec (default 60 Hz throttle):
211
+ * trackHovering: AnQst.HoverTarget<Track>;
212
+ * // AnQst spec (custom 10 Hz throttle):
213
+ * trackHovering: AnQst.HoverTarget<Track, { maxRateHz: 10 }>;
214
+ * // AnQst spec (no throttling):
215
+ * trackHovering: AnQst.HoverTarget<Track, { maxRateHz: 0 }>;
216
+ * // Angular app:
217
+ * effect(() => {
218
+ * const hover = this.service.trackHovering();
219
+ * if (hover !== null) { highlight(document.elementFromPoint(hover.x, hover.y)); }
220
+ * });
221
+ */
222
+
223
+ /**
224
+ * Configuration for HoverTarget throttle behavior.
225
+ * @remarks
226
+ * - `maxRateHz` Maximum rate in hertz at which hover position updates are forwarded.
227
+ * - Default (omitted or `{}`): 60 Hz.
228
+ * - `0`: No throttling; every QDragMoveEvent is forwarded.
229
+ * - No upper bound.
230
+ * - Value must be a numeric literal >= 0.
231
+ */
232
+ type HoverTargetConfig = { maxRateHz: number } | {};
233
+ interface HoverTarget<T, Config extends HoverTargetConfig = {}> { dummy: T; config?: Config }
234
+
235
+
236
+
237
+ /**
238
+ * AnQst-Spec type mapping overview and control.
239
+ *
240
+ * @remarks
241
+ * Any Type that be mapped between TypeScript and Qt, C++ standard types or
242
+ * Plain Old Data (POD) types (in that order of preference) will be mapped by default.
243
+ *
244
+ * Canonical mapping directive namespace is AnQst.Type.<type>.
245
+ * To express advisory mapping preference, use AnQst.Type.<type>.
246
+ * Advisory means generator SHOULD honor it, but MAY fall back to inferred/default mapping and emit diagnostic.
247
+ * Array forms are equivalent: T[] == Array<T>, and AnQst.Type.X[] == Array<AnQst.Type.X>.
248
+ *
249
+ * TypeScript definitions+classes and C++ structs are generated for each
250
+ * structured TypeScript type ( type = {...} or interface { ... } )
251
+ * referenced in an AnQst spec.
252
+ *
253
+ */
254
+ enum Type {
255
+ object = "JavaScript Object <-> QVariantMap (JSON.stringify/parse semantics)",
256
+ json = "JavaScript Object <-> QJsonObject (JSON.stringify/parse semantics)",
257
+ string = "JavaScript String <-> QString",
258
+ stringArray = "JavaScript String[] <-> QStringList",
259
+ number = "JavaScript Number <-> double",
260
+ qint64 = "JavaScript BigInt <-> qint64 (Default, for symmetry, same as direct use of <BigInt> which is allowed.)",
261
+ quint64 = "JavaScript BigInt <-> quint64",
262
+ qint32 = "JavaScript Number <-> qint32",
263
+ quint32 = "JavaScript Number <-> quint32",
264
+ qint16 = "JavaScript Number <-> qint16",
265
+ quint16 = "JavaScript Number <-> quint16",
266
+ qint8 = "JavaScript Number <-> qint8",
267
+ quint8 = "JavaScript Number <-> quint8",
268
+ int32 = "JavaScript Number <-> int32_t",
269
+ uint32 = "JavaScript Number <-> uint32_t",
270
+ int16 = "JavaScript Number <-> int16_t",
271
+ uint16 = "JavaScript Number <-> uint16_t",
272
+ int8 = "JavaScript Number <-> int8_t",
273
+ uint8 = "JavaScript Number <-> uint8_t",
274
+ buffer = "JavaScript ArrayBuffer <-> QByteArray (Default, for symmetry, same as direct use of <ArrayBuffer> which is allowed.)",
275
+ blob = "JavaScript ArrayBuffer <-> QByteArray",
276
+ typedArray = "JavaScript TypedArray <-> QByteArray",
277
+ uint8Array = "JavaScript Uint8Array <-> QByteArray",
278
+ int8Array = "JavaScript Int8Array <-> QByteArray",
279
+ uint16Array = "JavaScript Uint16Array <-> QByteArray",
280
+ int16Array = "JavaScript Int16Array <-> QByteArray",
281
+ uint32Array = "JavaScript Uint32Array <-> QByteArray",
282
+ int32Array = "JavaScript Int32Array <-> QByteArray",
283
+ float32Array = "JavaScript Float32Array <-> QByteArray",
284
+ float64Array = "JavaScript Float64Array <-> QByteArray",
285
+ }
286
+
287
+
288
+ /**
289
+ * These are explicitly forbidden argument/return types.
290
+ *
291
+ * @remarks
292
+ * - They may not be referenced in AnQst specs or imported types.
293
+ * - Service methods cannot accept them as arguments
294
+ * - Service methods cannot return them.
295
+ * - Service properties of their type cannot be declared.
296
+ *
297
+ * - For Objects/Maps/Sets use AnQst.Type.<Type> instead.
298
+ */
299
+ export enum ForbiddenType {
300
+ Function = "Passing callbacks across the boundary is not allowed.",
301
+ Class = "Passing classes across the boundary is not allowed.",
302
+ Type = "Passing types across the boundary is not allowed.",
303
+ Promise = "Passing Promises across the boundary is not allowed",
304
+ Callable = "Passing Callable objects across the boundary is not allowed",
305
+ any = "Passing 'any' type across the boundary is not allowed",
306
+ }
307
+
308
+ /**
309
+ * JS/TS Error instances can be returned, but they have special meaning.
310
+ *
311
+ * @remarks
312
+ * AnQst is opinionated, Errors are not for control flow. They are for signalling unrecoverable and unhandled circumstance.
313
+ * Use: To indicate unrecoverable program error/wrong use.
314
+ * Don't use: To communicate expected and/or ignorable/handable situations, define a domain-specific transport type instad.
315
+ * When else encountered: Unhandled Errors.
316
+ * Effect: The receiving end throws an exception with message `<service>.<member> emitted error: <WidgetStackTrace>`
317
+ * AnQst internal behavior:
318
+ * When AnQst type translation/mapping encounters a true Error object instance, the Error object is not transported, instead
319
+ * the sending AnQst code signals to the receiving AnQst code a message, and the receiving AnQst code throws a runtime exception on
320
+ * the call or callback site in the Parent.
321
+
322
+ */
323
+ export enum ExceptionalType {
324
+ Error = "AnQst will not transport an Error object, but will cause an exception to be thrown on reception site."
325
+ }
326
+
327
+ }
328
+