@stryke/capnp 0.10.0 → 0.10.2

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 (43) hide show
  1. package/bin/capnpc.cjs +62 -30
  2. package/bin/capnpc.js +62 -30
  3. package/dist/chunk-3IOIINHW.js +895 -0
  4. package/dist/chunk-3ZOLKZQQ.cjs +895 -0
  5. package/dist/chunk-55455L4M.cjs +4103 -0
  6. package/dist/chunk-5VHN3KGS.js +3305 -0
  7. package/dist/chunk-CCU32X36.js +15 -0
  8. package/dist/chunk-GWW6WBAL.js +4103 -0
  9. package/dist/chunk-IBMXNAOT.cjs +4877 -0
  10. package/dist/chunk-KXWOF6H4.cjs +3305 -0
  11. package/dist/chunk-N2KNXTXN.js +4877 -0
  12. package/dist/chunk-R2JXWA7Q.cjs +15 -0
  13. package/dist/compile.cjs +7 -72
  14. package/dist/compile.d.cts +3 -3
  15. package/dist/compile.d.ts +3 -3
  16. package/dist/compile.js +6 -71
  17. package/dist/helpers.cjs +4 -49
  18. package/dist/helpers.d.cts +2 -2
  19. package/dist/helpers.d.ts +2 -2
  20. package/dist/helpers.js +3 -48
  21. package/dist/index.cjs +138 -4
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +138 -4
  25. package/dist/rpc.cjs +6 -117
  26. package/dist/rpc.js +5 -116
  27. package/dist/types.cjs +3 -8
  28. package/dist/types.d.cts +13 -4
  29. package/dist/types.d.ts +13 -4
  30. package/dist/types.js +3 -8
  31. package/dts/index.d.cts +14 -5
  32. package/dts/index.d.ts +14 -5
  33. package/package.json +4 -4
  34. package/schemas/persistent.cjs +20 -20
  35. package/schemas/persistent.js +1 -1
  36. package/schemas/rpc-twoparty.cjs +32 -32
  37. package/schemas/rpc-twoparty.js +1 -1
  38. package/schemas/rpc.cjs +495 -495
  39. package/schemas/rpc.js +1 -1
  40. package/schemas/schema.cjs +675 -675
  41. package/schemas/schema.js +1 -1
  42. /package/schemas/{chunk-ZGPCLBI4.cjs → chunk-BM2HWFSD.cjs} +0 -0
  43. /package/schemas/{chunk-3CJYH45H.js → chunk-TAKPBFYZ.js} +0 -0
@@ -0,0 +1,4103 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18; var _class19; var _class20; var _class21; var _class22; var _class23; var _class24; var _class25; var _class26; var _class27; var _class28; var _class29; var _class30; var _class31; var _class32; var _class33; var _class34; var _class35; var _class36; var _class37;
2
+
3
+ var _chunk3ZOLKZQQcjs = require('./chunk-3ZOLKZQQ.cjs');
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+ var _chunkKXWOF6H4cjs = require('./chunk-KXWOF6H4.cjs');
50
+
51
+
52
+ var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
53
+
54
+ // src/compile.ts
55
+ var _console = require('@storm-software/config-tools/logger/console');
56
+
57
+ // ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
58
+ var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
59
+
60
+ // ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/capnp/schema.mjs
61
+ var _capnpFileId = BigInt("0xa93fc509624c72d9");
62
+ var Node_Parameter = (_class = class extends _chunkKXWOF6H4cjs.Struct {
63
+ static {
64
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Parameter");
65
+ }
66
+ static __initStatic() {this._capnp = {
67
+ displayName: "Parameter",
68
+ id: "b9521bccf10fa3b1",
69
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(0, 1)
70
+ }}
71
+ get name() {
72
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
73
+ }
74
+ set name(value) {
75
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
76
+ }
77
+ toString() {
78
+ return "Node_Parameter_" + super.toString();
79
+ }
80
+ }, _class.__initStatic(), _class);
81
+ var Node_NestedNode = (_class2 = class extends _chunkKXWOF6H4cjs.Struct {
82
+ static {
83
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_NestedNode");
84
+ }
85
+ static __initStatic2() {this._capnp = {
86
+ displayName: "NestedNode",
87
+ id: "debf55bbfa0fc242",
88
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 1)
89
+ }}
90
+ /**
91
+ * Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.
92
+ *
93
+ * (On Zooko's triangle, this is the node's petname according to its parent scope.)
94
+ *
95
+ */
96
+ get name() {
97
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
98
+ }
99
+ set name(value) {
100
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
101
+ }
102
+ /**
103
+ * ID of the nested node. Typically, the target node's scopeId points back to this node, but
104
+ * robust code should avoid relying on this.
105
+ *
106
+ */
107
+ get id() {
108
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
109
+ }
110
+ set id(value) {
111
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
112
+ }
113
+ toString() {
114
+ return "Node_NestedNode_" + super.toString();
115
+ }
116
+ }, _class2.__initStatic2(), _class2);
117
+ var Node_SourceInfo_Member = (_class3 = class extends _chunkKXWOF6H4cjs.Struct {
118
+ static {
119
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_SourceInfo_Member");
120
+ }
121
+ static __initStatic3() {this._capnp = {
122
+ displayName: "Member",
123
+ id: "c2ba9038898e1fa2",
124
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(0, 1)
125
+ }}
126
+ /**
127
+ * Doc comment on the member.
128
+ *
129
+ */
130
+ get docComment() {
131
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
132
+ }
133
+ set docComment(value) {
134
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
135
+ }
136
+ toString() {
137
+ return "Node_SourceInfo_Member_" + super.toString();
138
+ }
139
+ }, _class3.__initStatic3(), _class3);
140
+ var Node_SourceInfo = (_class4 = class _Node_SourceInfo extends _chunkKXWOF6H4cjs.Struct {
141
+ static {
142
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_SourceInfo");
143
+ }
144
+ static __initStatic4() {this.Member = Node_SourceInfo_Member}
145
+ static __initStatic5() {this._capnp = {
146
+ displayName: "SourceInfo",
147
+ id: "f38e1de3041357ae",
148
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 2)
149
+ }}
150
+
151
+ /**
152
+ * ID of the Node which this info describes.
153
+ *
154
+ */
155
+ get id() {
156
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
157
+ }
158
+ set id(value) {
159
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
160
+ }
161
+ /**
162
+ * The top-level doc comment for the Node.
163
+ *
164
+ */
165
+ get docComment() {
166
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
167
+ }
168
+ set docComment(value) {
169
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
170
+ }
171
+ _adoptMembers(value) {
172
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
173
+ }
174
+ _disownMembers() {
175
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.members);
176
+ }
177
+ /**
178
+ * Information about each member -- i.e. fields (for structs), enumerants (for enums), or
179
+ * methods (for interfaces).
180
+ *
181
+ * This list is the same length and order as the corresponding list in the Node, i.e.
182
+ * Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.
183
+ *
184
+ */
185
+ get members() {
186
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _Node_SourceInfo._Members, this);
187
+ }
188
+ _hasMembers() {
189
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
190
+ }
191
+ _initMembers(length) {
192
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _Node_SourceInfo._Members, length, this);
193
+ }
194
+ set members(value) {
195
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
196
+ }
197
+ toString() {
198
+ return "Node_SourceInfo_" + super.toString();
199
+ }
200
+ }, _class4.__initStatic4(), _class4.__initStatic5(), _class4);
201
+ var Node_Struct = (_class5 = class _Node_Struct extends _chunkKXWOF6H4cjs.Struct {
202
+ static {
203
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Struct");
204
+ }
205
+ static __initStatic6() {this._capnp = {
206
+ displayName: "struct",
207
+ id: "9ea0b19b37fb4435",
208
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
209
+ }}
210
+
211
+ /**
212
+ * Size of the data section, in words.
213
+ *
214
+ */
215
+ get dataWordCount() {
216
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 14, this);
217
+ }
218
+ set dataWordCount(value) {
219
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 14, value, this);
220
+ }
221
+ /**
222
+ * Size of the pointer section, in pointers (which are one word each).
223
+ *
224
+ */
225
+ get pointerCount() {
226
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 24, this);
227
+ }
228
+ set pointerCount(value) {
229
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 24, value, this);
230
+ }
231
+ /**
232
+ * The preferred element size to use when encoding a list of this struct. If this is anything
233
+ * other than `inlineComposite` then the struct is one word or less in size and is a candidate
234
+ * for list packing optimization.
235
+ *
236
+ */
237
+ get preferredListEncoding() {
238
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 26, this);
239
+ }
240
+ set preferredListEncoding(value) {
241
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 26, value, this);
242
+ }
243
+ /**
244
+ * If true, then this "struct" node is actually not an independent node, but merely represents
245
+ * some named union or group within a particular parent struct. This node's scopeId refers
246
+ * to the parent struct, which may itself be a union/group in yet another struct.
247
+ *
248
+ * All group nodes share the same dataWordCount and pointerCount as the top-level
249
+ * struct, and their fields live in the same ordinal and offset spaces as all other fields in
250
+ * the struct.
251
+ *
252
+ * Note that a named union is considered a special kind of group -- in fact, a named union
253
+ * is exactly equivalent to a group that contains nothing but an unnamed union.
254
+ *
255
+ */
256
+ get isGroup() {
257
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 224, this);
258
+ }
259
+ set isGroup(value) {
260
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 224, value, this);
261
+ }
262
+ /**
263
+ * Number of fields in this struct which are members of an anonymous union, and thus may
264
+ * overlap. If this is non-zero, then a 16-bit discriminant is present indicating which
265
+ * of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be
266
+ * two or more.
267
+ *
268
+ * Note that the fields of an unnamed union are considered fields of the scope containing the
269
+ * union -- an unnamed union is not its own group. So, a top-level struct may contain a
270
+ * non-zero discriminant count. Named unions, on the other hand, are equivalent to groups
271
+ * containing unnamed unions. So, a named union has its own independent schema node, with
272
+ * `isGroup` = true.
273
+ *
274
+ */
275
+ get discriminantCount() {
276
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 30, this);
277
+ }
278
+ set discriminantCount(value) {
279
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 30, value, this);
280
+ }
281
+ /**
282
+ * If `discriminantCount` is non-zero, this is the offset of the union discriminant, in
283
+ * multiples of 16 bits.
284
+ *
285
+ */
286
+ get discriminantOffset() {
287
+ return _chunkKXWOF6H4cjs.getUint32.call(void 0, 32, this);
288
+ }
289
+ set discriminantOffset(value) {
290
+ _chunkKXWOF6H4cjs.setUint32.call(void 0, 32, value, this);
291
+ }
292
+ _adoptFields(value) {
293
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
294
+ }
295
+ _disownFields() {
296
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.fields);
297
+ }
298
+ /**
299
+ * Fields defined within this scope (either the struct's top-level fields, or the fields of
300
+ * a particular group; see `isGroup`).
301
+ *
302
+ * The fields are sorted by ordinal number, but note that because groups share the same
303
+ * ordinal space, the field's index in this list is not necessarily exactly its ordinal.
304
+ * On the other hand, the field's position in this list does remain the same even as the
305
+ * protocol evolves, since it is not possible to insert or remove an earlier ordinal.
306
+ * Therefore, for most use cases, if you want to identify a field by number, it may make the
307
+ * most sense to use the field's index in this list rather than its ordinal.
308
+ *
309
+ */
310
+ get fields() {
311
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 3, _Node_Struct._Fields, this);
312
+ }
313
+ _hasFields() {
314
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
315
+ }
316
+ _initFields(length) {
317
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 3, _Node_Struct._Fields, length, this);
318
+ }
319
+ set fields(value) {
320
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
321
+ }
322
+ toString() {
323
+ return "Node_Struct_" + super.toString();
324
+ }
325
+ }, _class5.__initStatic6(), _class5);
326
+ var Node_Enum = (_class6 = class _Node_Enum extends _chunkKXWOF6H4cjs.Struct {
327
+ static {
328
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Enum");
329
+ }
330
+ static __initStatic7() {this._capnp = {
331
+ displayName: "enum",
332
+ id: "b54ab3364333f598",
333
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
334
+ }}
335
+
336
+ _adoptEnumerants(value) {
337
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
338
+ }
339
+ _disownEnumerants() {
340
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.enumerants);
341
+ }
342
+ /**
343
+ * Enumerants ordered by numeric value (ordinal).
344
+ *
345
+ */
346
+ get enumerants() {
347
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 3, _Node_Enum._Enumerants, this);
348
+ }
349
+ _hasEnumerants() {
350
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
351
+ }
352
+ _initEnumerants(length) {
353
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 3, _Node_Enum._Enumerants, length, this);
354
+ }
355
+ set enumerants(value) {
356
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
357
+ }
358
+ toString() {
359
+ return "Node_Enum_" + super.toString();
360
+ }
361
+ }, _class6.__initStatic7(), _class6);
362
+ var Node_Interface = (_class7 = class _Node_Interface extends _chunkKXWOF6H4cjs.Struct {
363
+ static {
364
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Interface");
365
+ }
366
+ static __initStatic8() {this._capnp = {
367
+ displayName: "interface",
368
+ id: "e82753cff0c2218f",
369
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
370
+ }}
371
+
372
+
373
+ _adoptMethods(value) {
374
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
375
+ }
376
+ _disownMethods() {
377
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.methods);
378
+ }
379
+ /**
380
+ * Methods ordered by ordinal.
381
+ *
382
+ */
383
+ get methods() {
384
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 3, _Node_Interface._Methods, this);
385
+ }
386
+ _hasMethods() {
387
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
388
+ }
389
+ _initMethods(length) {
390
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 3, _Node_Interface._Methods, length, this);
391
+ }
392
+ set methods(value) {
393
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
394
+ }
395
+ _adoptSuperclasses(value) {
396
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
397
+ }
398
+ _disownSuperclasses() {
399
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.superclasses);
400
+ }
401
+ /**
402
+ * Superclasses of this interface.
403
+ *
404
+ */
405
+ get superclasses() {
406
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 4, _Node_Interface._Superclasses, this);
407
+ }
408
+ _hasSuperclasses() {
409
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
410
+ }
411
+ _initSuperclasses(length) {
412
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 4, _Node_Interface._Superclasses, length, this);
413
+ }
414
+ set superclasses(value) {
415
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
416
+ }
417
+ toString() {
418
+ return "Node_Interface_" + super.toString();
419
+ }
420
+ }, _class7.__initStatic8(), _class7);
421
+ var Node_Const = (_class8 = class extends _chunkKXWOF6H4cjs.Struct {
422
+ static {
423
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Const");
424
+ }
425
+ static __initStatic9() {this._capnp = {
426
+ displayName: "const",
427
+ id: "b18aa5ac7a0d9420",
428
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
429
+ }}
430
+ _adoptType(value) {
431
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
432
+ }
433
+ _disownType() {
434
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.type);
435
+ }
436
+ get type() {
437
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 3, Type, this);
438
+ }
439
+ _hasType() {
440
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
441
+ }
442
+ _initType() {
443
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 3, Type, this);
444
+ }
445
+ set type(value) {
446
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
447
+ }
448
+ _adoptValue(value) {
449
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
450
+ }
451
+ _disownValue() {
452
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.value);
453
+ }
454
+ get value() {
455
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 4, Value, this);
456
+ }
457
+ _hasValue() {
458
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
459
+ }
460
+ _initValue() {
461
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 4, Value, this);
462
+ }
463
+ set value(value) {
464
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
465
+ }
466
+ toString() {
467
+ return "Node_Const_" + super.toString();
468
+ }
469
+ }, _class8.__initStatic9(), _class8);
470
+ var Node_Annotation = (_class9 = class extends _chunkKXWOF6H4cjs.Struct {
471
+ static {
472
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node_Annotation");
473
+ }
474
+ static __initStatic10() {this._capnp = {
475
+ displayName: "annotation",
476
+ id: "ec1619d4400a0290",
477
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
478
+ }}
479
+ _adoptType(value) {
480
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
481
+ }
482
+ _disownType() {
483
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.type);
484
+ }
485
+ get type() {
486
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 3, Type, this);
487
+ }
488
+ _hasType() {
489
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
490
+ }
491
+ _initType() {
492
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 3, Type, this);
493
+ }
494
+ set type(value) {
495
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
496
+ }
497
+ get targetsFile() {
498
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 112, this);
499
+ }
500
+ set targetsFile(value) {
501
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 112, value, this);
502
+ }
503
+ get targetsConst() {
504
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 113, this);
505
+ }
506
+ set targetsConst(value) {
507
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 113, value, this);
508
+ }
509
+ get targetsEnum() {
510
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 114, this);
511
+ }
512
+ set targetsEnum(value) {
513
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 114, value, this);
514
+ }
515
+ get targetsEnumerant() {
516
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 115, this);
517
+ }
518
+ set targetsEnumerant(value) {
519
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 115, value, this);
520
+ }
521
+ get targetsStruct() {
522
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 116, this);
523
+ }
524
+ set targetsStruct(value) {
525
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 116, value, this);
526
+ }
527
+ get targetsField() {
528
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 117, this);
529
+ }
530
+ set targetsField(value) {
531
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 117, value, this);
532
+ }
533
+ get targetsUnion() {
534
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 118, this);
535
+ }
536
+ set targetsUnion(value) {
537
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 118, value, this);
538
+ }
539
+ get targetsGroup() {
540
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 119, this);
541
+ }
542
+ set targetsGroup(value) {
543
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 119, value, this);
544
+ }
545
+ get targetsInterface() {
546
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 120, this);
547
+ }
548
+ set targetsInterface(value) {
549
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 120, value, this);
550
+ }
551
+ get targetsMethod() {
552
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 121, this);
553
+ }
554
+ set targetsMethod(value) {
555
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 121, value, this);
556
+ }
557
+ get targetsParam() {
558
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 122, this);
559
+ }
560
+ set targetsParam(value) {
561
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 122, value, this);
562
+ }
563
+ get targetsAnnotation() {
564
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 123, this);
565
+ }
566
+ set targetsAnnotation(value) {
567
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 123, value, this);
568
+ }
569
+ toString() {
570
+ return "Node_Annotation_" + super.toString();
571
+ }
572
+ }, _class9.__initStatic10(), _class9);
573
+ var Node_Which = {
574
+ FILE: 0,
575
+ /**
576
+ * Name to present to humans to identify this Node. You should not attempt to parse this. Its
577
+ * format could change. It is not guaranteed to be unique.
578
+ *
579
+ * (On Zooko's triangle, this is the node's nickname.)
580
+ *
581
+ */
582
+ STRUCT: 1,
583
+ /**
584
+ * If you want a shorter version of `displayName` (just naming this node, without its surrounding
585
+ * scope), chop off this many characters from the beginning of `displayName`.
586
+ *
587
+ */
588
+ ENUM: 2,
589
+ /**
590
+ * ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back
591
+ * at this node, but robust code should avoid relying on this (and, in fact, group nodes are not
592
+ * listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is
593
+ * zero if the node has no parent, which is normally only the case with files, but should be
594
+ * allowed for any kind of node (in order to make runtime type generation easier).
595
+ *
596
+ */
597
+ INTERFACE: 3,
598
+ /**
599
+ * List of nodes nested within this node, along with the names under which they were declared.
600
+ *
601
+ */
602
+ CONST: 4,
603
+ /**
604
+ * Annotations applied to this node.
605
+ *
606
+ */
607
+ ANNOTATION: 5
608
+ };
609
+ var Node = (_class10 = class _Node extends _chunkKXWOF6H4cjs.Struct {
610
+ static {
611
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Node");
612
+ }
613
+ static __initStatic11() {this.FILE = Node_Which.FILE}
614
+ static __initStatic12() {this.STRUCT = Node_Which.STRUCT}
615
+ static __initStatic13() {this.ENUM = Node_Which.ENUM}
616
+ static __initStatic14() {this.INTERFACE = Node_Which.INTERFACE}
617
+ static __initStatic15() {this.CONST = Node_Which.CONST}
618
+ static __initStatic16() {this.ANNOTATION = Node_Which.ANNOTATION}
619
+ static __initStatic17() {this.Parameter = Node_Parameter}
620
+ static __initStatic18() {this.NestedNode = Node_NestedNode}
621
+ static __initStatic19() {this.SourceInfo = Node_SourceInfo}
622
+ static __initStatic20() {this._capnp = {
623
+ displayName: "Node",
624
+ id: "e682ab4cf923a417",
625
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(40, 6)
626
+ }}
627
+
628
+
629
+
630
+ get id() {
631
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
632
+ }
633
+ set id(value) {
634
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
635
+ }
636
+ /**
637
+ * Name to present to humans to identify this Node. You should not attempt to parse this. Its
638
+ * format could change. It is not guaranteed to be unique.
639
+ *
640
+ * (On Zooko's triangle, this is the node's nickname.)
641
+ *
642
+ */
643
+ get displayName() {
644
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
645
+ }
646
+ set displayName(value) {
647
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
648
+ }
649
+ /**
650
+ * If you want a shorter version of `displayName` (just naming this node, without its surrounding
651
+ * scope), chop off this many characters from the beginning of `displayName`.
652
+ *
653
+ */
654
+ get displayNamePrefixLength() {
655
+ return _chunkKXWOF6H4cjs.getUint32.call(void 0, 8, this);
656
+ }
657
+ set displayNamePrefixLength(value) {
658
+ _chunkKXWOF6H4cjs.setUint32.call(void 0, 8, value, this);
659
+ }
660
+ /**
661
+ * ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back
662
+ * at this node, but robust code should avoid relying on this (and, in fact, group nodes are not
663
+ * listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is
664
+ * zero if the node has no parent, which is normally only the case with files, but should be
665
+ * allowed for any kind of node (in order to make runtime type generation easier).
666
+ *
667
+ */
668
+ get scopeId() {
669
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 16, this);
670
+ }
671
+ set scopeId(value) {
672
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 16, value, this);
673
+ }
674
+ _adoptParameters(value) {
675
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 5, this));
676
+ }
677
+ _disownParameters() {
678
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.parameters);
679
+ }
680
+ /**
681
+ * If this node is parameterized (generic), the list of parameters. Empty for non-generic types.
682
+ *
683
+ */
684
+ get parameters() {
685
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 5, _Node._Parameters, this);
686
+ }
687
+ _hasParameters() {
688
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 5, this));
689
+ }
690
+ _initParameters(length) {
691
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 5, _Node._Parameters, length, this);
692
+ }
693
+ set parameters(value) {
694
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 5, this));
695
+ }
696
+ /**
697
+ * True if this node is generic, meaning that it or one of its parent scopes has a non-empty
698
+ * `parameters`.
699
+ *
700
+ */
701
+ get isGeneric() {
702
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 288, this);
703
+ }
704
+ set isGeneric(value) {
705
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 288, value, this);
706
+ }
707
+ _adoptNestedNodes(value) {
708
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
709
+ }
710
+ _disownNestedNodes() {
711
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.nestedNodes);
712
+ }
713
+ /**
714
+ * List of nodes nested within this node, along with the names under which they were declared.
715
+ *
716
+ */
717
+ get nestedNodes() {
718
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _Node._NestedNodes, this);
719
+ }
720
+ _hasNestedNodes() {
721
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
722
+ }
723
+ _initNestedNodes(length) {
724
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _Node._NestedNodes, length, this);
725
+ }
726
+ set nestedNodes(value) {
727
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
728
+ }
729
+ _adoptAnnotations(value) {
730
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
731
+ }
732
+ _disownAnnotations() {
733
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.annotations);
734
+ }
735
+ /**
736
+ * Annotations applied to this node.
737
+ *
738
+ */
739
+ get annotations() {
740
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 2, _Node._Annotations, this);
741
+ }
742
+ _hasAnnotations() {
743
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
744
+ }
745
+ _initAnnotations(length) {
746
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 2, _Node._Annotations, length, this);
747
+ }
748
+ set annotations(value) {
749
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
750
+ }
751
+ get _isFile() {
752
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 0;
753
+ }
754
+ set file(_) {
755
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 0, this);
756
+ }
757
+ get struct() {
758
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "struct", _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this), 1, this);
759
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Struct, this);
760
+ }
761
+ _initStruct() {
762
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 1, this);
763
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Struct, this);
764
+ }
765
+ get _isStruct() {
766
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 1;
767
+ }
768
+ set struct(_) {
769
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 1, this);
770
+ }
771
+ get enum() {
772
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "enum", _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this), 2, this);
773
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Enum, this);
774
+ }
775
+ _initEnum() {
776
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 2, this);
777
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Enum, this);
778
+ }
779
+ get _isEnum() {
780
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 2;
781
+ }
782
+ set enum(_) {
783
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 2, this);
784
+ }
785
+ get interface() {
786
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "interface", _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this), 3, this);
787
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Interface, this);
788
+ }
789
+ _initInterface() {
790
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 3, this);
791
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Interface, this);
792
+ }
793
+ get _isInterface() {
794
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 3;
795
+ }
796
+ set interface(_) {
797
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 3, this);
798
+ }
799
+ get const() {
800
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "const", _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this), 4, this);
801
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Const, this);
802
+ }
803
+ _initConst() {
804
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 4, this);
805
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Const, this);
806
+ }
807
+ get _isConst() {
808
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 4;
809
+ }
810
+ set const(_) {
811
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 4, this);
812
+ }
813
+ get annotation() {
814
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "annotation", _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this), 5, this);
815
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Annotation, this);
816
+ }
817
+ _initAnnotation() {
818
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 5, this);
819
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Node_Annotation, this);
820
+ }
821
+ get _isAnnotation() {
822
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this) === 5;
823
+ }
824
+ set annotation(_) {
825
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, 5, this);
826
+ }
827
+ toString() {
828
+ return "Node_" + super.toString();
829
+ }
830
+ which() {
831
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this);
832
+ }
833
+ }, _class10.__initStatic11(), _class10.__initStatic12(), _class10.__initStatic13(), _class10.__initStatic14(), _class10.__initStatic15(), _class10.__initStatic16(), _class10.__initStatic17(), _class10.__initStatic18(), _class10.__initStatic19(), _class10.__initStatic20(), _class10);
834
+ var Field_Slot = (_class11 = class extends _chunkKXWOF6H4cjs.Struct {
835
+ static {
836
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Field_Slot");
837
+ }
838
+ static __initStatic21() {this._capnp = {
839
+ displayName: "slot",
840
+ id: "c42305476bb4746f",
841
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 4)
842
+ }}
843
+ /**
844
+ * Offset, in units of the field's size, from the beginning of the section in which the field
845
+ * resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the
846
+ * beginning of the data section.
847
+ *
848
+ */
849
+ get offset() {
850
+ return _chunkKXWOF6H4cjs.getUint32.call(void 0, 4, this);
851
+ }
852
+ set offset(value) {
853
+ _chunkKXWOF6H4cjs.setUint32.call(void 0, 4, value, this);
854
+ }
855
+ _adoptType(value) {
856
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
857
+ }
858
+ _disownType() {
859
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.type);
860
+ }
861
+ get type() {
862
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 2, Type, this);
863
+ }
864
+ _hasType() {
865
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
866
+ }
867
+ _initType() {
868
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 2, Type, this);
869
+ }
870
+ set type(value) {
871
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
872
+ }
873
+ _adoptDefaultValue(value) {
874
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
875
+ }
876
+ _disownDefaultValue() {
877
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.defaultValue);
878
+ }
879
+ get defaultValue() {
880
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 3, Value, this);
881
+ }
882
+ _hasDefaultValue() {
883
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
884
+ }
885
+ _initDefaultValue() {
886
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 3, Value, this);
887
+ }
888
+ set defaultValue(value) {
889
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
890
+ }
891
+ /**
892
+ * Whether the default value was specified explicitly. Non-explicit default values are always
893
+ * zero or empty values. Usually, whether the default value was explicit shouldn't matter.
894
+ * The main use case for this flag is for structs representing method parameters:
895
+ * explicitly-defaulted parameters may be allowed to be omitted when calling the method.
896
+ *
897
+ */
898
+ get hadExplicitDefault() {
899
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 128, this);
900
+ }
901
+ set hadExplicitDefault(value) {
902
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 128, value, this);
903
+ }
904
+ toString() {
905
+ return "Field_Slot_" + super.toString();
906
+ }
907
+ }, _class11.__initStatic21(), _class11);
908
+ var Field_Group = (_class12 = class extends _chunkKXWOF6H4cjs.Struct {
909
+ static {
910
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Field_Group");
911
+ }
912
+ static __initStatic22() {this._capnp = {
913
+ displayName: "group",
914
+ id: "cafccddb68db1d11",
915
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 4)
916
+ }}
917
+ /**
918
+ * The ID of the group's node.
919
+ *
920
+ */
921
+ get typeId() {
922
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 16, this);
923
+ }
924
+ set typeId(value) {
925
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 16, value, this);
926
+ }
927
+ toString() {
928
+ return "Field_Group_" + super.toString();
929
+ }
930
+ }, _class12.__initStatic22(), _class12);
931
+ var Field_Ordinal_Which = {
932
+ IMPLICIT: 0,
933
+ /**
934
+ * The original ordinal number given to the field. You probably should NOT use this; if you need
935
+ * a numeric identifier for a field, use its position within the field array for its scope.
936
+ * The ordinal is given here mainly just so that the original schema text can be reproduced given
937
+ * the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.
938
+ *
939
+ */
940
+ EXPLICIT: 1
941
+ };
942
+ var Field_Ordinal = (_class13 = class extends _chunkKXWOF6H4cjs.Struct {
943
+ static {
944
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Field_Ordinal");
945
+ }
946
+ static __initStatic23() {this.IMPLICIT = Field_Ordinal_Which.IMPLICIT}
947
+ static __initStatic24() {this.EXPLICIT = Field_Ordinal_Which.EXPLICIT}
948
+ static __initStatic25() {this._capnp = {
949
+ displayName: "ordinal",
950
+ id: "bb90d5c287870be6",
951
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 4)
952
+ }}
953
+ get _isImplicit() {
954
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 0;
955
+ }
956
+ set implicit(_) {
957
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 0, this);
958
+ }
959
+ /**
960
+ * The original ordinal number given to the field. You probably should NOT use this; if you need
961
+ * a numeric identifier for a field, use its position within the field array for its scope.
962
+ * The ordinal is given here mainly just so that the original schema text can be reproduced given
963
+ * the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.
964
+ *
965
+ */
966
+ get explicit() {
967
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "explicit", _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this), 1, this);
968
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 12, this);
969
+ }
970
+ get _isExplicit() {
971
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 1;
972
+ }
973
+ set explicit(value) {
974
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 1, this);
975
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 12, value, this);
976
+ }
977
+ toString() {
978
+ return "Field_Ordinal_" + super.toString();
979
+ }
980
+ which() {
981
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this);
982
+ }
983
+ }, _class13.__initStatic23(), _class13.__initStatic24(), _class13.__initStatic25(), _class13);
984
+ var Field_Which = {
985
+ SLOT: 0,
986
+ /**
987
+ * Indicates where this member appeared in the code, relative to other members.
988
+ * Code ordering may have semantic relevance -- programmers tend to place related fields
989
+ * together. So, using code ordering makes sense in human-readable formats where ordering is
990
+ * otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum
991
+ * value is count(members) - 1. Fields that are members of a union are only ordered relative to
992
+ * the other members of that union, so the maximum value there is count(union.members).
993
+ *
994
+ */
995
+ GROUP: 1
996
+ };
997
+ var Field = (_class14 = class _Field extends _chunkKXWOF6H4cjs.Struct {
998
+ static {
999
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Field");
1000
+ }
1001
+ static __initStatic26() {this.NO_DISCRIMINANT = 65535}
1002
+ static __initStatic27() {this.SLOT = Field_Which.SLOT}
1003
+ static __initStatic28() {this.GROUP = Field_Which.GROUP}
1004
+ static __initStatic29() {this._capnp = {
1005
+ displayName: "Field",
1006
+ id: "9aad50a41f4af45f",
1007
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 4),
1008
+ defaultDiscriminantValue: _chunkKXWOF6H4cjs.getUint16Mask.call(void 0, 65535)
1009
+ }}
1010
+
1011
+ get name() {
1012
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
1013
+ }
1014
+ set name(value) {
1015
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
1016
+ }
1017
+ /**
1018
+ * Indicates where this member appeared in the code, relative to other members.
1019
+ * Code ordering may have semantic relevance -- programmers tend to place related fields
1020
+ * together. So, using code ordering makes sense in human-readable formats where ordering is
1021
+ * otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum
1022
+ * value is count(members) - 1. Fields that are members of a union are only ordered relative to
1023
+ * the other members of that union, so the maximum value there is count(union.members).
1024
+ *
1025
+ */
1026
+ get codeOrder() {
1027
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
1028
+ }
1029
+ set codeOrder(value) {
1030
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, value, this);
1031
+ }
1032
+ _adoptAnnotations(value) {
1033
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1034
+ }
1035
+ _disownAnnotations() {
1036
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.annotations);
1037
+ }
1038
+ get annotations() {
1039
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _Field._Annotations, this);
1040
+ }
1041
+ _hasAnnotations() {
1042
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1043
+ }
1044
+ _initAnnotations(length) {
1045
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _Field._Annotations, length, this);
1046
+ }
1047
+ set annotations(value) {
1048
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1049
+ }
1050
+ /**
1051
+ * If the field is in a union, this is the value which the union's discriminant should take when
1052
+ * the field is active. If the field is not in a union, this is 0xffff.
1053
+ *
1054
+ */
1055
+ get discriminantValue() {
1056
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 2, this, _Field._capnp.defaultDiscriminantValue);
1057
+ }
1058
+ set discriminantValue(value) {
1059
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 2, value, this, _Field._capnp.defaultDiscriminantValue);
1060
+ }
1061
+ /**
1062
+ * A regular, non-group, non-fixed-list field.
1063
+ *
1064
+ */
1065
+ get slot() {
1066
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "slot", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 0, this);
1067
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Slot, this);
1068
+ }
1069
+ _initSlot() {
1070
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1071
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Slot, this);
1072
+ }
1073
+ get _isSlot() {
1074
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 0;
1075
+ }
1076
+ set slot(_) {
1077
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1078
+ }
1079
+ /**
1080
+ * A group.
1081
+ *
1082
+ */
1083
+ get group() {
1084
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "group", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 1, this);
1085
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Group, this);
1086
+ }
1087
+ _initGroup() {
1088
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 1, this);
1089
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Group, this);
1090
+ }
1091
+ get _isGroup() {
1092
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 1;
1093
+ }
1094
+ set group(_) {
1095
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 1, this);
1096
+ }
1097
+ get ordinal() {
1098
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Ordinal, this);
1099
+ }
1100
+ _initOrdinal() {
1101
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Field_Ordinal, this);
1102
+ }
1103
+ toString() {
1104
+ return "Field_" + super.toString();
1105
+ }
1106
+ which() {
1107
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this);
1108
+ }
1109
+ }, _class14.__initStatic26(), _class14.__initStatic27(), _class14.__initStatic28(), _class14.__initStatic29(), _class14);
1110
+ var Enumerant = (_class15 = class _Enumerant extends _chunkKXWOF6H4cjs.Struct {
1111
+ static {
1112
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Enumerant");
1113
+ }
1114
+ static __initStatic30() {this._capnp = {
1115
+ displayName: "Enumerant",
1116
+ id: "978a7cebdc549a4d",
1117
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 2)
1118
+ }}
1119
+
1120
+ get name() {
1121
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
1122
+ }
1123
+ set name(value) {
1124
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
1125
+ }
1126
+ /**
1127
+ * Specifies order in which the enumerants were declared in the code.
1128
+ * Like utils.Field.codeOrder.
1129
+ *
1130
+ */
1131
+ get codeOrder() {
1132
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
1133
+ }
1134
+ set codeOrder(value) {
1135
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, value, this);
1136
+ }
1137
+ _adoptAnnotations(value) {
1138
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1139
+ }
1140
+ _disownAnnotations() {
1141
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.annotations);
1142
+ }
1143
+ get annotations() {
1144
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _Enumerant._Annotations, this);
1145
+ }
1146
+ _hasAnnotations() {
1147
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1148
+ }
1149
+ _initAnnotations(length) {
1150
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _Enumerant._Annotations, length, this);
1151
+ }
1152
+ set annotations(value) {
1153
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1154
+ }
1155
+ toString() {
1156
+ return "Enumerant_" + super.toString();
1157
+ }
1158
+ }, _class15.__initStatic30(), _class15);
1159
+ var Superclass = (_class16 = class extends _chunkKXWOF6H4cjs.Struct {
1160
+ static {
1161
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Superclass");
1162
+ }
1163
+ static __initStatic31() {this._capnp = {
1164
+ displayName: "Superclass",
1165
+ id: "a9962a9ed0a4d7f8",
1166
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 1)
1167
+ }}
1168
+ get id() {
1169
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
1170
+ }
1171
+ set id(value) {
1172
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
1173
+ }
1174
+ _adoptBrand(value) {
1175
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1176
+ }
1177
+ _disownBrand() {
1178
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.brand);
1179
+ }
1180
+ get brand() {
1181
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Brand, this);
1182
+ }
1183
+ _hasBrand() {
1184
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1185
+ }
1186
+ _initBrand() {
1187
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Brand, this);
1188
+ }
1189
+ set brand(value) {
1190
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1191
+ }
1192
+ toString() {
1193
+ return "Superclass_" + super.toString();
1194
+ }
1195
+ }, _class16.__initStatic31(), _class16);
1196
+ var Method = (_class17 = class _Method extends _chunkKXWOF6H4cjs.Struct {
1197
+ static {
1198
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Method");
1199
+ }
1200
+ static __initStatic32() {this._capnp = {
1201
+ displayName: "Method",
1202
+ id: "9500cce23b334d80",
1203
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 5)
1204
+ }}
1205
+
1206
+
1207
+ get name() {
1208
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
1209
+ }
1210
+ set name(value) {
1211
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
1212
+ }
1213
+ /**
1214
+ * Specifies order in which the methods were declared in the code.
1215
+ * Like utils.Field.codeOrder.
1216
+ *
1217
+ */
1218
+ get codeOrder() {
1219
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
1220
+ }
1221
+ set codeOrder(value) {
1222
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, value, this);
1223
+ }
1224
+ _adoptImplicitParameters(value) {
1225
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
1226
+ }
1227
+ _disownImplicitParameters() {
1228
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.implicitParameters);
1229
+ }
1230
+ /**
1231
+ * The parameters listed in [] (typically, type / generic parameters), whose bindings are intended
1232
+ * to be inferred rather than specified explicitly, although not all languages support this.
1233
+ *
1234
+ */
1235
+ get implicitParameters() {
1236
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 4, _Method._ImplicitParameters, this);
1237
+ }
1238
+ _hasImplicitParameters() {
1239
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
1240
+ }
1241
+ _initImplicitParameters(length) {
1242
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 4, _Method._ImplicitParameters, length, this);
1243
+ }
1244
+ set implicitParameters(value) {
1245
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 4, this));
1246
+ }
1247
+ /**
1248
+ * ID of the parameter struct type. If a named parameter list was specified in the method
1249
+ * declaration (rather than a single struct parameter type) then a corresponding struct type is
1250
+ * auto-generated. Such an auto-generated type will not be listed in the interface's
1251
+ * `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.
1252
+ * (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes
1253
+ * this a situation where you can't just climb the scope chain to find where a particular
1254
+ * generic parameter was introduced. Making the `scopeId` zero was a mistake.)
1255
+ *
1256
+ */
1257
+ get paramStructType() {
1258
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 8, this);
1259
+ }
1260
+ set paramStructType(value) {
1261
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 8, value, this);
1262
+ }
1263
+ _adoptParamBrand(value) {
1264
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
1265
+ }
1266
+ _disownParamBrand() {
1267
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.paramBrand);
1268
+ }
1269
+ /**
1270
+ * Brand of param struct type.
1271
+ *
1272
+ */
1273
+ get paramBrand() {
1274
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 2, Brand, this);
1275
+ }
1276
+ _hasParamBrand() {
1277
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
1278
+ }
1279
+ _initParamBrand() {
1280
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 2, Brand, this);
1281
+ }
1282
+ set paramBrand(value) {
1283
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
1284
+ }
1285
+ /**
1286
+ * ID of the return struct type; similar to `paramStructType`.
1287
+ *
1288
+ */
1289
+ get resultStructType() {
1290
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 16, this);
1291
+ }
1292
+ set resultStructType(value) {
1293
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 16, value, this);
1294
+ }
1295
+ _adoptResultBrand(value) {
1296
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
1297
+ }
1298
+ _disownResultBrand() {
1299
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.resultBrand);
1300
+ }
1301
+ /**
1302
+ * Brand of result struct type.
1303
+ *
1304
+ */
1305
+ get resultBrand() {
1306
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 3, Brand, this);
1307
+ }
1308
+ _hasResultBrand() {
1309
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
1310
+ }
1311
+ _initResultBrand() {
1312
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 3, Brand, this);
1313
+ }
1314
+ set resultBrand(value) {
1315
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
1316
+ }
1317
+ _adoptAnnotations(value) {
1318
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1319
+ }
1320
+ _disownAnnotations() {
1321
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.annotations);
1322
+ }
1323
+ get annotations() {
1324
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _Method._Annotations, this);
1325
+ }
1326
+ _hasAnnotations() {
1327
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1328
+ }
1329
+ _initAnnotations(length) {
1330
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _Method._Annotations, length, this);
1331
+ }
1332
+ set annotations(value) {
1333
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
1334
+ }
1335
+ toString() {
1336
+ return "Method_" + super.toString();
1337
+ }
1338
+ }, _class17.__initStatic32(), _class17);
1339
+ var Type_List = (_class18 = class extends _chunkKXWOF6H4cjs.Struct {
1340
+ static {
1341
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_List");
1342
+ }
1343
+ static __initStatic33() {this._capnp = {
1344
+ displayName: "list",
1345
+ id: "87e739250a60ea97",
1346
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1347
+ }}
1348
+ _adoptElementType(value) {
1349
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1350
+ }
1351
+ _disownElementType() {
1352
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.elementType);
1353
+ }
1354
+ get elementType() {
1355
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Type, this);
1356
+ }
1357
+ _hasElementType() {
1358
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1359
+ }
1360
+ _initElementType() {
1361
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Type, this);
1362
+ }
1363
+ set elementType(value) {
1364
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1365
+ }
1366
+ toString() {
1367
+ return "Type_List_" + super.toString();
1368
+ }
1369
+ }, _class18.__initStatic33(), _class18);
1370
+ var Type_Enum = (_class19 = class extends _chunkKXWOF6H4cjs.Struct {
1371
+ static {
1372
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_Enum");
1373
+ }
1374
+ static __initStatic34() {this._capnp = {
1375
+ displayName: "enum",
1376
+ id: "9e0e78711a7f87a9",
1377
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1378
+ }}
1379
+ get typeId() {
1380
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 8, this);
1381
+ }
1382
+ set typeId(value) {
1383
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 8, value, this);
1384
+ }
1385
+ _adoptBrand(value) {
1386
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1387
+ }
1388
+ _disownBrand() {
1389
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.brand);
1390
+ }
1391
+ get brand() {
1392
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Brand, this);
1393
+ }
1394
+ _hasBrand() {
1395
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1396
+ }
1397
+ _initBrand() {
1398
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Brand, this);
1399
+ }
1400
+ set brand(value) {
1401
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1402
+ }
1403
+ toString() {
1404
+ return "Type_Enum_" + super.toString();
1405
+ }
1406
+ }, _class19.__initStatic34(), _class19);
1407
+ var Type_Struct = (_class20 = class extends _chunkKXWOF6H4cjs.Struct {
1408
+ static {
1409
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_Struct");
1410
+ }
1411
+ static __initStatic35() {this._capnp = {
1412
+ displayName: "struct",
1413
+ id: "ac3a6f60ef4cc6d3",
1414
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1415
+ }}
1416
+ get typeId() {
1417
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 8, this);
1418
+ }
1419
+ set typeId(value) {
1420
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 8, value, this);
1421
+ }
1422
+ _adoptBrand(value) {
1423
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1424
+ }
1425
+ _disownBrand() {
1426
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.brand);
1427
+ }
1428
+ get brand() {
1429
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Brand, this);
1430
+ }
1431
+ _hasBrand() {
1432
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1433
+ }
1434
+ _initBrand() {
1435
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Brand, this);
1436
+ }
1437
+ set brand(value) {
1438
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1439
+ }
1440
+ toString() {
1441
+ return "Type_Struct_" + super.toString();
1442
+ }
1443
+ }, _class20.__initStatic35(), _class20);
1444
+ var Type_Interface = (_class21 = class extends _chunkKXWOF6H4cjs.Struct {
1445
+ static {
1446
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_Interface");
1447
+ }
1448
+ static __initStatic36() {this._capnp = {
1449
+ displayName: "interface",
1450
+ id: "ed8bca69f7fb0cbf",
1451
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1452
+ }}
1453
+ get typeId() {
1454
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 8, this);
1455
+ }
1456
+ set typeId(value) {
1457
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 8, value, this);
1458
+ }
1459
+ _adoptBrand(value) {
1460
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1461
+ }
1462
+ _disownBrand() {
1463
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.brand);
1464
+ }
1465
+ get brand() {
1466
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Brand, this);
1467
+ }
1468
+ _hasBrand() {
1469
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1470
+ }
1471
+ _initBrand() {
1472
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Brand, this);
1473
+ }
1474
+ set brand(value) {
1475
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1476
+ }
1477
+ toString() {
1478
+ return "Type_Interface_" + super.toString();
1479
+ }
1480
+ }, _class21.__initStatic36(), _class21);
1481
+ var Type_AnyPointer_Unconstrained_Which = {
1482
+ /**
1483
+ * truly AnyPointer
1484
+ *
1485
+ */
1486
+ ANY_KIND: 0,
1487
+ /**
1488
+ * AnyStruct
1489
+ *
1490
+ */
1491
+ STRUCT: 1,
1492
+ /**
1493
+ * AnyList
1494
+ *
1495
+ */
1496
+ LIST: 2,
1497
+ /**
1498
+ * Capability
1499
+ *
1500
+ */
1501
+ CAPABILITY: 3
1502
+ };
1503
+ var Type_AnyPointer_Unconstrained = (_class22 = class extends _chunkKXWOF6H4cjs.Struct {
1504
+ static {
1505
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_AnyPointer_Unconstrained");
1506
+ }
1507
+ static __initStatic37() {this.ANY_KIND = Type_AnyPointer_Unconstrained_Which.ANY_KIND}
1508
+ static __initStatic38() {this.STRUCT = Type_AnyPointer_Unconstrained_Which.STRUCT}
1509
+ static __initStatic39() {this.LIST = Type_AnyPointer_Unconstrained_Which.LIST}
1510
+ static __initStatic40() {this.CAPABILITY = Type_AnyPointer_Unconstrained_Which.CAPABILITY}
1511
+ static __initStatic41() {this._capnp = {
1512
+ displayName: "unconstrained",
1513
+ id: "8e3b5f79fe593656",
1514
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1515
+ }}
1516
+ get _isAnyKind() {
1517
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 0;
1518
+ }
1519
+ set anyKind(_) {
1520
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 0, this);
1521
+ }
1522
+ get _isStruct() {
1523
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 1;
1524
+ }
1525
+ set struct(_) {
1526
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 1, this);
1527
+ }
1528
+ get _isList() {
1529
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 2;
1530
+ }
1531
+ set list(_) {
1532
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 2, this);
1533
+ }
1534
+ get _isCapability() {
1535
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this) === 3;
1536
+ }
1537
+ set capability(_) {
1538
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, 3, this);
1539
+ }
1540
+ toString() {
1541
+ return "Type_AnyPointer_Unconstrained_" + super.toString();
1542
+ }
1543
+ which() {
1544
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this);
1545
+ }
1546
+ }, _class22.__initStatic37(), _class22.__initStatic38(), _class22.__initStatic39(), _class22.__initStatic40(), _class22.__initStatic41(), _class22);
1547
+ var Type_AnyPointer_Parameter = (_class23 = class extends _chunkKXWOF6H4cjs.Struct {
1548
+ static {
1549
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_AnyPointer_Parameter");
1550
+ }
1551
+ static __initStatic42() {this._capnp = {
1552
+ displayName: "parameter",
1553
+ id: "9dd1f724f4614a85",
1554
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1555
+ }}
1556
+ /**
1557
+ * ID of the generic type whose parameter we're referencing. This should be a parent of the
1558
+ * current scope.
1559
+ *
1560
+ */
1561
+ get scopeId() {
1562
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 16, this);
1563
+ }
1564
+ set scopeId(value) {
1565
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 16, value, this);
1566
+ }
1567
+ /**
1568
+ * Index of the parameter within the generic type's parameter list.
1569
+ *
1570
+ */
1571
+ get parameterIndex() {
1572
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this);
1573
+ }
1574
+ set parameterIndex(value) {
1575
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, value, this);
1576
+ }
1577
+ toString() {
1578
+ return "Type_AnyPointer_Parameter_" + super.toString();
1579
+ }
1580
+ }, _class23.__initStatic42(), _class23);
1581
+ var Type_AnyPointer_ImplicitMethodParameter = (_class24 = class extends _chunkKXWOF6H4cjs.Struct {
1582
+ static {
1583
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_AnyPointer_ImplicitMethodParameter");
1584
+ }
1585
+ static __initStatic43() {this._capnp = {
1586
+ displayName: "implicitMethodParameter",
1587
+ id: "baefc9120c56e274",
1588
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1589
+ }}
1590
+ get parameterIndex() {
1591
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 10, this);
1592
+ }
1593
+ set parameterIndex(value) {
1594
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 10, value, this);
1595
+ }
1596
+ toString() {
1597
+ return "Type_AnyPointer_ImplicitMethodParameter_" + super.toString();
1598
+ }
1599
+ }, _class24.__initStatic43(), _class24);
1600
+ var Type_AnyPointer_Which = {
1601
+ /**
1602
+ * A regular AnyPointer.
1603
+ *
1604
+ * The name "unconstrained" means as opposed to constraining it to match a type parameter.
1605
+ * In retrospect this name is probably a poor choice given that it may still be constrained
1606
+ * to be a struct, list, or capability.
1607
+ *
1608
+ */
1609
+ UNCONSTRAINED: 0,
1610
+ /**
1611
+ * This is actually a reference to a type parameter defined within this scope.
1612
+ *
1613
+ */
1614
+ PARAMETER: 1,
1615
+ /**
1616
+ * This is actually a reference to an implicit (generic) parameter of a method. The only
1617
+ * legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.
1618
+ *
1619
+ */
1620
+ IMPLICIT_METHOD_PARAMETER: 2
1621
+ };
1622
+ var Type_AnyPointer = (_class25 = class extends _chunkKXWOF6H4cjs.Struct {
1623
+ static {
1624
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type_AnyPointer");
1625
+ }
1626
+ static __initStatic44() {this.UNCONSTRAINED = Type_AnyPointer_Which.UNCONSTRAINED}
1627
+ static __initStatic45() {this.PARAMETER = Type_AnyPointer_Which.PARAMETER}
1628
+ static __initStatic46() {this.IMPLICIT_METHOD_PARAMETER = Type_AnyPointer_Which.IMPLICIT_METHOD_PARAMETER}
1629
+ static __initStatic47() {this._capnp = {
1630
+ displayName: "anyPointer",
1631
+ id: "c2573fe8a23e49f1",
1632
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1633
+ }}
1634
+ /**
1635
+ * A regular AnyPointer.
1636
+ *
1637
+ * The name "unconstrained" means as opposed to constraining it to match a type parameter.
1638
+ * In retrospect this name is probably a poor choice given that it may still be constrained
1639
+ * to be a struct, list, or capability.
1640
+ *
1641
+ */
1642
+ get unconstrained() {
1643
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "unconstrained", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 0, this);
1644
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_Unconstrained, this);
1645
+ }
1646
+ _initUnconstrained() {
1647
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1648
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_Unconstrained, this);
1649
+ }
1650
+ get _isUnconstrained() {
1651
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 0;
1652
+ }
1653
+ set unconstrained(_) {
1654
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1655
+ }
1656
+ /**
1657
+ * This is actually a reference to a type parameter defined within this scope.
1658
+ *
1659
+ */
1660
+ get parameter() {
1661
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "parameter", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 1, this);
1662
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_Parameter, this);
1663
+ }
1664
+ _initParameter() {
1665
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 1, this);
1666
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_Parameter, this);
1667
+ }
1668
+ get _isParameter() {
1669
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 1;
1670
+ }
1671
+ set parameter(_) {
1672
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 1, this);
1673
+ }
1674
+ /**
1675
+ * This is actually a reference to an implicit (generic) parameter of a method. The only
1676
+ * legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.
1677
+ *
1678
+ */
1679
+ get implicitMethodParameter() {
1680
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "implicitMethodParameter", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 2, this);
1681
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_ImplicitMethodParameter, this);
1682
+ }
1683
+ _initImplicitMethodParameter() {
1684
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 2, this);
1685
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer_ImplicitMethodParameter, this);
1686
+ }
1687
+ get _isImplicitMethodParameter() {
1688
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 2;
1689
+ }
1690
+ set implicitMethodParameter(_) {
1691
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 2, this);
1692
+ }
1693
+ toString() {
1694
+ return "Type_AnyPointer_" + super.toString();
1695
+ }
1696
+ which() {
1697
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this);
1698
+ }
1699
+ }, _class25.__initStatic44(), _class25.__initStatic45(), _class25.__initStatic46(), _class25.__initStatic47(), _class25);
1700
+ var Type_Which = {
1701
+ VOID: 0,
1702
+ BOOL: 1,
1703
+ INT8: 2,
1704
+ INT16: 3,
1705
+ INT32: 4,
1706
+ INT64: 5,
1707
+ UINT8: 6,
1708
+ UINT16: 7,
1709
+ UINT32: 8,
1710
+ UINT64: 9,
1711
+ FLOAT32: 10,
1712
+ FLOAT64: 11,
1713
+ TEXT: 12,
1714
+ DATA: 13,
1715
+ LIST: 14,
1716
+ ENUM: 15,
1717
+ STRUCT: 16,
1718
+ INTERFACE: 17,
1719
+ ANY_POINTER: 18
1720
+ };
1721
+ var Type = (_class26 = class extends _chunkKXWOF6H4cjs.Struct {
1722
+ static {
1723
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Type");
1724
+ }
1725
+ static __initStatic48() {this.VOID = Type_Which.VOID}
1726
+ static __initStatic49() {this.BOOL = Type_Which.BOOL}
1727
+ static __initStatic50() {this.INT8 = Type_Which.INT8}
1728
+ static __initStatic51() {this.INT16 = Type_Which.INT16}
1729
+ static __initStatic52() {this.INT32 = Type_Which.INT32}
1730
+ static __initStatic53() {this.INT64 = Type_Which.INT64}
1731
+ static __initStatic54() {this.UINT8 = Type_Which.UINT8}
1732
+ static __initStatic55() {this.UINT16 = Type_Which.UINT16}
1733
+ static __initStatic56() {this.UINT32 = Type_Which.UINT32}
1734
+ static __initStatic57() {this.UINT64 = Type_Which.UINT64}
1735
+ static __initStatic58() {this.FLOAT32 = Type_Which.FLOAT32}
1736
+ static __initStatic59() {this.FLOAT64 = Type_Which.FLOAT64}
1737
+ static __initStatic60() {this.TEXT = Type_Which.TEXT}
1738
+ static __initStatic61() {this.DATA = Type_Which.DATA}
1739
+ static __initStatic62() {this.LIST = Type_Which.LIST}
1740
+ static __initStatic63() {this.ENUM = Type_Which.ENUM}
1741
+ static __initStatic64() {this.STRUCT = Type_Which.STRUCT}
1742
+ static __initStatic65() {this.INTERFACE = Type_Which.INTERFACE}
1743
+ static __initStatic66() {this.ANY_POINTER = Type_Which.ANY_POINTER}
1744
+ static __initStatic67() {this._capnp = {
1745
+ displayName: "Type",
1746
+ id: "d07378ede1f9cc60",
1747
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(24, 1)
1748
+ }}
1749
+ get _isVoid() {
1750
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 0;
1751
+ }
1752
+ set void(_) {
1753
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 0, this);
1754
+ }
1755
+ get _isBool() {
1756
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 1;
1757
+ }
1758
+ set bool(_) {
1759
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 1, this);
1760
+ }
1761
+ get _isInt8() {
1762
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 2;
1763
+ }
1764
+ set int8(_) {
1765
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 2, this);
1766
+ }
1767
+ get _isInt16() {
1768
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 3;
1769
+ }
1770
+ set int16(_) {
1771
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 3, this);
1772
+ }
1773
+ get _isInt32() {
1774
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 4;
1775
+ }
1776
+ set int32(_) {
1777
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 4, this);
1778
+ }
1779
+ get _isInt64() {
1780
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 5;
1781
+ }
1782
+ set int64(_) {
1783
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 5, this);
1784
+ }
1785
+ get _isUint8() {
1786
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 6;
1787
+ }
1788
+ set uint8(_) {
1789
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 6, this);
1790
+ }
1791
+ get _isUint16() {
1792
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 7;
1793
+ }
1794
+ set uint16(_) {
1795
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 7, this);
1796
+ }
1797
+ get _isUint32() {
1798
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 8;
1799
+ }
1800
+ set uint32(_) {
1801
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 8, this);
1802
+ }
1803
+ get _isUint64() {
1804
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 9;
1805
+ }
1806
+ set uint64(_) {
1807
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 9, this);
1808
+ }
1809
+ get _isFloat32() {
1810
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 10;
1811
+ }
1812
+ set float32(_) {
1813
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 10, this);
1814
+ }
1815
+ get _isFloat64() {
1816
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 11;
1817
+ }
1818
+ set float64(_) {
1819
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 11, this);
1820
+ }
1821
+ get _isText() {
1822
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 12;
1823
+ }
1824
+ set text(_) {
1825
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 12, this);
1826
+ }
1827
+ get _isData() {
1828
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 13;
1829
+ }
1830
+ set data(_) {
1831
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 13, this);
1832
+ }
1833
+ get list() {
1834
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "list", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 14, this);
1835
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_List, this);
1836
+ }
1837
+ _initList() {
1838
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 14, this);
1839
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_List, this);
1840
+ }
1841
+ get _isList() {
1842
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 14;
1843
+ }
1844
+ set list(_) {
1845
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 14, this);
1846
+ }
1847
+ get enum() {
1848
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "enum", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 15, this);
1849
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Enum, this);
1850
+ }
1851
+ _initEnum() {
1852
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 15, this);
1853
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Enum, this);
1854
+ }
1855
+ get _isEnum() {
1856
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 15;
1857
+ }
1858
+ set enum(_) {
1859
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 15, this);
1860
+ }
1861
+ get struct() {
1862
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "struct", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 16, this);
1863
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Struct, this);
1864
+ }
1865
+ _initStruct() {
1866
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 16, this);
1867
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Struct, this);
1868
+ }
1869
+ get _isStruct() {
1870
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 16;
1871
+ }
1872
+ set struct(_) {
1873
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 16, this);
1874
+ }
1875
+ get interface() {
1876
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "interface", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 17, this);
1877
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Interface, this);
1878
+ }
1879
+ _initInterface() {
1880
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 17, this);
1881
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_Interface, this);
1882
+ }
1883
+ get _isInterface() {
1884
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 17;
1885
+ }
1886
+ set interface(_) {
1887
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 17, this);
1888
+ }
1889
+ get anyPointer() {
1890
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "anyPointer", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 18, this);
1891
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer, this);
1892
+ }
1893
+ _initAnyPointer() {
1894
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 18, this);
1895
+ return _chunkKXWOF6H4cjs.getAs.call(void 0, Type_AnyPointer, this);
1896
+ }
1897
+ get _isAnyPointer() {
1898
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 18;
1899
+ }
1900
+ set anyPointer(_) {
1901
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 18, this);
1902
+ }
1903
+ toString() {
1904
+ return "Type_" + super.toString();
1905
+ }
1906
+ which() {
1907
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
1908
+ }
1909
+ }, _class26.__initStatic48(), _class26.__initStatic49(), _class26.__initStatic50(), _class26.__initStatic51(), _class26.__initStatic52(), _class26.__initStatic53(), _class26.__initStatic54(), _class26.__initStatic55(), _class26.__initStatic56(), _class26.__initStatic57(), _class26.__initStatic58(), _class26.__initStatic59(), _class26.__initStatic60(), _class26.__initStatic61(), _class26.__initStatic62(), _class26.__initStatic63(), _class26.__initStatic64(), _class26.__initStatic65(), _class26.__initStatic66(), _class26.__initStatic67(), _class26);
1910
+ var Brand_Scope_Which = {
1911
+ /**
1912
+ * ID of the scope to which these params apply.
1913
+ *
1914
+ */
1915
+ BIND: 0,
1916
+ /**
1917
+ * List of parameter bindings.
1918
+ *
1919
+ */
1920
+ INHERIT: 1
1921
+ };
1922
+ var Brand_Scope = (_class27 = class _Brand_Scope extends _chunkKXWOF6H4cjs.Struct {
1923
+ static {
1924
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Brand_Scope");
1925
+ }
1926
+ static __initStatic68() {this.BIND = Brand_Scope_Which.BIND}
1927
+ static __initStatic69() {this.INHERIT = Brand_Scope_Which.INHERIT}
1928
+ static __initStatic70() {this._capnp = {
1929
+ displayName: "Scope",
1930
+ id: "abd73485a9636bc9",
1931
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(16, 1)
1932
+ }}
1933
+
1934
+ /**
1935
+ * ID of the scope to which these params apply.
1936
+ *
1937
+ */
1938
+ get scopeId() {
1939
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
1940
+ }
1941
+ set scopeId(value) {
1942
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
1943
+ }
1944
+ _adoptBind(value) {
1945
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1946
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1947
+ }
1948
+ _disownBind() {
1949
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.bind);
1950
+ }
1951
+ /**
1952
+ * List of parameter bindings.
1953
+ *
1954
+ */
1955
+ get bind() {
1956
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "bind", _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this), 0, this);
1957
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 0, _Brand_Scope._Bind, this);
1958
+ }
1959
+ _hasBind() {
1960
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1961
+ }
1962
+ _initBind(length) {
1963
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1964
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 0, _Brand_Scope._Bind, length, this);
1965
+ }
1966
+ get _isBind() {
1967
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 0;
1968
+ }
1969
+ set bind(value) {
1970
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 0, this);
1971
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
1972
+ }
1973
+ get _isInherit() {
1974
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this) === 1;
1975
+ }
1976
+ set inherit(_) {
1977
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 8, 1, this);
1978
+ }
1979
+ toString() {
1980
+ return "Brand_Scope_" + super.toString();
1981
+ }
1982
+ which() {
1983
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 8, this);
1984
+ }
1985
+ }, _class27.__initStatic68(), _class27.__initStatic69(), _class27.__initStatic70(), _class27);
1986
+ var Brand_Binding_Which = {
1987
+ UNBOUND: 0,
1988
+ TYPE: 1
1989
+ };
1990
+ var Brand_Binding = (_class28 = class extends _chunkKXWOF6H4cjs.Struct {
1991
+ static {
1992
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Brand_Binding");
1993
+ }
1994
+ static __initStatic71() {this.UNBOUND = Brand_Binding_Which.UNBOUND}
1995
+ static __initStatic72() {this.TYPE = Brand_Binding_Which.TYPE}
1996
+ static __initStatic73() {this._capnp = {
1997
+ displayName: "Binding",
1998
+ id: "c863cd16969ee7fc",
1999
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 1)
2000
+ }}
2001
+ get _isUnbound() {
2002
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 0;
2003
+ }
2004
+ set unbound(_) {
2005
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 0, this);
2006
+ }
2007
+ _adoptType(value) {
2008
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 1, this);
2009
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2010
+ }
2011
+ _disownType() {
2012
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.type);
2013
+ }
2014
+ get type() {
2015
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "type", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 1, this);
2016
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Type, this);
2017
+ }
2018
+ _hasType() {
2019
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2020
+ }
2021
+ _initType() {
2022
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 1, this);
2023
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Type, this);
2024
+ }
2025
+ get _isType() {
2026
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 1;
2027
+ }
2028
+ set type(value) {
2029
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 1, this);
2030
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2031
+ }
2032
+ toString() {
2033
+ return "Brand_Binding_" + super.toString();
2034
+ }
2035
+ which() {
2036
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
2037
+ }
2038
+ }, _class28.__initStatic71(), _class28.__initStatic72(), _class28.__initStatic73(), _class28);
2039
+ var Brand = (_class29 = class _Brand extends _chunkKXWOF6H4cjs.Struct {
2040
+ static {
2041
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Brand");
2042
+ }
2043
+ static __initStatic74() {this.Scope = Brand_Scope}
2044
+ static __initStatic75() {this.Binding = Brand_Binding}
2045
+ static __initStatic76() {this._capnp = {
2046
+ displayName: "Brand",
2047
+ id: "903455f06065422b",
2048
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(0, 1)
2049
+ }}
2050
+
2051
+ _adoptScopes(value) {
2052
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2053
+ }
2054
+ _disownScopes() {
2055
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.scopes);
2056
+ }
2057
+ /**
2058
+ * For each of the target type and each of its parent scopes, a parameterization may be included
2059
+ * in this list. If no parameterization is included for a particular relevant scope, then either
2060
+ * that scope has no parameters or all parameters should be considered to be `AnyPointer`.
2061
+ *
2062
+ */
2063
+ get scopes() {
2064
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 0, _Brand._Scopes, this);
2065
+ }
2066
+ _hasScopes() {
2067
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2068
+ }
2069
+ _initScopes(length) {
2070
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 0, _Brand._Scopes, length, this);
2071
+ }
2072
+ set scopes(value) {
2073
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2074
+ }
2075
+ toString() {
2076
+ return "Brand_" + super.toString();
2077
+ }
2078
+ }, _class29.__initStatic74(), _class29.__initStatic75(), _class29.__initStatic76(), _class29);
2079
+ var Value_Which = {
2080
+ VOID: 0,
2081
+ BOOL: 1,
2082
+ INT8: 2,
2083
+ INT16: 3,
2084
+ INT32: 4,
2085
+ INT64: 5,
2086
+ UINT8: 6,
2087
+ UINT16: 7,
2088
+ UINT32: 8,
2089
+ UINT64: 9,
2090
+ FLOAT32: 10,
2091
+ FLOAT64: 11,
2092
+ TEXT: 12,
2093
+ DATA: 13,
2094
+ LIST: 14,
2095
+ ENUM: 15,
2096
+ STRUCT: 16,
2097
+ /**
2098
+ * The only interface value that can be represented statically is "null", whose methods always
2099
+ * throw exceptions.
2100
+ *
2101
+ */
2102
+ INTERFACE: 17,
2103
+ ANY_POINTER: 18
2104
+ };
2105
+ var Value = (_class30 = class extends _chunkKXWOF6H4cjs.Struct {
2106
+ static {
2107
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Value");
2108
+ }
2109
+ static __initStatic77() {this.VOID = Value_Which.VOID}
2110
+ static __initStatic78() {this.BOOL = Value_Which.BOOL}
2111
+ static __initStatic79() {this.INT8 = Value_Which.INT8}
2112
+ static __initStatic80() {this.INT16 = Value_Which.INT16}
2113
+ static __initStatic81() {this.INT32 = Value_Which.INT32}
2114
+ static __initStatic82() {this.INT64 = Value_Which.INT64}
2115
+ static __initStatic83() {this.UINT8 = Value_Which.UINT8}
2116
+ static __initStatic84() {this.UINT16 = Value_Which.UINT16}
2117
+ static __initStatic85() {this.UINT32 = Value_Which.UINT32}
2118
+ static __initStatic86() {this.UINT64 = Value_Which.UINT64}
2119
+ static __initStatic87() {this.FLOAT32 = Value_Which.FLOAT32}
2120
+ static __initStatic88() {this.FLOAT64 = Value_Which.FLOAT64}
2121
+ static __initStatic89() {this.TEXT = Value_Which.TEXT}
2122
+ static __initStatic90() {this.DATA = Value_Which.DATA}
2123
+ static __initStatic91() {this.LIST = Value_Which.LIST}
2124
+ static __initStatic92() {this.ENUM = Value_Which.ENUM}
2125
+ static __initStatic93() {this.STRUCT = Value_Which.STRUCT}
2126
+ static __initStatic94() {this.INTERFACE = Value_Which.INTERFACE}
2127
+ static __initStatic95() {this.ANY_POINTER = Value_Which.ANY_POINTER}
2128
+ static __initStatic96() {this._capnp = {
2129
+ displayName: "Value",
2130
+ id: "ce23dcd2d7b00c9b",
2131
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(16, 1)
2132
+ }}
2133
+ get _isVoid() {
2134
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 0;
2135
+ }
2136
+ set void(_) {
2137
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 0, this);
2138
+ }
2139
+ get bool() {
2140
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "bool", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 1, this);
2141
+ return _chunkKXWOF6H4cjs.getBit.call(void 0, 16, this);
2142
+ }
2143
+ get _isBool() {
2144
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 1;
2145
+ }
2146
+ set bool(value) {
2147
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 1, this);
2148
+ _chunkKXWOF6H4cjs.setBit.call(void 0, 16, value, this);
2149
+ }
2150
+ get int8() {
2151
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "int8", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 2, this);
2152
+ return _chunkKXWOF6H4cjs.getInt8.call(void 0, 2, this);
2153
+ }
2154
+ get _isInt8() {
2155
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 2;
2156
+ }
2157
+ set int8(value) {
2158
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 2, this);
2159
+ _chunkKXWOF6H4cjs.setInt8.call(void 0, 2, value, this);
2160
+ }
2161
+ get int16() {
2162
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "int16", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 3, this);
2163
+ return _chunkKXWOF6H4cjs.getInt16.call(void 0, 2, this);
2164
+ }
2165
+ get _isInt16() {
2166
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 3;
2167
+ }
2168
+ set int16(value) {
2169
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 3, this);
2170
+ _chunkKXWOF6H4cjs.setInt16.call(void 0, 2, value, this);
2171
+ }
2172
+ get int32() {
2173
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "int32", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 4, this);
2174
+ return _chunkKXWOF6H4cjs.getInt32.call(void 0, 4, this);
2175
+ }
2176
+ get _isInt32() {
2177
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 4;
2178
+ }
2179
+ set int32(value) {
2180
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 4, this);
2181
+ _chunkKXWOF6H4cjs.setInt32.call(void 0, 4, value, this);
2182
+ }
2183
+ get int64() {
2184
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "int64", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 5, this);
2185
+ return _chunkKXWOF6H4cjs.getInt64.call(void 0, 8, this);
2186
+ }
2187
+ get _isInt64() {
2188
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 5;
2189
+ }
2190
+ set int64(value) {
2191
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 5, this);
2192
+ _chunkKXWOF6H4cjs.setInt64.call(void 0, 8, value, this);
2193
+ }
2194
+ get uint8() {
2195
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "uint8", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 6, this);
2196
+ return _chunkKXWOF6H4cjs.getUint8.call(void 0, 2, this);
2197
+ }
2198
+ get _isUint8() {
2199
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 6;
2200
+ }
2201
+ set uint8(value) {
2202
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 6, this);
2203
+ _chunkKXWOF6H4cjs.setUint8.call(void 0, 2, value, this);
2204
+ }
2205
+ get uint16() {
2206
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "uint16", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 7, this);
2207
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 2, this);
2208
+ }
2209
+ get _isUint16() {
2210
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 7;
2211
+ }
2212
+ set uint16(value) {
2213
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 7, this);
2214
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 2, value, this);
2215
+ }
2216
+ get uint32() {
2217
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "uint32", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 8, this);
2218
+ return _chunkKXWOF6H4cjs.getUint32.call(void 0, 4, this);
2219
+ }
2220
+ get _isUint32() {
2221
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 8;
2222
+ }
2223
+ set uint32(value) {
2224
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 8, this);
2225
+ _chunkKXWOF6H4cjs.setUint32.call(void 0, 4, value, this);
2226
+ }
2227
+ get uint64() {
2228
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "uint64", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 9, this);
2229
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 8, this);
2230
+ }
2231
+ get _isUint64() {
2232
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 9;
2233
+ }
2234
+ set uint64(value) {
2235
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 9, this);
2236
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 8, value, this);
2237
+ }
2238
+ get float32() {
2239
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "float32", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 10, this);
2240
+ return _chunkKXWOF6H4cjs.getFloat32.call(void 0, 4, this);
2241
+ }
2242
+ get _isFloat32() {
2243
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 10;
2244
+ }
2245
+ set float32(value) {
2246
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 10, this);
2247
+ _chunkKXWOF6H4cjs.setFloat32.call(void 0, 4, value, this);
2248
+ }
2249
+ get float64() {
2250
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "float64", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 11, this);
2251
+ return _chunkKXWOF6H4cjs.getFloat64.call(void 0, 8, this);
2252
+ }
2253
+ get _isFloat64() {
2254
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 11;
2255
+ }
2256
+ set float64(value) {
2257
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 11, this);
2258
+ _chunkKXWOF6H4cjs.setFloat64.call(void 0, 8, value, this);
2259
+ }
2260
+ get text() {
2261
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "text", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 12, this);
2262
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
2263
+ }
2264
+ get _isText() {
2265
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 12;
2266
+ }
2267
+ set text(value) {
2268
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 12, this);
2269
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
2270
+ }
2271
+ _adoptData(value) {
2272
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 13, this);
2273
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2274
+ }
2275
+ _disownData() {
2276
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.data);
2277
+ }
2278
+ get data() {
2279
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "data", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 13, this);
2280
+ return _chunkKXWOF6H4cjs.getData.call(void 0, 0, this);
2281
+ }
2282
+ _hasData() {
2283
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2284
+ }
2285
+ _initData(length) {
2286
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 13, this);
2287
+ return _chunkKXWOF6H4cjs.initData.call(void 0, 0, length, this);
2288
+ }
2289
+ get _isData() {
2290
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 13;
2291
+ }
2292
+ set data(value) {
2293
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 13, this);
2294
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2295
+ }
2296
+ _adoptList(value) {
2297
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 14, this);
2298
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2299
+ }
2300
+ _disownList() {
2301
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.list);
2302
+ }
2303
+ get list() {
2304
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "list", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 14, this);
2305
+ return _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this);
2306
+ }
2307
+ _hasList() {
2308
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2309
+ }
2310
+ get _isList() {
2311
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 14;
2312
+ }
2313
+ set list(value) {
2314
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 14, this);
2315
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2316
+ }
2317
+ get enum() {
2318
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "enum", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 15, this);
2319
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 2, this);
2320
+ }
2321
+ get _isEnum() {
2322
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 15;
2323
+ }
2324
+ set enum(value) {
2325
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 15, this);
2326
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 2, value, this);
2327
+ }
2328
+ _adoptStruct(value) {
2329
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 16, this);
2330
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2331
+ }
2332
+ _disownStruct() {
2333
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.struct);
2334
+ }
2335
+ get struct() {
2336
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "struct", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 16, this);
2337
+ return _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this);
2338
+ }
2339
+ _hasStruct() {
2340
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2341
+ }
2342
+ get _isStruct() {
2343
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 16;
2344
+ }
2345
+ set struct(value) {
2346
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 16, this);
2347
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2348
+ }
2349
+ get _isInterface() {
2350
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 17;
2351
+ }
2352
+ set interface(_) {
2353
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 17, this);
2354
+ }
2355
+ _adoptAnyPointer(value) {
2356
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 18, this);
2357
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2358
+ }
2359
+ _disownAnyPointer() {
2360
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.anyPointer);
2361
+ }
2362
+ get anyPointer() {
2363
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "anyPointer", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this), 18, this);
2364
+ return _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this);
2365
+ }
2366
+ _hasAnyPointer() {
2367
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2368
+ }
2369
+ get _isAnyPointer() {
2370
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this) === 18;
2371
+ }
2372
+ set anyPointer(value) {
2373
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, 18, this);
2374
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2375
+ }
2376
+ toString() {
2377
+ return "Value_" + super.toString();
2378
+ }
2379
+ which() {
2380
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
2381
+ }
2382
+ }, _class30.__initStatic77(), _class30.__initStatic78(), _class30.__initStatic79(), _class30.__initStatic80(), _class30.__initStatic81(), _class30.__initStatic82(), _class30.__initStatic83(), _class30.__initStatic84(), _class30.__initStatic85(), _class30.__initStatic86(), _class30.__initStatic87(), _class30.__initStatic88(), _class30.__initStatic89(), _class30.__initStatic90(), _class30.__initStatic91(), _class30.__initStatic92(), _class30.__initStatic93(), _class30.__initStatic94(), _class30.__initStatic95(), _class30.__initStatic96(), _class30);
2383
+ var Annotation = (_class31 = class extends _chunkKXWOF6H4cjs.Struct {
2384
+ static {
2385
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "Annotation");
2386
+ }
2387
+ static __initStatic97() {this._capnp = {
2388
+ displayName: "Annotation",
2389
+ id: "f1c8950dab257542",
2390
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 2)
2391
+ }}
2392
+ /**
2393
+ * ID of the annotation node.
2394
+ *
2395
+ */
2396
+ get id() {
2397
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
2398
+ }
2399
+ set id(value) {
2400
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
2401
+ }
2402
+ _adoptBrand(value) {
2403
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2404
+ }
2405
+ _disownBrand() {
2406
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.brand);
2407
+ }
2408
+ /**
2409
+ * Brand of the annotation.
2410
+ *
2411
+ * Note that the annotation itself is not allowed to be parameterized, but its scope might be.
2412
+ *
2413
+ */
2414
+ get brand() {
2415
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 1, Brand, this);
2416
+ }
2417
+ _hasBrand() {
2418
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2419
+ }
2420
+ _initBrand() {
2421
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 1, Brand, this);
2422
+ }
2423
+ set brand(value) {
2424
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2425
+ }
2426
+ _adoptValue(value) {
2427
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2428
+ }
2429
+ _disownValue() {
2430
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.value);
2431
+ }
2432
+ get value() {
2433
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 0, Value, this);
2434
+ }
2435
+ _hasValue() {
2436
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2437
+ }
2438
+ _initValue() {
2439
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 0, Value, this);
2440
+ }
2441
+ set value(value) {
2442
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2443
+ }
2444
+ toString() {
2445
+ return "Annotation_" + super.toString();
2446
+ }
2447
+ }, _class31.__initStatic97(), _class31);
2448
+ var ElementSize = {
2449
+ /**
2450
+ * aka "void", but that's a keyword.
2451
+ *
2452
+ */
2453
+ EMPTY: 0,
2454
+ BIT: 1,
2455
+ BYTE: 2,
2456
+ TWO_BYTES: 3,
2457
+ FOUR_BYTES: 4,
2458
+ EIGHT_BYTES: 5,
2459
+ POINTER: 6,
2460
+ INLINE_COMPOSITE: 7
2461
+ };
2462
+ var CapnpVersion = (_class32 = class extends _chunkKXWOF6H4cjs.Struct {
2463
+ static {
2464
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CapnpVersion");
2465
+ }
2466
+ static __initStatic98() {this._capnp = {
2467
+ displayName: "CapnpVersion",
2468
+ id: "d85d305b7d839963",
2469
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 0)
2470
+ }}
2471
+ get major() {
2472
+ return _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, this);
2473
+ }
2474
+ set major(value) {
2475
+ _chunkKXWOF6H4cjs.setUint16.call(void 0, 0, value, this);
2476
+ }
2477
+ get minor() {
2478
+ return _chunkKXWOF6H4cjs.getUint8.call(void 0, 2, this);
2479
+ }
2480
+ set minor(value) {
2481
+ _chunkKXWOF6H4cjs.setUint8.call(void 0, 2, value, this);
2482
+ }
2483
+ get micro() {
2484
+ return _chunkKXWOF6H4cjs.getUint8.call(void 0, 3, this);
2485
+ }
2486
+ set micro(value) {
2487
+ _chunkKXWOF6H4cjs.setUint8.call(void 0, 3, value, this);
2488
+ }
2489
+ toString() {
2490
+ return "CapnpVersion_" + super.toString();
2491
+ }
2492
+ }, _class32.__initStatic98(), _class32);
2493
+ var CodeGeneratorRequest_RequestedFile_Import = (_class33 = class extends _chunkKXWOF6H4cjs.Struct {
2494
+ static {
2495
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorRequest_RequestedFile_Import");
2496
+ }
2497
+ static __initStatic99() {this._capnp = {
2498
+ displayName: "Import",
2499
+ id: "ae504193122357e5",
2500
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 1)
2501
+ }}
2502
+ /**
2503
+ * ID of the imported file.
2504
+ *
2505
+ */
2506
+ get id() {
2507
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
2508
+ }
2509
+ set id(value) {
2510
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
2511
+ }
2512
+ /**
2513
+ * Name which *this* file used to refer to the foreign file. This may be a relative name.
2514
+ * This information is provided because it might be useful for code generation, e.g. to
2515
+ * generate #include directives in C++. We don't put this in Node.file because this
2516
+ * information is only meaningful at compile time anyway.
2517
+ *
2518
+ * (On Zooko's triangle, this is the import's petname according to the importing file.)
2519
+ *
2520
+ */
2521
+ get name() {
2522
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
2523
+ }
2524
+ set name(value) {
2525
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
2526
+ }
2527
+ toString() {
2528
+ return "CodeGeneratorRequest_RequestedFile_Import_" + super.toString();
2529
+ }
2530
+ }, _class33.__initStatic99(), _class33);
2531
+ var CodeGeneratorRequest_RequestedFile = (_class34 = class _CodeGeneratorRequest_RequestedFile extends _chunkKXWOF6H4cjs.Struct {
2532
+ static {
2533
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorRequest_RequestedFile");
2534
+ }
2535
+ static __initStatic100() {this.Import = CodeGeneratorRequest_RequestedFile_Import}
2536
+ static __initStatic101() {this._capnp = {
2537
+ displayName: "RequestedFile",
2538
+ id: "cfea0eb02e810062",
2539
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(8, 2)
2540
+ }}
2541
+
2542
+ /**
2543
+ * ID of the file.
2544
+ *
2545
+ */
2546
+ get id() {
2547
+ return _chunkKXWOF6H4cjs.getUint64.call(void 0, 0, this);
2548
+ }
2549
+ set id(value) {
2550
+ _chunkKXWOF6H4cjs.setUint64.call(void 0, 0, value, this);
2551
+ }
2552
+ /**
2553
+ * Name of the file as it appeared on the command-line (minus the src-prefix). You may use
2554
+ * this to decide where to write the output.
2555
+ *
2556
+ */
2557
+ get filename() {
2558
+ return _chunkKXWOF6H4cjs.getText.call(void 0, 0, this);
2559
+ }
2560
+ set filename(value) {
2561
+ _chunkKXWOF6H4cjs.setText.call(void 0, 0, value, this);
2562
+ }
2563
+ _adoptImports(value) {
2564
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2565
+ }
2566
+ _disownImports() {
2567
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.imports);
2568
+ }
2569
+ /**
2570
+ * List of all imported paths seen in this file.
2571
+ *
2572
+ */
2573
+ get imports() {
2574
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _CodeGeneratorRequest_RequestedFile._Imports, this);
2575
+ }
2576
+ _hasImports() {
2577
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2578
+ }
2579
+ _initImports(length) {
2580
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _CodeGeneratorRequest_RequestedFile._Imports, length, this);
2581
+ }
2582
+ set imports(value) {
2583
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2584
+ }
2585
+ toString() {
2586
+ return "CodeGeneratorRequest_RequestedFile_" + super.toString();
2587
+ }
2588
+ }, _class34.__initStatic100(), _class34.__initStatic101(), _class34);
2589
+ var CodeGeneratorRequest = (_class35 = class _CodeGeneratorRequest extends _chunkKXWOF6H4cjs.Struct {
2590
+ static {
2591
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorRequest");
2592
+ }
2593
+ static __initStatic102() {this.RequestedFile = CodeGeneratorRequest_RequestedFile}
2594
+ static __initStatic103() {this._capnp = {
2595
+ displayName: "CodeGeneratorRequest",
2596
+ id: "bfc546f6210ad7ce",
2597
+ size: new (0, _chunkKXWOF6H4cjs.ObjectSize)(0, 4)
2598
+ }}
2599
+
2600
+
2601
+
2602
+ _adoptCapnpVersion(value) {
2603
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
2604
+ }
2605
+ _disownCapnpVersion() {
2606
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.capnpVersion);
2607
+ }
2608
+ /**
2609
+ * Version of the `capnp` executable. Generally, code generators should ignore this, but the code
2610
+ * generators that ship with `capnp` itself will print a warning if this mismatches since that
2611
+ * probably indicates something is misconfigured.
2612
+ *
2613
+ * The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version
2614
+ * is older than that.
2615
+ *
2616
+ */
2617
+ get capnpVersion() {
2618
+ return _chunkKXWOF6H4cjs.getStruct.call(void 0, 2, CapnpVersion, this);
2619
+ }
2620
+ _hasCapnpVersion() {
2621
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
2622
+ }
2623
+ _initCapnpVersion() {
2624
+ return _chunkKXWOF6H4cjs.initStructAt.call(void 0, 2, CapnpVersion, this);
2625
+ }
2626
+ set capnpVersion(value) {
2627
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 2, this));
2628
+ }
2629
+ _adoptNodes(value) {
2630
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2631
+ }
2632
+ _disownNodes() {
2633
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.nodes);
2634
+ }
2635
+ /**
2636
+ * All nodes parsed by the compiler, including for the files on the command line and their
2637
+ * imports.
2638
+ *
2639
+ */
2640
+ get nodes() {
2641
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 0, _CodeGeneratorRequest._Nodes, this);
2642
+ }
2643
+ _hasNodes() {
2644
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2645
+ }
2646
+ _initNodes(length) {
2647
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 0, _CodeGeneratorRequest._Nodes, length, this);
2648
+ }
2649
+ set nodes(value) {
2650
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, this));
2651
+ }
2652
+ _adoptSourceInfo(value) {
2653
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
2654
+ }
2655
+ _disownSourceInfo() {
2656
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.sourceInfo);
2657
+ }
2658
+ /**
2659
+ * Information about the original source code for each node, where available. This array may be
2660
+ * omitted or may be missing some nodes if no info is available for them.
2661
+ *
2662
+ */
2663
+ get sourceInfo() {
2664
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 3, _CodeGeneratorRequest._SourceInfo, this);
2665
+ }
2666
+ _hasSourceInfo() {
2667
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
2668
+ }
2669
+ _initSourceInfo(length) {
2670
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 3, _CodeGeneratorRequest._SourceInfo, length, this);
2671
+ }
2672
+ set sourceInfo(value) {
2673
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 3, this));
2674
+ }
2675
+ _adoptRequestedFiles(value) {
2676
+ _chunkKXWOF6H4cjs.adopt.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2677
+ }
2678
+ _disownRequestedFiles() {
2679
+ return _chunkKXWOF6H4cjs.disown.call(void 0, this.requestedFiles);
2680
+ }
2681
+ /**
2682
+ * Files which were listed on the command line.
2683
+ *
2684
+ */
2685
+ get requestedFiles() {
2686
+ return _chunkKXWOF6H4cjs.getList.call(void 0, 1, _CodeGeneratorRequest._RequestedFiles, this);
2687
+ }
2688
+ _hasRequestedFiles() {
2689
+ return !_chunkKXWOF6H4cjs.isNull.call(void 0, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2690
+ }
2691
+ _initRequestedFiles(length) {
2692
+ return _chunkKXWOF6H4cjs.initList.call(void 0, 1, _CodeGeneratorRequest._RequestedFiles, length, this);
2693
+ }
2694
+ set requestedFiles(value) {
2695
+ _chunkKXWOF6H4cjs.copyFrom.call(void 0, value, _chunkKXWOF6H4cjs.getPointer.call(void 0, 1, this));
2696
+ }
2697
+ toString() {
2698
+ return "CodeGeneratorRequest_" + super.toString();
2699
+ }
2700
+ }, _class35.__initStatic102(), _class35.__initStatic103(), _class35);
2701
+ Node_SourceInfo._Members = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node_SourceInfo_Member);
2702
+ Node_Struct._Fields = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Field);
2703
+ Node_Enum._Enumerants = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Enumerant);
2704
+ Node_Interface._Methods = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Method);
2705
+ Node_Interface._Superclasses = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Superclass);
2706
+ Node._Parameters = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node_Parameter);
2707
+ Node._NestedNodes = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node_NestedNode);
2708
+ Node._Annotations = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Annotation);
2709
+ Field._Annotations = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Annotation);
2710
+ Enumerant._Annotations = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Annotation);
2711
+ Method._ImplicitParameters = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node_Parameter);
2712
+ Method._Annotations = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Annotation);
2713
+ Brand_Scope._Bind = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Brand_Binding);
2714
+ Brand._Scopes = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Brand_Scope);
2715
+ CodeGeneratorRequest_RequestedFile._Imports = _chunkKXWOF6H4cjs.CompositeList.call(void 0, CodeGeneratorRequest_RequestedFile_Import);
2716
+ CodeGeneratorRequest._Nodes = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node);
2717
+ CodeGeneratorRequest._SourceInfo = _chunkKXWOF6H4cjs.CompositeList.call(void 0, Node_SourceInfo);
2718
+ CodeGeneratorRequest._RequestedFiles = _chunkKXWOF6H4cjs.CompositeList.call(void 0, CodeGeneratorRequest_RequestedFile);
2719
+
2720
+ // ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
2721
+ var GEN_EXPLICIT_DEFAULT_NON_PRIMITIVE = "CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.";
2722
+ var GEN_FIELD_NON_INLINE_STRUCT_LIST = "CAPNP-ES001 Don't know how to generate non-inline struct lists.";
2723
+ var GEN_NODE_LOOKUP_FAIL = "CAPNP-ES002 Failed to look up node id %s.";
2724
+ var GEN_NODE_UNKNOWN_TYPE = `CAPNP-ES003 Don't know how to generate a "%s" node.`;
2725
+ var GEN_SERIALIZE_UNKNOWN_VALUE = "CAPNP-ES004 Don't know how to serialize a value of kind %s.";
2726
+ var GEN_UNKNOWN_STRUCT_FIELD = "CAPNP-ES005 Don't know how to generate a struct field of kind %d.";
2727
+ var GEN_UNKNOWN_TYPE = "CAPNP-ES006 Unknown slot type encountered: %d";
2728
+ var GEN_UNSUPPORTED_LIST_ELEMENT_TYPE = "CAPNP-ES007 Encountered an unsupported list element type: %d";
2729
+ var GEN_TS_EMIT_FAILED = "CAPNP-ES009 Failed to transpile emitted schema source code; see above for error messages.";
2730
+ var GEN_UNKNOWN_DEFAULT = "CAPNP-ES010 Don't know how to generate a default value for %s fields.";
2731
+ var ConcreteListType = {
2732
+ [Type.ANY_POINTER]: "$.AnyPointerList",
2733
+ [Type.BOOL]: "$.BoolList",
2734
+ [Type.DATA]: "$.DataList",
2735
+ [Type.ENUM]: "$.Uint16List",
2736
+ [Type.FLOAT32]: "$.Float32List",
2737
+ [Type.FLOAT64]: "$.Float64List",
2738
+ [Type.INT16]: "$.Int16List",
2739
+ [Type.INT32]: "$.Int32List",
2740
+ [Type.INT64]: "$.Int64List",
2741
+ [Type.INT8]: "$.Int8List",
2742
+ [Type.INTERFACE]: "$.InterfaceList",
2743
+ [Type.LIST]: "$.PointerList",
2744
+ [Type.STRUCT]: "$.CompositeList",
2745
+ [Type.TEXT]: "$.TextList",
2746
+ [Type.UINT16]: "$.Uint16List",
2747
+ [Type.UINT32]: "$.Uint32List",
2748
+ [Type.UINT64]: "$.Uint64List",
2749
+ [Type.UINT8]: "$.Uint8List",
2750
+ [Type.VOID]: "$.VoidList"
2751
+ };
2752
+ var Primitives = {
2753
+ [Type.BOOL]: {
2754
+ byteLength: 1,
2755
+ getter: "getBit",
2756
+ mask: "getBitMask",
2757
+ setter: "setBit"
2758
+ },
2759
+ [Type.ENUM]: {
2760
+ byteLength: 2,
2761
+ getter: "getUint16",
2762
+ mask: "getUint16Mask",
2763
+ setter: "setUint16"
2764
+ },
2765
+ [Type.FLOAT32]: {
2766
+ byteLength: 4,
2767
+ getter: "getFloat32",
2768
+ mask: "getFloat32Mask",
2769
+ setter: "setFloat32"
2770
+ },
2771
+ [Type.FLOAT64]: {
2772
+ byteLength: 8,
2773
+ getter: "getFloat64",
2774
+ mask: "getFloat64Mask",
2775
+ setter: "setFloat64"
2776
+ },
2777
+ [Type.INT16]: {
2778
+ byteLength: 2,
2779
+ getter: "getInt16",
2780
+ mask: "getInt16Mask",
2781
+ setter: "setInt16"
2782
+ },
2783
+ [Type.INT32]: {
2784
+ byteLength: 4,
2785
+ getter: "getInt32",
2786
+ mask: "getInt32Mask",
2787
+ setter: "setInt32"
2788
+ },
2789
+ [Type.INT64]: {
2790
+ byteLength: 8,
2791
+ getter: "getInt64",
2792
+ mask: "getInt64Mask",
2793
+ setter: "setInt64"
2794
+ },
2795
+ [Type.INT8]: {
2796
+ byteLength: 1,
2797
+ getter: "getInt8",
2798
+ mask: "getInt8Mask",
2799
+ setter: "setInt8"
2800
+ },
2801
+ [Type.UINT16]: {
2802
+ byteLength: 2,
2803
+ getter: "getUint16",
2804
+ mask: "getUint16Mask",
2805
+ setter: "setUint16"
2806
+ },
2807
+ [Type.UINT32]: {
2808
+ byteLength: 4,
2809
+ getter: "getUint32",
2810
+ mask: "getUint32Mask",
2811
+ setter: "setUint32"
2812
+ },
2813
+ [Type.UINT64]: {
2814
+ byteLength: 8,
2815
+ getter: "getUint64",
2816
+ mask: "getUint64Mask",
2817
+ setter: "setUint64"
2818
+ },
2819
+ [Type.UINT8]: {
2820
+ byteLength: 1,
2821
+ getter: "getUint8",
2822
+ mask: "getUint8Mask",
2823
+ setter: "setUint8"
2824
+ },
2825
+ [Type.VOID]: {
2826
+ byteLength: 0,
2827
+ getter: "getVoid",
2828
+ mask: "getVoidMask",
2829
+ setter: "setVoid"
2830
+ }
2831
+ };
2832
+ var SOURCE_COMMENT = `
2833
+ /* eslint-disable */
2834
+ // biome-ignore lint: disable
2835
+
2836
+ // Generated by storm-capnpc
2837
+ // Note: Do not edit this file manually - it will be overwritten automatically
2838
+
2839
+ `;
2840
+ var TS_FILE_ID = "e37ded525a68a7c9";
2841
+ var hex2dec;
2842
+ var hasRequiredHex2dec;
2843
+ function requireHex2dec() {
2844
+ if (hasRequiredHex2dec) return hex2dec;
2845
+ hasRequiredHex2dec = 1;
2846
+ function add(x, y, base) {
2847
+ var z = [];
2848
+ var n = Math.max(x.length, y.length);
2849
+ var carry = 0;
2850
+ var i = 0;
2851
+ while (i < n || carry) {
2852
+ var xi = i < x.length ? x[i] : 0;
2853
+ var yi = i < y.length ? y[i] : 0;
2854
+ var zi = carry + xi + yi;
2855
+ z.push(zi % base);
2856
+ carry = Math.floor(zi / base);
2857
+ i++;
2858
+ }
2859
+ return z;
2860
+ }
2861
+ _chunkUSNT2KNTcjs.__name.call(void 0, add, "add");
2862
+ function multiplyByNumber(num, x, base) {
2863
+ if (num < 0) return null;
2864
+ if (num == 0) return [];
2865
+ var result = [];
2866
+ var power = x;
2867
+ while (true) {
2868
+ if (num & 1) {
2869
+ result = add(result, power, base);
2870
+ }
2871
+ num = num >> 1;
2872
+ if (num === 0) break;
2873
+ power = add(power, power, base);
2874
+ }
2875
+ return result;
2876
+ }
2877
+ _chunkUSNT2KNTcjs.__name.call(void 0, multiplyByNumber, "multiplyByNumber");
2878
+ function parseToDigitsArray(str, base) {
2879
+ var digits = str.split("");
2880
+ var ary = [];
2881
+ for (var i = digits.length - 1; i >= 0; i--) {
2882
+ var n = parseInt(digits[i], base);
2883
+ if (isNaN(n)) return null;
2884
+ ary.push(n);
2885
+ }
2886
+ return ary;
2887
+ }
2888
+ _chunkUSNT2KNTcjs.__name.call(void 0, parseToDigitsArray, "parseToDigitsArray");
2889
+ function convertBase(str, fromBase, toBase) {
2890
+ var digits = parseToDigitsArray(str, fromBase);
2891
+ if (digits === null) return null;
2892
+ var outArray = [];
2893
+ var power = [1];
2894
+ for (var i = 0; i < digits.length; i++) {
2895
+ if (digits[i]) {
2896
+ outArray = add(outArray, multiplyByNumber(digits[i], power, toBase), toBase);
2897
+ }
2898
+ power = multiplyByNumber(fromBase, power, toBase);
2899
+ }
2900
+ var out = "";
2901
+ for (var i = outArray.length - 1; i >= 0; i--) {
2902
+ out += outArray[i].toString(toBase);
2903
+ }
2904
+ if (out === "") {
2905
+ out = "0";
2906
+ }
2907
+ return out;
2908
+ }
2909
+ _chunkUSNT2KNTcjs.__name.call(void 0, convertBase, "convertBase");
2910
+ function decToHex(decStr, opts) {
2911
+ var hidePrefix = opts && opts.prefix === false;
2912
+ var hex = convertBase(decStr, 10, 16);
2913
+ return hex ? hidePrefix ? hex : "0x" + hex : null;
2914
+ }
2915
+ _chunkUSNT2KNTcjs.__name.call(void 0, decToHex, "decToHex");
2916
+ function hexToDec(hexStr) {
2917
+ if (hexStr.substring(0, 2) === "0x") hexStr = hexStr.substring(2);
2918
+ hexStr = hexStr.toLowerCase();
2919
+ return convertBase(hexStr, 16, 10);
2920
+ }
2921
+ _chunkUSNT2KNTcjs.__name.call(void 0, hexToDec, "hexToDec");
2922
+ hex2dec = {
2923
+ hexToDec,
2924
+ decToHex
2925
+ };
2926
+ return hex2dec;
2927
+ }
2928
+ _chunkUSNT2KNTcjs.__name.call(void 0, requireHex2dec, "requireHex2dec");
2929
+ var hex2decExports = requireHex2dec();
2930
+ function c2s(s) {
2931
+ return splitCamel(s).map((x) => x.toUpperCase()).join("_");
2932
+ }
2933
+ _chunkUSNT2KNTcjs.__name.call(void 0, c2s, "c2s");
2934
+ function c2t(s) {
2935
+ return s[0].toUpperCase() + s.slice(1);
2936
+ }
2937
+ _chunkUSNT2KNTcjs.__name.call(void 0, c2t, "c2t");
2938
+ function splitCamel(s) {
2939
+ let wasLo = false;
2940
+ return s.split("").reduce((a, c) => {
2941
+ const lo = c.toUpperCase() !== c;
2942
+ const up = c.toLowerCase() !== c;
2943
+ if (a.length === 0 || wasLo && up) {
2944
+ a.push(c);
2945
+ } else {
2946
+ const i = a.length - 1;
2947
+ a[i] = a[i] + c;
2948
+ }
2949
+ wasLo = lo;
2950
+ return a;
2951
+ }, []);
2952
+ }
2953
+ _chunkUSNT2KNTcjs.__name.call(void 0, splitCamel, "splitCamel");
2954
+ function hexToBigInt(hexString) {
2955
+ return BigInt(hex2decExports.hexToDec(hexString));
2956
+ }
2957
+ _chunkUSNT2KNTcjs.__name.call(void 0, hexToBigInt, "hexToBigInt");
2958
+ function compareCodeOrder(a, b) {
2959
+ return a.codeOrder - b.codeOrder;
2960
+ }
2961
+ _chunkUSNT2KNTcjs.__name.call(void 0, compareCodeOrder, "compareCodeOrder");
2962
+ function getConcreteListType(ctx, type) {
2963
+ if (!type._isList) {
2964
+ return getJsType(ctx, type, false);
2965
+ }
2966
+ const { elementType } = type.list;
2967
+ const elementTypeWhich = elementType.which();
2968
+ if (elementTypeWhich === Type.LIST) {
2969
+ return `$.PointerList(${getConcreteListType(ctx, elementType)})`;
2970
+ } else if (elementTypeWhich === Type.STRUCT) {
2971
+ const structNode = lookupNode(ctx, elementType.struct.typeId);
2972
+ if (structNode.struct.preferredListEncoding !== ElementSize.INLINE_COMPOSITE) {
2973
+ throw new Error(GEN_FIELD_NON_INLINE_STRUCT_LIST);
2974
+ }
2975
+ return `$.CompositeList(${getJsType(ctx, elementType, false)})`;
2976
+ }
2977
+ return ConcreteListType[elementTypeWhich];
2978
+ }
2979
+ _chunkUSNT2KNTcjs.__name.call(void 0, getConcreteListType, "getConcreteListType");
2980
+ function getDisplayNamePrefix(node) {
2981
+ return node.displayName.slice(node.displayNamePrefixLength);
2982
+ }
2983
+ _chunkUSNT2KNTcjs.__name.call(void 0, getDisplayNamePrefix, "getDisplayNamePrefix");
2984
+ function getFullClassName(node) {
2985
+ return node.displayName.split(":")[1].split(".").map((s) => c2t(s)).join("_");
2986
+ }
2987
+ _chunkUSNT2KNTcjs.__name.call(void 0, getFullClassName, "getFullClassName");
2988
+ function getJsType(ctx, type, constructor) {
2989
+ const whichType = type.which();
2990
+ switch (whichType) {
2991
+ case Type.ANY_POINTER: {
2992
+ return "$.Pointer";
2993
+ }
2994
+ case Type.BOOL: {
2995
+ return "boolean";
2996
+ }
2997
+ case Type.DATA: {
2998
+ return "$.Data";
2999
+ }
3000
+ case Type.ENUM: {
3001
+ return getFullClassName(lookupNode(ctx, type.enum.typeId));
3002
+ }
3003
+ case Type.FLOAT32:
3004
+ case Type.FLOAT64:
3005
+ case Type.INT16:
3006
+ case Type.INT32:
3007
+ case Type.INT8:
3008
+ case Type.UINT16:
3009
+ case Type.UINT32:
3010
+ case Type.UINT8: {
3011
+ return "number";
3012
+ }
3013
+ case Type.UINT64:
3014
+ case Type.INT64: {
3015
+ return "bigint";
3016
+ }
3017
+ case Type.INTERFACE: {
3018
+ return getFullClassName(lookupNode(ctx, type.interface.typeId));
3019
+ }
3020
+ case Type.LIST: {
3021
+ return `$.List${constructor ? "Ctor" : ""}<${getJsType(ctx, type.list.elementType, false)}>`;
3022
+ }
3023
+ case Type.STRUCT: {
3024
+ const c = getFullClassName(lookupNode(ctx, type.struct.typeId));
3025
+ return constructor ? `$.StructCtor<${c}>` : c;
3026
+ }
3027
+ case Type.TEXT: {
3028
+ return "string";
3029
+ }
3030
+ case Type.VOID: {
3031
+ return "$.Void";
3032
+ }
3033
+ default: {
3034
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_UNKNOWN_TYPE, whichType));
3035
+ }
3036
+ }
3037
+ }
3038
+ _chunkUSNT2KNTcjs.__name.call(void 0, getJsType, "getJsType");
3039
+ function getUnnamedUnionFields(node) {
3040
+ return node.struct.fields.filter(
3041
+ (field) => field.discriminantValue !== Field.NO_DISCRIMINANT
3042
+ );
3043
+ }
3044
+ _chunkUSNT2KNTcjs.__name.call(void 0, getUnnamedUnionFields, "getUnnamedUnionFields");
3045
+ function hasNode(ctx, lookup) {
3046
+ const id = typeof lookup === "bigint" ? lookup : lookup.id;
3047
+ return ctx.nodes.some((n) => n.id === id);
3048
+ }
3049
+ _chunkUSNT2KNTcjs.__name.call(void 0, hasNode, "hasNode");
3050
+ function loadRequestedFile(req, file) {
3051
+ const ctx = new CodeGeneratorFileContext(req, file);
3052
+ const schema2 = lookupNode(ctx, file.id);
3053
+ ctx.tsPath = schema2.displayName.replace(/\.capnp$/, "") + ".ts";
3054
+ return ctx;
3055
+ }
3056
+ _chunkUSNT2KNTcjs.__name.call(void 0, loadRequestedFile, "loadRequestedFile");
3057
+ function lookupNode(ctx, lookup) {
3058
+ const id = typeof lookup === "bigint" ? lookup : lookup.id;
3059
+ const node = ctx.nodes.find((n) => n.id === id);
3060
+ if (node === void 0) {
3061
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_NODE_LOOKUP_FAIL, id));
3062
+ }
3063
+ return node;
3064
+ }
3065
+ _chunkUSNT2KNTcjs.__name.call(void 0, lookupNode, "lookupNode");
3066
+ function lookupNodeSourceInfo(ctx, lookup) {
3067
+ const id = typeof lookup === "bigint" ? lookup : lookup.id;
3068
+ return ctx.req.sourceInfo.find((s) => s.id === id);
3069
+ }
3070
+ _chunkUSNT2KNTcjs.__name.call(void 0, lookupNodeSourceInfo, "lookupNodeSourceInfo");
3071
+ function needsConcreteListClass(field) {
3072
+ if (!field._isSlot) {
3073
+ return false;
3074
+ }
3075
+ const slotType = field.slot.type;
3076
+ if (!slotType._isList) {
3077
+ return false;
3078
+ }
3079
+ const { elementType } = slotType.list;
3080
+ return elementType._isStruct || elementType._isList;
3081
+ }
3082
+ _chunkUSNT2KNTcjs.__name.call(void 0, needsConcreteListClass, "needsConcreteListClass");
3083
+ function createBigInt(value) {
3084
+ let v = value.toString(16);
3085
+ let sign = "";
3086
+ if (v[0] === "-") {
3087
+ v = v.slice(1);
3088
+ sign = "-";
3089
+ }
3090
+ return `${sign}BigInt("0x${v}")`;
3091
+ }
3092
+ _chunkUSNT2KNTcjs.__name.call(void 0, createBigInt, "createBigInt");
3093
+ function extractJSDocs(sourceInfo) {
3094
+ const docComment = _optionalChain([sourceInfo, 'optionalAccess', _2 => _2.docComment]);
3095
+ if (!docComment) {
3096
+ return "";
3097
+ }
3098
+ return "/**\n" + docComment.toString().split("\n").map((l) => `* ${l}`).join("\n") + "\n*/";
3099
+ }
3100
+ _chunkUSNT2KNTcjs.__name.call(void 0, extractJSDocs, "extractJSDocs");
3101
+ function generateEnumNode(ctx, className, parentNode, fields) {
3102
+ const fieldIndexInCodeOrder = fields.map(({ codeOrder }, fieldIndex) => ({ fieldIndex, codeOrder })).sort(compareCodeOrder).map(({ fieldIndex }) => fieldIndex);
3103
+ const sourceInfo = lookupNodeSourceInfo(ctx, parentNode);
3104
+ const propInits = fieldIndexInCodeOrder.map((index) => {
3105
+ const field = fields[index];
3106
+ const docComment = extractJSDocs(_optionalChain([sourceInfo, 'optionalAccess', _3 => _3.members, 'access', _4 => _4.at, 'call', _5 => _5(index)]));
3107
+ const key = c2s(field.name);
3108
+ const val = field.discriminantValue || index;
3109
+ return `
3110
+ ${docComment}
3111
+ ${key}: ${val}`;
3112
+ });
3113
+ ctx.codeParts.push(`
3114
+ export const ${className} = {
3115
+ ${propInits.join(",\n")}
3116
+ } as const;
3117
+
3118
+ export type ${className} = (typeof ${className})[keyof typeof ${className}];
3119
+ `);
3120
+ }
3121
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateEnumNode, "generateEnumNode");
3122
+ function generateInterfaceClasses(ctx, node) {
3123
+ generateMethodStructs(ctx, node);
3124
+ generateClient(ctx, node);
3125
+ generateServer(ctx, node);
3126
+ }
3127
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateInterfaceClasses, "generateInterfaceClasses");
3128
+ function generateMethodStructs(ctx, node) {
3129
+ for (const method of node.interface.methods) {
3130
+ const paramNode = lookupNode(ctx, method.paramStructType);
3131
+ const resultNode = lookupNode(ctx, method.resultStructType);
3132
+ generateNode(ctx, paramNode);
3133
+ generateNode(ctx, resultNode);
3134
+ generateResultPromise(ctx, resultNode);
3135
+ }
3136
+ }
3137
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateMethodStructs, "generateMethodStructs");
3138
+ function generateServer(ctx, node) {
3139
+ const fullClassName = getFullClassName(node);
3140
+ const serverName = `${fullClassName}$Server`;
3141
+ const serverTargetName = `${serverName}$Target`;
3142
+ const clientName = `${fullClassName}$Client`;
3143
+ const methodSignatures = node.interface.methods.map((method) => {
3144
+ const paramTypeName = getFullClassName(
3145
+ lookupNode(ctx, method.paramStructType)
3146
+ );
3147
+ const resultTypeName = getFullClassName(
3148
+ lookupNode(ctx, method.resultStructType)
3149
+ );
3150
+ return `${method.name}(params: ${paramTypeName}, results: ${resultTypeName}): Promise<void>;`;
3151
+ }).join("\n");
3152
+ ctx.codeParts.push(`
3153
+ export interface ${serverTargetName} {
3154
+ ${methodSignatures}
3155
+ }`);
3156
+ const members = [];
3157
+ members.push(`public override readonly target: ${serverTargetName};`);
3158
+ const codeServerMethods = [];
3159
+ let index = 0;
3160
+ for (const method of node.interface.methods) {
3161
+ codeServerMethods.push(`{
3162
+ ...${clientName}.methods[${index}],
3163
+ impl: target.${method.name}
3164
+ }`);
3165
+ index++;
3166
+ }
3167
+ members.push(`
3168
+ constructor(target: ${serverTargetName}) {
3169
+ super(target, [
3170
+ ${codeServerMethods.join(",\n")}
3171
+ ]);
3172
+ this.target = target;
3173
+ }
3174
+ client(): ${clientName} {
3175
+ return new ${clientName}(this);
3176
+ }
3177
+ `);
3178
+ ctx.codeParts.push(`
3179
+ export class ${serverName} extends $.Server {
3180
+ ${members.join("\n")}
3181
+ }
3182
+ `);
3183
+ }
3184
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateServer, "generateServer");
3185
+ function generateClient(ctx, node) {
3186
+ const fullClassName = getFullClassName(node);
3187
+ const clientName = `${fullClassName}$Client`;
3188
+ const members = [];
3189
+ members.push(`
3190
+ client: $.Client;
3191
+ static readonly interfaceId: bigint = ${createBigInt(node.id)};
3192
+ constructor(client: $.Client) {
3193
+ this.client = client;
3194
+ }
3195
+ `);
3196
+ const methods = [];
3197
+ const methodDefs = [];
3198
+ const methodDefTypes = [];
3199
+ for (let index = 0; index < node.interface.methods.length; index++) {
3200
+ generateClientMethod(
3201
+ ctx,
3202
+ node,
3203
+ clientName,
3204
+ methods,
3205
+ methodDefs,
3206
+ methodDefTypes,
3207
+ index
3208
+ );
3209
+ }
3210
+ members.push(`
3211
+ static readonly methods:[
3212
+ ${methodDefTypes.join(",\n")}
3213
+ ] = [
3214
+ ${methodDefs.join(",\n")}
3215
+ ];
3216
+ ${methods.join("\n")}
3217
+ `);
3218
+ ctx.codeParts.push(`
3219
+ export class ${clientName} {
3220
+ ${members.join("\n")}
3221
+ }
3222
+ $.Registry.register(${clientName}.interfaceId, ${clientName});
3223
+ `);
3224
+ }
3225
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateClient, "generateClient");
3226
+ function generateResultPromise(ctx, node) {
3227
+ const nodeId = node.id;
3228
+ if (ctx.generatedResultsPromiseIds.has(nodeId)) {
3229
+ return;
3230
+ }
3231
+ ctx.generatedResultsPromiseIds.add(nodeId);
3232
+ const resultsClassName = getFullClassName(node);
3233
+ const fullClassName = `${resultsClassName}$Promise`;
3234
+ const members = [];
3235
+ members.push(`
3236
+ pipeline: $.Pipeline<any, any, ${resultsClassName}>;
3237
+ constructor(pipeline: $.Pipeline<any, any, ${resultsClassName}>) {
3238
+ this.pipeline = pipeline;
3239
+ }
3240
+ `);
3241
+ const { struct } = node;
3242
+ const fields = struct.fields.toArray().sort(compareCodeOrder);
3243
+ const generatePromiseFieldMethod = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (field) => {
3244
+ let jsType;
3245
+ let isInterface = false;
3246
+ let slot;
3247
+ if (field._isSlot) {
3248
+ slot = field.slot;
3249
+ const slotType = slot.type;
3250
+ if (slotType.which() !== Type.INTERFACE) {
3251
+ return;
3252
+ }
3253
+ isInterface = true;
3254
+ jsType = getJsType(ctx, slotType, false);
3255
+ } else if (field._isGroup) {
3256
+ return;
3257
+ } else {
3258
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_UNKNOWN_STRUCT_FIELD, field.which()));
3259
+ }
3260
+ const promisedJsType = jsType;
3261
+ if (isInterface) {
3262
+ jsType = `${jsType}$Client`;
3263
+ }
3264
+ const { name } = field;
3265
+ const properName = c2t(name);
3266
+ members.push(`
3267
+ get${properName}(): ${jsType} {
3268
+ return new ${jsType}(this.pipeline.getPipeline(${promisedJsType}, ${slot.offset}).client());
3269
+ }
3270
+ `);
3271
+ }, "generatePromiseFieldMethod");
3272
+ for (const field of fields) {
3273
+ generatePromiseFieldMethod(field);
3274
+ }
3275
+ members.push(`
3276
+ async promise(): Promise<${resultsClassName}> {
3277
+ return await this.pipeline.struct();
3278
+ }
3279
+ `);
3280
+ ctx.codeParts.push(`
3281
+ export class ${fullClassName} {
3282
+ ${members.join("\n")}
3283
+ }
3284
+ `);
3285
+ }
3286
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateResultPromise, "generateResultPromise");
3287
+ function generateClientMethod(ctx, node, clientName, methodsCode, methodDefs, methodDefTypes, index) {
3288
+ const method = node.interface.methods[index];
3289
+ const { name } = method;
3290
+ const paramTypeName = getFullClassName(
3291
+ lookupNode(ctx, method.paramStructType)
3292
+ );
3293
+ const resultTypeName = getFullClassName(
3294
+ lookupNode(ctx, method.resultStructType)
3295
+ );
3296
+ methodDefTypes.push(`$.Method<${paramTypeName}, ${resultTypeName}>`);
3297
+ methodDefs.push(`{
3298
+ ParamsClass: ${paramTypeName},
3299
+ ResultsClass: ${resultTypeName},
3300
+ interfaceId: ${clientName}.interfaceId,
3301
+ methodId: ${index},
3302
+ interfaceName: "${node.displayName}",
3303
+ methodName: "${method.name}"
3304
+ }`);
3305
+ const docComment = extractJSDocs(
3306
+ _optionalChain([lookupNodeSourceInfo, 'call', _6 => _6(ctx, node), 'optionalAccess', _7 => _7.members, 'access', _8 => _8.at, 'call', _9 => _9(index)])
3307
+ );
3308
+ methodsCode.push(`
3309
+ ${docComment}
3310
+ ${name}(paramsFunc?: (params: ${paramTypeName}) => void): ${resultTypeName}$Promise {
3311
+ const answer = this.client.call({
3312
+ method: ${clientName}.methods[${index}],
3313
+ paramsFunc: paramsFunc
3314
+ });
3315
+ const pipeline = new $.Pipeline(${resultTypeName}, answer);
3316
+ return new ${resultTypeName}$Promise(pipeline);
3317
+ }
3318
+ `);
3319
+ }
3320
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateClientMethod, "generateClientMethod");
3321
+ function generateStructNode(ctx, node) {
3322
+ const displayNamePrefix = getDisplayNamePrefix(node);
3323
+ const fullClassName = getFullClassName(node);
3324
+ const nestedNodes = node.nestedNodes.map(({ id }) => lookupNode(ctx, id)).filter((node2) => !node2._isConst && !node2._isAnnotation);
3325
+ const nodeId = node.id;
3326
+ const nodeIdHex = nodeId.toString(16);
3327
+ const unionFields = getUnnamedUnionFields(node);
3328
+ const { struct } = node;
3329
+ const { dataWordCount, discriminantCount, discriminantOffset, pointerCount } = struct;
3330
+ const dataByteLength = dataWordCount * 8;
3331
+ const fields = struct.fields.toArray();
3332
+ const fieldIndexInCodeOrder = fields.map(({ codeOrder }, fieldIndex) => ({ fieldIndex, codeOrder })).sort(compareCodeOrder).map(({ fieldIndex }) => fieldIndex);
3333
+ const concreteLists = fields.filter((field) => needsConcreteListClass(field)).sort(compareCodeOrder);
3334
+ const consts = ctx.nodes.filter(
3335
+ (node2) => node2.scopeId === nodeId && node2._isConst
3336
+ );
3337
+ const hasUnnamedUnion = discriminantCount !== 0;
3338
+ if (hasUnnamedUnion) {
3339
+ generateEnumNode(ctx, fullClassName + "_Which", node, unionFields);
3340
+ }
3341
+ const members = [];
3342
+ members.push(
3343
+ ...consts.map((node2) => {
3344
+ const name = c2s(getDisplayNamePrefix(node2));
3345
+ const value = createValue(node2.const.value);
3346
+ return `static readonly ${name} = ${value}`;
3347
+ }),
3348
+ ...unionFields.sort(compareCodeOrder).map((field) => createUnionConstProperty(fullClassName, field)),
3349
+ ...nestedNodes.map((node2) => createNestedNodeProperty(node2))
3350
+ );
3351
+ const defaultValues = [];
3352
+ for (const index of fieldIndexInCodeOrder) {
3353
+ const field = fields[index];
3354
+ if (field._isSlot && field.slot.hadExplicitDefault && field.slot.type.which() !== Type.VOID) {
3355
+ defaultValues.push(generateDefaultValue(field));
3356
+ }
3357
+ }
3358
+ members.push(
3359
+ `
3360
+ public static override readonly _capnp = {
3361
+ displayName: "${displayNamePrefix}",
3362
+ id: "${nodeIdHex}",
3363
+ size: new $.ObjectSize(${dataByteLength}, ${pointerCount}),
3364
+ ${defaultValues.join(",")}
3365
+ }`,
3366
+ ...concreteLists.map((field) => createConcreteListProperty(ctx, field))
3367
+ );
3368
+ for (const index of fieldIndexInCodeOrder) {
3369
+ const field = fields[index];
3370
+ generateStructFieldMethods(ctx, members, node, field, index);
3371
+ }
3372
+ members.push(
3373
+ `public override toString(): string { return "${fullClassName}_" + super.toString(); }`
3374
+ );
3375
+ if (hasUnnamedUnion) {
3376
+ members.push(`
3377
+ which(): ${fullClassName}_Which {
3378
+ return $.utils.getUint16(${discriminantOffset * 2}, this) as ${fullClassName}_Which;
3379
+ }
3380
+ `);
3381
+ }
3382
+ const docComment = extractJSDocs(lookupNodeSourceInfo(ctx, node));
3383
+ const classCode = `
3384
+ ${docComment}
3385
+ export class ${fullClassName} extends $.Struct {
3386
+ ${members.join("\n")}
3387
+ }`;
3388
+ ctx.codeParts.push(classCode);
3389
+ ctx.concreteLists.push(
3390
+ ...concreteLists.map((field) => [
3391
+ fullClassName,
3392
+ field
3393
+ ])
3394
+ );
3395
+ }
3396
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateStructNode, "generateStructNode");
3397
+ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3398
+ let jsType;
3399
+ let whichType;
3400
+ if (field._isSlot) {
3401
+ const slotType = field.slot.type;
3402
+ jsType = getJsType(ctx, slotType, false);
3403
+ whichType = slotType.which();
3404
+ } else if (field._isGroup) {
3405
+ jsType = getFullClassName(lookupNode(ctx, field.group.typeId));
3406
+ whichType = "group";
3407
+ } else {
3408
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_UNKNOWN_STRUCT_FIELD, field.which()));
3409
+ }
3410
+ const isInterface = whichType === Type.INTERFACE;
3411
+ if (isInterface) {
3412
+ jsType = `${jsType}$Client`;
3413
+ }
3414
+ const { discriminantOffset } = node.struct;
3415
+ const { name } = field;
3416
+ const accessorName = name === "constructor" ? "$constructor" : name;
3417
+ const capitalizedName = c2t(name);
3418
+ const { discriminantValue } = field;
3419
+ const fullClassName = getFullClassName(node);
3420
+ const hadExplicitDefault = field._isSlot && field.slot.hadExplicitDefault;
3421
+ const maybeDefaultArg = hadExplicitDefault ? `, ${fullClassName}._capnp.default${capitalizedName}` : "";
3422
+ const union = discriminantValue !== Field.NO_DISCRIMINANT;
3423
+ const offset = field._isSlot ? field.slot.offset : 0;
3424
+ let adopt2 = false;
3425
+ let disown2 = false;
3426
+ let has = false;
3427
+ let init;
3428
+ let get;
3429
+ let set;
3430
+ switch (whichType) {
3431
+ case Type.ANY_POINTER: {
3432
+ adopt2 = true;
3433
+ disown2 = true;
3434
+ has = true;
3435
+ get = `$.utils.getPointer(${offset}, this${maybeDefaultArg})`;
3436
+ set = `$.utils.copyFrom(value, ${get})`;
3437
+ break;
3438
+ }
3439
+ case Type.BOOL:
3440
+ case Type.ENUM:
3441
+ case Type.FLOAT32:
3442
+ case Type.FLOAT64:
3443
+ case Type.INT16:
3444
+ case Type.INT32:
3445
+ case Type.INT64:
3446
+ case Type.INT8:
3447
+ case Type.UINT16:
3448
+ case Type.UINT32:
3449
+ case Type.UINT64:
3450
+ case Type.UINT8: {
3451
+ const { byteLength, getter, setter } = Primitives[whichType];
3452
+ const byteOffset = offset * byteLength;
3453
+ get = `$.utils.${getter}(${byteOffset}, this${maybeDefaultArg})`;
3454
+ set = `$.utils.${setter}(${byteOffset}, value, this${maybeDefaultArg})`;
3455
+ if (whichType === Type.ENUM) {
3456
+ get = `${get} as ${jsType}`;
3457
+ }
3458
+ break;
3459
+ }
3460
+ case Type.DATA: {
3461
+ adopt2 = true;
3462
+ disown2 = true;
3463
+ has = true;
3464
+ get = `$.utils.getData(${offset}, this${maybeDefaultArg})`;
3465
+ set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
3466
+ init = `$.utils.initData(${offset}, length, this)`;
3467
+ break;
3468
+ }
3469
+ case Type.INTERFACE: {
3470
+ get = `new ${jsType}($.utils.getInterfaceClientOrNullAt(${offset}, this))`;
3471
+ set = `$.utils.setInterfacePointer(this.segment.message.addCap(value.client), $.utils.getPointer(${offset}, this))`;
3472
+ break;
3473
+ }
3474
+ case Type.LIST: {
3475
+ const elementType = field.slot.type.list.elementType.which();
3476
+ let listClass = ConcreteListType[elementType];
3477
+ if (elementType === Type.LIST || elementType === Type.STRUCT) {
3478
+ listClass = `${fullClassName}._${capitalizedName}`;
3479
+ } else if (listClass === void 0) {
3480
+ throw new Error(
3481
+ _chunkKXWOF6H4cjs.format.call(void 0, GEN_UNSUPPORTED_LIST_ELEMENT_TYPE, elementType)
3482
+ );
3483
+ }
3484
+ adopt2 = true;
3485
+ disown2 = true;
3486
+ has = true;
3487
+ get = `$.utils.getList(${offset}, ${listClass}, this${maybeDefaultArg})`;
3488
+ set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
3489
+ init = `$.utils.initList(${offset}, ${listClass}, length, this)`;
3490
+ if (elementType === Type.ENUM) {
3491
+ get = `${get} as ${jsType}`;
3492
+ init = `${init} as ${jsType}`;
3493
+ }
3494
+ break;
3495
+ }
3496
+ case Type.STRUCT: {
3497
+ adopt2 = true;
3498
+ disown2 = true;
3499
+ has = true;
3500
+ get = `$.utils.getStruct(${offset}, ${jsType}, this${maybeDefaultArg})`;
3501
+ set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
3502
+ init = `$.utils.initStructAt(${offset}, ${jsType}, this)`;
3503
+ break;
3504
+ }
3505
+ case Type.TEXT: {
3506
+ get = `$.utils.getText(${offset}, this${maybeDefaultArg})`;
3507
+ set = `$.utils.setText(${offset}, value, this)`;
3508
+ break;
3509
+ }
3510
+ case Type.VOID: {
3511
+ break;
3512
+ }
3513
+ case "group": {
3514
+ if (hadExplicitDefault) {
3515
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_EXPLICIT_DEFAULT_NON_PRIMITIVE, "group"));
3516
+ }
3517
+ get = `$.utils.getAs(${jsType}, this)`;
3518
+ init = get;
3519
+ break;
3520
+ }
3521
+ }
3522
+ if (adopt2) {
3523
+ members.push(`
3524
+ _adopt${capitalizedName}(value: $.Orphan<${jsType}>): void {
3525
+ ${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
3526
+ $.utils.adopt(value, $.utils.getPointer(${offset}, this));
3527
+ }
3528
+ `);
3529
+ }
3530
+ if (disown2) {
3531
+ members.push(`
3532
+ _disown${capitalizedName}(): $.Orphan<${jsType}> {
3533
+ return $.utils.disown(this.${name === "constructor" ? `$${name}` : name});
3534
+ }
3535
+ `);
3536
+ }
3537
+ if (get) {
3538
+ const docComment = extractJSDocs(
3539
+ _optionalChain([lookupNodeSourceInfo, 'call', _10 => _10(ctx, node), 'optionalAccess', _11 => _11.members, 'access', _12 => _12.at, 'call', _13 => _13(fieldIndex)])
3540
+ );
3541
+ members.push(`
3542
+ ${docComment}
3543
+ get ${accessorName}(): ${jsType} {
3544
+ ${union ? `$.utils.testWhich(${JSON.stringify(name)}, $.utils.getUint16(${discriminantOffset * 2}, this), ${discriminantValue}, this);` : ""}
3545
+ return ${get};
3546
+ }
3547
+ `);
3548
+ }
3549
+ if (has) {
3550
+ members.push(`
3551
+ _has${capitalizedName}(): boolean {
3552
+ return !$.utils.isNull($.utils.getPointer(${offset}, this));
3553
+ }
3554
+ `);
3555
+ }
3556
+ if (init) {
3557
+ const params = whichType === Type.DATA || whichType === Type.LIST ? `length: number` : "";
3558
+ members.push(`
3559
+ _init${capitalizedName}(${params}): ${jsType} {
3560
+ ${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
3561
+ return ${init};
3562
+ }
3563
+ `);
3564
+ }
3565
+ if (union) {
3566
+ members.push(`
3567
+ get _is${capitalizedName}(): boolean {
3568
+ return $.utils.getUint16(${discriminantOffset * 2}, this) === ${discriminantValue};
3569
+ }
3570
+ `);
3571
+ }
3572
+ if (set || union) {
3573
+ const param = set ? `value: ${jsType}` : `_: true`;
3574
+ members.push(`
3575
+ set ${accessorName}(${param}) {
3576
+ ${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
3577
+ ${set ? `${set};` : ""}
3578
+ }
3579
+ `);
3580
+ }
3581
+ }
3582
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateStructFieldMethods, "generateStructFieldMethods");
3583
+ function generateDefaultValue(field) {
3584
+ const { name, slot } = field;
3585
+ const whichSlotType = slot.type.which();
3586
+ const primitive = Primitives[whichSlotType];
3587
+ let initializer;
3588
+ switch (whichSlotType) {
3589
+ case Type_Which.ANY_POINTER:
3590
+ case Type_Which.DATA:
3591
+ case Type_Which.LIST:
3592
+ case Type_Which.STRUCT:
3593
+ case Type_Which.INTERFACE: {
3594
+ initializer = createValue(slot.defaultValue);
3595
+ break;
3596
+ }
3597
+ case Type_Which.TEXT: {
3598
+ initializer = JSON.stringify(slot.defaultValue.text);
3599
+ break;
3600
+ }
3601
+ case Type_Which.BOOL: {
3602
+ const value = createValue(slot.defaultValue);
3603
+ const bitOffset = slot.offset % 8;
3604
+ initializer = `$.${primitive.mask}(${value}, ${bitOffset})`;
3605
+ break;
3606
+ }
3607
+ case Type_Which.ENUM:
3608
+ case Type_Which.FLOAT32:
3609
+ case Type_Which.FLOAT64:
3610
+ case Type_Which.INT16:
3611
+ case Type_Which.INT32:
3612
+ case Type_Which.INT64:
3613
+ case Type_Which.INT8:
3614
+ case Type_Which.UINT16:
3615
+ case Type_Which.UINT32:
3616
+ case Type_Which.UINT64:
3617
+ case Type_Which.UINT8: {
3618
+ const value = createValue(slot.defaultValue);
3619
+ initializer = `$.${primitive.mask}(${value})`;
3620
+ break;
3621
+ }
3622
+ default: {
3623
+ throw new Error(
3624
+ _chunkKXWOF6H4cjs.format.call(void 0,
3625
+ GEN_UNKNOWN_DEFAULT,
3626
+ whichSlotType
3627
+ )
3628
+ );
3629
+ }
3630
+ }
3631
+ return `default${c2t(name)}: ${initializer}`;
3632
+ }
3633
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateDefaultValue, "generateDefaultValue");
3634
+ function createConcreteListProperty(ctx, field) {
3635
+ const name = `_${c2t(field.name)}`;
3636
+ const type = getJsType(ctx, field.slot.type, true);
3637
+ return `static ${name}: ${type};`;
3638
+ }
3639
+ _chunkUSNT2KNTcjs.__name.call(void 0, createConcreteListProperty, "createConcreteListProperty");
3640
+ function createUnionConstProperty(fullClassName, field) {
3641
+ const name = c2s(field.name);
3642
+ const initializer = `${fullClassName}_Which.${name}`;
3643
+ return `static readonly ${name} = ${initializer};`;
3644
+ }
3645
+ _chunkUSNT2KNTcjs.__name.call(void 0, createUnionConstProperty, "createUnionConstProperty");
3646
+ function createValue(value) {
3647
+ let p;
3648
+ switch (value.which()) {
3649
+ case Value.BOOL: {
3650
+ return value.bool ? `true` : `false`;
3651
+ }
3652
+ case Value.ENUM: {
3653
+ return String(value.enum);
3654
+ }
3655
+ case Value.FLOAT32: {
3656
+ return String(value.float32);
3657
+ }
3658
+ case Value.FLOAT64: {
3659
+ return String(value.float64);
3660
+ }
3661
+ case Value.INT8: {
3662
+ return String(value.int8);
3663
+ }
3664
+ case Value.INT16: {
3665
+ return String(value.int16);
3666
+ }
3667
+ case Value.INT32: {
3668
+ return String(value.int32);
3669
+ }
3670
+ case Value.INT64: {
3671
+ return createBigInt(value.int64);
3672
+ }
3673
+ case Value.UINT8: {
3674
+ return String(value.uint8);
3675
+ }
3676
+ case Value.UINT16: {
3677
+ return String(value.uint16);
3678
+ }
3679
+ case Value.UINT32: {
3680
+ return String(value.uint32);
3681
+ }
3682
+ case Value.UINT64: {
3683
+ return createBigInt(value.uint64);
3684
+ }
3685
+ case Value.TEXT: {
3686
+ return JSON.stringify(value.text);
3687
+ }
3688
+ case Value.VOID: {
3689
+ return "undefined";
3690
+ }
3691
+ case Value.ANY_POINTER: {
3692
+ p = value.anyPointer;
3693
+ break;
3694
+ }
3695
+ case Value.DATA: {
3696
+ p = value.data;
3697
+ break;
3698
+ }
3699
+ case Value.LIST: {
3700
+ p = value.list;
3701
+ break;
3702
+ }
3703
+ case Value.STRUCT: {
3704
+ p = value.struct;
3705
+ break;
3706
+ }
3707
+ case Value.INTERFACE: {
3708
+ _chunkKXWOF6H4cjs.testWhich.call(void 0, "interface", _chunkKXWOF6H4cjs.getUint16.call(void 0, 0, value), 17, value);
3709
+ p = _chunkKXWOF6H4cjs.getPointer.call(void 0, 0, value);
3710
+ break;
3711
+ }
3712
+ default: {
3713
+ throw new Error(_chunkKXWOF6H4cjs.format.call(void 0, GEN_SERIALIZE_UNKNOWN_VALUE, value.which()));
3714
+ }
3715
+ }
3716
+ const message = new (0, _chunkKXWOF6H4cjs.Message)();
3717
+ message.setRoot(p);
3718
+ const buf = new Uint8Array(message.toPackedArrayBuffer());
3719
+ const values = [];
3720
+ for (let i = 0; i < buf.byteLength; i++) {
3721
+ values.push(`0x${_chunkKXWOF6H4cjs.pad.call(void 0, buf[i].toString(16), 2)}`);
3722
+ }
3723
+ return `$.readRawPointer(new Uint8Array([${values.join(",")}]).buffer)`;
3724
+ }
3725
+ _chunkUSNT2KNTcjs.__name.call(void 0, createValue, "createValue");
3726
+ function createNestedNodeProperty(node) {
3727
+ const name = getDisplayNamePrefix(node);
3728
+ const initializer = getFullClassName(node);
3729
+ return `static readonly ${name} = ${initializer};`;
3730
+ }
3731
+ _chunkUSNT2KNTcjs.__name.call(void 0, createNestedNodeProperty, "createNestedNodeProperty");
3732
+ function generateInterfaceNode(ctx, node) {
3733
+ const displayNamePrefix = getDisplayNamePrefix(node);
3734
+ const fullClassName = getFullClassName(node);
3735
+ const nestedNodes = node.nestedNodes.map((n) => lookupNode(ctx, n)).filter((n) => !n._isConst && !n._isAnnotation);
3736
+ const nodeId = node.id;
3737
+ const nodeIdHex = nodeId.toString(16);
3738
+ const consts = ctx.nodes.filter((n) => n.scopeId === nodeId && n._isConst);
3739
+ const members = [];
3740
+ members.push(
3741
+ ...consts.map((node2) => {
3742
+ const name = c2s(getDisplayNamePrefix(node2));
3743
+ const value = createValue(node2.const.value);
3744
+ return `static readonly ${name} = ${value}`;
3745
+ }),
3746
+ ...nestedNodes.map((node2) => createNestedNodeProperty(node2)),
3747
+ `static readonly Client = ${fullClassName}$Client;
3748
+ static readonly Server = ${fullClassName}$Server;
3749
+ public static override readonly _capnp = {
3750
+ displayName: "${displayNamePrefix}",
3751
+ id: "${nodeIdHex}",
3752
+ size: new $.ObjectSize(0, 0),
3753
+ }
3754
+ public override toString(): string { return "${fullClassName}_" + super.toString(); }`
3755
+ );
3756
+ const docComment = extractJSDocs(lookupNodeSourceInfo(ctx, node));
3757
+ const classCode = `
3758
+ ${docComment}
3759
+ export class ${fullClassName} extends $.Interface {
3760
+ ${members.join("\n")}
3761
+ }`;
3762
+ generateInterfaceClasses(ctx, node);
3763
+ ctx.codeParts.push(classCode);
3764
+ }
3765
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateInterfaceNode, "generateInterfaceNode");
3766
+ function generateNode(ctx, node) {
3767
+ const nodeId = node.id;
3768
+ const nodeIdHex = nodeId.toString(16);
3769
+ if (ctx.generatedNodeIds.has(nodeIdHex)) {
3770
+ return;
3771
+ }
3772
+ ctx.generatedNodeIds.add(nodeIdHex);
3773
+ const nestedNodes = node.nestedNodes.map((node2) => lookupNode(ctx, node2));
3774
+ for (const nestedNode of nestedNodes) {
3775
+ generateNode(ctx, nestedNode);
3776
+ }
3777
+ const groupNodes = ctx.nodes.filter(
3778
+ (node2) => node2.scopeId === nodeId && node2._isStruct && node2.struct.isGroup
3779
+ );
3780
+ for (const groupNode of groupNodes) {
3781
+ generateNode(ctx, groupNode);
3782
+ }
3783
+ const nodeType = node.which();
3784
+ switch (nodeType) {
3785
+ case Node.STRUCT: {
3786
+ generateStructNode(ctx, node);
3787
+ break;
3788
+ }
3789
+ case Node.CONST: {
3790
+ break;
3791
+ }
3792
+ case Node.ENUM: {
3793
+ generateEnumNode(
3794
+ ctx,
3795
+ getFullClassName(node),
3796
+ node,
3797
+ node.enum.enumerants.toArray()
3798
+ );
3799
+ break;
3800
+ }
3801
+ case Node.INTERFACE: {
3802
+ generateInterfaceNode(ctx, node);
3803
+ break;
3804
+ }
3805
+ case Node.ANNOTATION: {
3806
+ break;
3807
+ }
3808
+ // case s.Node.FILE:
3809
+ default: {
3810
+ throw new Error(
3811
+ _chunkKXWOF6H4cjs.format.call(void 0,
3812
+ GEN_NODE_UNKNOWN_TYPE,
3813
+ nodeType
3814
+ /* s.Node_Which[whichNode] */
3815
+ )
3816
+ );
3817
+ }
3818
+ }
3819
+ }
3820
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateNode, "generateNode");
3821
+ var CodeGeneratorContext = (_class36 = class {constructor() { _class36.prototype.__init.call(this); }
3822
+ static {
3823
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorContext");
3824
+ }
3825
+ __init() {this.files = []}
3826
+ }, _class36);
3827
+ var CodeGeneratorFileContext = (_class37 = class {
3828
+ static {
3829
+ _chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorFileContext");
3830
+ }
3831
+ constructor(req, file) {;_class37.prototype.__init2.call(this);_class37.prototype.__init3.call(this);_class37.prototype.__init4.call(this);_class37.prototype.__init5.call(this);_class37.prototype.__init6.call(this);
3832
+ this.req = req;
3833
+ this.file = file;
3834
+ this.nodes = req.nodes.toArray();
3835
+ this.imports = file.imports.toArray();
3836
+ }
3837
+ // inputs
3838
+
3839
+
3840
+ // outputs
3841
+ __init2() {this.concreteLists = []}
3842
+ __init3() {this.generatedNodeIds = /* @__PURE__ */ new Set()}
3843
+ __init4() {this.generatedResultsPromiseIds = /* @__PURE__ */ new Set()}
3844
+ __init5() {this.tsPath = ""}
3845
+ __init6() {this.codeParts = []}
3846
+ toString() {
3847
+ return _nullishCoalesce(_optionalChain([this, 'access', _14 => _14.file, 'optionalAccess', _15 => _15.filename]), () => ( "CodeGeneratorFileContext()"));
3848
+ }
3849
+ }, _class37);
3850
+ function generateFileId(ctx) {
3851
+ ctx.codeParts.push(
3852
+ `export const _capnpFileId = BigInt("0x${ctx.file.id.toString(16)}");`
3853
+ );
3854
+ }
3855
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateFileId, "generateFileId");
3856
+ function generateConcreteListInitializer(ctx, fullClassName, field) {
3857
+ const name = `_${c2t(field.name)}`;
3858
+ const type = getConcreteListType(ctx, field.slot.type);
3859
+ ctx.codeParts.push(`${fullClassName}.${name} = ${type};`);
3860
+ }
3861
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateConcreteListInitializer, "generateConcreteListInitializer");
3862
+ function generateCapnpImport(ctx) {
3863
+ const fileNode = lookupNode(ctx, ctx.file);
3864
+ const tsFileId = hexToBigInt(TS_FILE_ID);
3865
+ const tsAnnotationFile = ctx.nodes.find((n) => n.id === tsFileId);
3866
+ const tsImportPathAnnotation = _optionalChain([tsAnnotationFile, 'optionalAccess', _16 => _16.nestedNodes, 'access', _17 => _17.find, 'call', _18 => _18(
3867
+ (n) => n.name === "importPath"
3868
+ )]);
3869
+ const importAnnotation = tsImportPathAnnotation && fileNode.annotations.find((a) => a.id === tsImportPathAnnotation.id);
3870
+ const importPath = importAnnotation === void 0 ? "@stryke/capnp" : importAnnotation.value.text;
3871
+ ctx.codeParts.push(`import * as $ from '${importPath}';`);
3872
+ }
3873
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateCapnpImport, "generateCapnpImport");
3874
+ function generateNestedImports(ctx) {
3875
+ for (const imp of ctx.imports) {
3876
+ const { name } = imp;
3877
+ let importPath;
3878
+ if (name.startsWith("/capnp/")) {
3879
+ importPath = `@stryke/capnp/schemas/${name.slice(7).replace(/\.capnp$/, "")}`;
3880
+ } else {
3881
+ importPath = name.replace(/\.capnp$/, "");
3882
+ if (importPath[0] !== ".") {
3883
+ importPath = `./${importPath}`;
3884
+ }
3885
+ }
3886
+ const importNode = lookupNode(ctx, imp);
3887
+ const imports = getImportNodes(ctx, importNode).flatMap((node) => {
3888
+ const fullClassName = getFullClassName(node);
3889
+ if (node._isInterface) {
3890
+ return [fullClassName, `${fullClassName}$Client`];
3891
+ }
3892
+ return fullClassName;
3893
+ }).sort().join(", ");
3894
+ if (imports.length === 0) {
3895
+ continue;
3896
+ }
3897
+ ctx.codeParts.push(`import { ${imports} } from "${importPath}";`);
3898
+ }
3899
+ }
3900
+ _chunkUSNT2KNTcjs.__name.call(void 0, generateNestedImports, "generateNestedImports");
3901
+ function getImportNodes(ctx, node, visitedIds = /* @__PURE__ */ new Set()) {
3902
+ visitedIds.add(node.id);
3903
+ const nestedNodes = node.nestedNodes.filter(({ id }) => hasNode(ctx, id));
3904
+ const newNestedNodes = nestedNodes.filter(({ id }) => !visitedIds.has(id));
3905
+ const nodes = newNestedNodes.map(({ id }) => lookupNode(ctx, id)).filter((node2) => node2._isStruct || node2._isEnum || node2._isInterface);
3906
+ return nodes.concat(
3907
+ nodes.flatMap((node2) => getImportNodes(ctx, node2, visitedIds))
3908
+ );
3909
+ }
3910
+ _chunkUSNT2KNTcjs.__name.call(void 0, getImportNodes, "getImportNodes");
3911
+ async function compileAll(codeGenRequest, opts) {
3912
+ const req = new (0, _chunkKXWOF6H4cjs.Message)(codeGenRequest, false).getRoot(
3913
+ CodeGeneratorRequest
3914
+ );
3915
+ const ctx = new CodeGeneratorContext();
3916
+ ctx.files = req.requestedFiles.map((file) => loadRequestedFile(req, file));
3917
+ if (ctx.files.length === 0) {
3918
+ throw new Error(GEN_NO_FILES);
3919
+ }
3920
+ const files = new Map(
3921
+ ctx.files.map((file) => [file.tsPath, compileFile(file)])
3922
+ );
3923
+ if (files.size === 0) {
3924
+ throw new Error(GEN_NO_FILES);
3925
+ }
3926
+ if (_optionalChain([opts, 'optionalAccess', _19 => _19.dts]) === true || _optionalChain([opts, 'optionalAccess', _20 => _20.js]) === true) {
3927
+ tsCompile(files, _optionalChain([opts, 'optionalAccess', _21 => _21.dts]) === true, _optionalChain([opts, 'optionalAccess', _22 => _22.js]) === true, _optionalChain([opts, 'optionalAccess', _23 => _23.tsconfig]));
3928
+ }
3929
+ if (!_optionalChain([opts, 'optionalAccess', _24 => _24.ts])) {
3930
+ for (const [fileName] of files) {
3931
+ if (fileName.endsWith(".ts") && !fileName.endsWith(".d.ts")) {
3932
+ files.delete(fileName);
3933
+ }
3934
+ }
3935
+ }
3936
+ return {
3937
+ ctx,
3938
+ files
3939
+ };
3940
+ }
3941
+ _chunkUSNT2KNTcjs.__name.call(void 0, compileAll, "compileAll");
3942
+ function compileFile(ctx) {
3943
+ generateCapnpImport(ctx);
3944
+ generateNestedImports(ctx);
3945
+ generateFileId(ctx);
3946
+ const nestedNodes = lookupNode(ctx, ctx.file).nestedNodes.map(
3947
+ (n) => lookupNode(ctx, n)
3948
+ );
3949
+ for (const node of nestedNodes) {
3950
+ generateNode(ctx, node);
3951
+ }
3952
+ for (const [fullClassName, field] of ctx.concreteLists) {
3953
+ generateConcreteListInitializer(ctx, fullClassName, field);
3954
+ }
3955
+ const sourceFile = _typescript2.default.createSourceFile(
3956
+ ctx.tsPath,
3957
+ ctx.codeParts.map((p) => p.toString()).join(""),
3958
+ _typescript2.default.ScriptTarget.Latest,
3959
+ false,
3960
+ _typescript2.default.ScriptKind.TS
3961
+ );
3962
+ return SOURCE_COMMENT + _typescript2.default.createPrinter().printFile(sourceFile);
3963
+ }
3964
+ _chunkUSNT2KNTcjs.__name.call(void 0, compileFile, "compileFile");
3965
+ function tsCompile(files, dts, js, tsconfig) {
3966
+ if (!dts && !js) {
3967
+ return;
3968
+ }
3969
+ const compileOptions = {
3970
+ moduleResolution: _typescript2.default.ModuleResolutionKind.Bundler,
3971
+ target: _typescript2.default.ScriptTarget.ESNext,
3972
+ strict: true,
3973
+ ...tsconfig,
3974
+ noEmitOnError: false,
3975
+ noFallthroughCasesInSwitch: true,
3976
+ preserveConstEnums: true,
3977
+ noImplicitReturns: true,
3978
+ noUnusedLocals: false,
3979
+ noUnusedParameters: false,
3980
+ removeComments: false,
3981
+ skipLibCheck: true,
3982
+ sourceMap: false,
3983
+ emitDeclarationOnly: dts && !js,
3984
+ declaration: dts
3985
+ };
3986
+ const compilerHost = _typescript2.default.createCompilerHost(compileOptions);
3987
+ compilerHost.writeFile = (fileName, declaration) => {
3988
+ files.set(fileName, declaration);
3989
+ };
3990
+ const _readFile = compilerHost.readFile;
3991
+ compilerHost.readFile = (filename) => {
3992
+ if (files.has(filename)) {
3993
+ return files.get(filename);
3994
+ }
3995
+ return _readFile(filename);
3996
+ };
3997
+ const program = _typescript2.default.createProgram(
3998
+ [...files.keys()],
3999
+ compileOptions,
4000
+ compilerHost
4001
+ );
4002
+ const emitResult = program.emit();
4003
+ const allDiagnostics = [
4004
+ ..._typescript2.default.getPreEmitDiagnostics(program),
4005
+ ...emitResult.diagnostics
4006
+ ];
4007
+ if (allDiagnostics.length > 0) {
4008
+ for (const diagnostic of allDiagnostics) {
4009
+ const message = _typescript2.default.flattenDiagnosticMessageText(
4010
+ diagnostic.messageText,
4011
+ "\n"
4012
+ );
4013
+ if (diagnostic.file && diagnostic.start) {
4014
+ const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
4015
+ console.log(
4016
+ `${diagnostic.file.fileName}:${line + 1}:${character + 1} ${message}`
4017
+ );
4018
+ } else {
4019
+ console.log(`==> ${message}`);
4020
+ }
4021
+ }
4022
+ throw new Error(GEN_TS_EMIT_FAILED);
4023
+ }
4024
+ }
4025
+ _chunkUSNT2KNTcjs.__name.call(void 0, tsCompile, "tsCompile");
4026
+
4027
+ // ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/compiler/index.mjs
4028
+
4029
+
4030
+ // src/compile.ts
4031
+ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
4032
+ var _buffer = require('buffer');
4033
+ var _child_process = require('child_process');
4034
+ async function capnpc(options) {
4035
+ const { output, tsconfig, schemas = [], tty } = options;
4036
+ let dataBuf = _buffer.Buffer.alloc(0);
4037
+ if (tty) {
4038
+ const chunks = [];
4039
+ process.stdin.on("data", (chunk) => {
4040
+ chunks.push(chunk);
4041
+ });
4042
+ await new Promise((resolve) => {
4043
+ process.stdin.on("end", resolve);
4044
+ });
4045
+ const reqBuffer = _buffer.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
4046
+ let i = 0;
4047
+ for (const chunk of chunks) {
4048
+ chunk.copy(reqBuffer, i);
4049
+ i += chunk.byteLength;
4050
+ }
4051
+ dataBuf = reqBuffer;
4052
+ }
4053
+ if (dataBuf.byteLength === 0) {
4054
+ const opts = [];
4055
+ if (output) {
4056
+ opts.push(`-o-:${output}`);
4057
+ } else {
4058
+ opts.push("-o-");
4059
+ }
4060
+ dataBuf = await new Promise((resolve) => {
4061
+ _child_process.exec.call(void 0, `capnpc ${opts.join(" ")} ${schemas.join(" ")}`, {
4062
+ encoding: "buffer"
4063
+ }, (error, stdout, stderr) => {
4064
+ if (stderr.length > 0) {
4065
+ process.stderr.write(stderr);
4066
+ }
4067
+ if (error) {
4068
+ throw error;
4069
+ }
4070
+ resolve(stdout);
4071
+ });
4072
+ });
4073
+ }
4074
+ return compileAll(dataBuf, {
4075
+ ts: _nullishCoalesce(options.ts, () => ( true)),
4076
+ js: false,
4077
+ dts: false,
4078
+ tsconfig: tsconfig.options
4079
+ });
4080
+ }
4081
+ _chunkUSNT2KNTcjs.__name.call(void 0, capnpc, "capnpc");
4082
+ async function compile(dataBuf, options) {
4083
+ const resolvedOptions = await _chunk3ZOLKZQQcjs.resolveOptions.call(void 0, options);
4084
+ if (!resolvedOptions) {
4085
+ _console.writeWarning.call(void 0, "\u2716 Unable to resolve Cap'n Proto compiler options - the program will terminate", {
4086
+ logLevel: "all"
4087
+ });
4088
+ return;
4089
+ }
4090
+ return compileAll(dataBuf, _defu2.default.call(void 0, {
4091
+ tsconfig: resolvedOptions.tsconfig.options
4092
+ }, resolvedOptions, {
4093
+ ts: true,
4094
+ js: false,
4095
+ dts: false
4096
+ }));
4097
+ }
4098
+ _chunkUSNT2KNTcjs.__name.call(void 0, compile, "compile");
4099
+
4100
+
4101
+
4102
+
4103
+ exports.capnpc = capnpc; exports.compile = compile;