@stryke/capnp 0.12.96 → 0.12.97

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 (119) hide show
  1. package/bin/capnpc.cjs +405 -304
  2. package/bin/capnpc.d.cts +909 -4
  3. package/bin/capnpc.d.cts.map +1 -1
  4. package/bin/capnpc.d.mts +909 -4
  5. package/bin/capnpc.d.mts.map +1 -1
  6. package/bin/capnpc.mjs +368 -268
  7. package/bin/capnpc.mjs.map +1 -1
  8. package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts +2991 -0
  9. package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts.map +1 -0
  10. package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts +2991 -0
  11. package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts.map +1 -0
  12. package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs → capnp-es.GpvEvMIK-CH8kq1KS.mjs} +13 -6
  13. package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs.map → capnp-es.GpvEvMIK-CH8kq1KS.mjs.map} +1 -1
  14. package/dist/{capnp-es.GpvEvMIK-BcYm5JyH.cjs → capnp-es.GpvEvMIK-CZ5ZimCD.cjs} +12 -5
  15. package/dist/{compile-Cx88xgqJ.mjs → compile-D_BOc0dD.mjs} +109 -15
  16. package/dist/compile-D_BOc0dD.mjs.map +1 -0
  17. package/dist/{compile-SmxAaHxW.cjs → compile-Yq1zhccM.cjs} +113 -19
  18. package/dist/compile.cjs +2 -2
  19. package/dist/compile.d.cts +38 -3
  20. package/dist/compile.d.cts.map +1 -0
  21. package/dist/compile.d.mts +38 -3
  22. package/dist/compile.d.mts.map +1 -0
  23. package/dist/compile.mjs +1 -2
  24. package/dist/{dist-BlvFBzSi.mjs → dist-DQ7xmzRT.mjs} +385 -16
  25. package/dist/dist-DQ7xmzRT.mjs.map +1 -0
  26. package/dist/{dist-YywzZL3Q.cjs → dist-VMGxvENY.cjs} +381 -12
  27. package/dist/{helpers-BoYAadSB.mjs → helpers-2TldkyGG.mjs} +136 -137
  28. package/dist/helpers-2TldkyGG.mjs.map +1 -0
  29. package/dist/{helpers-gxlsFdP8.cjs → helpers-Dn4nWOb7.cjs} +164 -165
  30. package/dist/helpers.cjs +2 -1
  31. package/dist/helpers.d.cts +1 -2
  32. package/dist/helpers.d.cts.map +1 -1
  33. package/dist/helpers.d.mts +1 -2
  34. package/dist/helpers.d.mts.map +1 -1
  35. package/dist/helpers.mjs +1 -1
  36. package/dist/index-63Za7yNc.d.cts +736 -0
  37. package/dist/index-63Za7yNc.d.cts.map +1 -0
  38. package/dist/index-LYXu6eWz.d.mts +736 -0
  39. package/dist/index-LYXu6eWz.d.mts.map +1 -0
  40. package/dist/index.cjs +5 -5
  41. package/dist/index.d.cts +5 -4
  42. package/dist/index.d.mts +5 -4
  43. package/dist/index.mjs +4 -5
  44. package/dist/rpc-helpers.cjs +4 -3
  45. package/dist/rpc-helpers.d.cts +3 -4
  46. package/dist/rpc-helpers.d.cts.map +1 -1
  47. package/dist/rpc-helpers.d.mts +3 -4
  48. package/dist/rpc-helpers.d.mts.map +1 -1
  49. package/dist/rpc-helpers.mjs +2 -2
  50. package/dist/types-BjCOVfgj.d.cts +1506 -0
  51. package/dist/types-BjCOVfgj.d.cts.map +1 -0
  52. package/dist/types-CVzMn-TI.d.mts +1506 -0
  53. package/dist/types-CVzMn-TI.d.mts.map +1 -0
  54. package/dist/types.cjs +8 -2
  55. package/dist/types.d.cts +1 -1
  56. package/dist/types.d.mts +1 -1
  57. package/dist/types.mjs +7 -2
  58. package/dist/types.mjs.map +1 -0
  59. package/package.json +5 -5
  60. package/schemas/cpp.cjs +1 -0
  61. package/schemas/cpp.d.cts.map +1 -1
  62. package/schemas/cpp.d.mts.map +1 -1
  63. package/schemas/index-BB47pUzp.d.cts +742 -0
  64. package/schemas/index-BB47pUzp.d.cts.map +1 -0
  65. package/schemas/index-DprjZUdT.d.mts +742 -0
  66. package/schemas/index-DprjZUdT.d.mts.map +1 -0
  67. package/schemas/persistent.cjs +2 -1
  68. package/schemas/persistent.d.cts +48 -21
  69. package/schemas/persistent.d.cts.map +1 -1
  70. package/schemas/persistent.d.mts +48 -21
  71. package/schemas/persistent.d.mts.map +1 -1
  72. package/schemas/persistent.mjs +1 -1
  73. package/schemas/persistent.mjs.map +1 -1
  74. package/schemas/rpc-twoparty.cjs +20 -1
  75. package/schemas/rpc-twoparty.d.cts +17 -17
  76. package/schemas/rpc-twoparty.d.cts.map +1 -1
  77. package/schemas/rpc-twoparty.d.mts +17 -17
  78. package/schemas/rpc-twoparty.d.mts.map +1 -1
  79. package/schemas/rpc-twoparty.mjs +19 -1
  80. package/schemas/rpc-twoparty.mjs.map +1 -1
  81. package/schemas/rpc.cjs +371 -1
  82. package/schemas/rpc.d.cts +141 -141
  83. package/schemas/rpc.d.cts.map +1 -1
  84. package/schemas/rpc.d.mts +141 -141
  85. package/schemas/rpc.d.mts.map +1 -1
  86. package/schemas/rpc.mjs +370 -1
  87. package/schemas/rpc.mjs.map +1 -1
  88. package/schemas/schema.cjs +96 -1
  89. package/schemas/schema.d.cts +286 -228
  90. package/schemas/schema.d.cts.map +1 -1
  91. package/schemas/schema.d.mts +286 -228
  92. package/schemas/schema.d.mts.map +1 -1
  93. package/schemas/schema.mjs +95 -1
  94. package/schemas/schema.mjs.map +1 -1
  95. package/schemas/{src-2eLj6yCr.cjs → src-B6FhDNiV.cjs} +19 -12
  96. package/schemas/{src-s2pCu2mc.mjs → src-B97sIXSw.mjs} +19 -13
  97. package/schemas/src-B97sIXSw.mjs.map +1 -0
  98. package/schemas/ts.cjs +1 -0
  99. package/schemas/ts.d.cts.map +1 -1
  100. package/schemas/ts.d.mts.map +1 -1
  101. package/dist/compile-Cx88xgqJ.mjs.map +0 -1
  102. package/dist/compile-DccxA7WZ.d.cts +0 -40
  103. package/dist/compile-DccxA7WZ.d.cts.map +0 -1
  104. package/dist/compile-UkKIpqrK.d.mts +0 -40
  105. package/dist/compile-UkKIpqrK.d.mts.map +0 -1
  106. package/dist/dist-BlvFBzSi.mjs.map +0 -1
  107. package/dist/helpers-BoYAadSB.mjs.map +0 -1
  108. package/dist/types-Cuj2daUE.mjs +0 -8
  109. package/dist/types-Cuj2daUE.mjs.map +0 -1
  110. package/dist/types-D03SjfBL.d.mts +0 -55
  111. package/dist/types-D03SjfBL.d.mts.map +0 -1
  112. package/dist/types-D52qMMoK.d.cts +0 -55
  113. package/dist/types-D52qMMoK.d.cts.map +0 -1
  114. package/dist/types-DHrjS-69.cjs +0 -13
  115. package/schemas/index-BAJMwFip.d.mts +0 -96
  116. package/schemas/index-BAJMwFip.d.mts.map +0 -1
  117. package/schemas/index-b7dam4EA.d.cts +0 -96
  118. package/schemas/index-b7dam4EA.d.cts.map +0 -1
  119. package/schemas/src-s2pCu2mc.mjs.map +0 -1
@@ -1,10 +1,10 @@
1
- const require_helpers = require('./helpers-gxlsFdP8.cjs');
2
- const require_capnp_es_GpvEvMIK = require('./capnp-es.GpvEvMIK-BcYm5JyH.cjs');
3
- let __stryke_fs_exists = require("@stryke/fs/exists");
1
+ const require_helpers = require('./helpers-Dn4nWOb7.cjs');
2
+ const require_capnp_es_GpvEvMIK = require('./capnp-es.GpvEvMIK-CZ5ZimCD.cjs');
3
+ let _stryke_fs_exists = require("@stryke/fs/exists");
4
4
  let typescript = require("typescript");
5
- typescript = require_helpers.__toESM(typescript);
5
+ typescript = require_helpers.__toESM(typescript, 1);
6
6
  let defu = require("defu");
7
- defu = require_helpers.__toESM(defu);
7
+ defu = require_helpers.__toESM(defu, 1);
8
8
  let node_buffer = require("node:buffer");
9
9
  let node_child_process = require("node:child_process");
10
10
 
@@ -495,10 +495,38 @@ var Node_Annotation = class extends require_capnp_es_GpvEvMIK.Struct {
495
495
  };
496
496
  const Node_Which = {
497
497
  FILE: 0,
498
+ /**
499
+ * Name to present to humans to identify this Node. You should not attempt to parse this. Its
500
+ * format could change. It is not guaranteed to be unique.
501
+ *
502
+ * (On Zooko's triangle, this is the node's nickname.)
503
+ *
504
+ */
498
505
  STRUCT: 1,
506
+ /**
507
+ * If you want a shorter version of `displayName` (just naming this node, without its surrounding
508
+ * scope), chop off this many characters from the beginning of `displayName`.
509
+ *
510
+ */
499
511
  ENUM: 2,
512
+ /**
513
+ * ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back
514
+ * at this node, but robust code should avoid relying on this (and, in fact, group nodes are not
515
+ * listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is
516
+ * zero if the node has no parent, which is normally only the case with files, but should be
517
+ * allowed for any kind of node (in order to make runtime type generation easier).
518
+ *
519
+ */
500
520
  INTERFACE: 3,
521
+ /**
522
+ * List of nodes nested within this node, along with the names under which they were declared.
523
+ *
524
+ */
501
525
  CONST: 4,
526
+ /**
527
+ * Annotations applied to this node.
528
+ *
529
+ */
502
530
  ANNOTATION: 5
503
531
  };
504
532
  var Node = class Node extends require_capnp_es_GpvEvMIK.Struct {
@@ -816,6 +844,13 @@ var Field_Group = class extends require_capnp_es_GpvEvMIK.Struct {
816
844
  };
817
845
  const Field_Ordinal_Which = {
818
846
  IMPLICIT: 0,
847
+ /**
848
+ * The original ordinal number given to the field. You probably should NOT use this; if you need
849
+ * a numeric identifier for a field, use its position within the field array for its scope.
850
+ * The ordinal is given here mainly just so that the original schema text can be reproduced given
851
+ * the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.
852
+ *
853
+ */
819
854
  EXPLICIT: 1
820
855
  };
821
856
  var Field_Ordinal = class extends require_capnp_es_GpvEvMIK.Struct {
@@ -859,6 +894,15 @@ var Field_Ordinal = class extends require_capnp_es_GpvEvMIK.Struct {
859
894
  };
860
895
  const Field_Which = {
861
896
  SLOT: 0,
897
+ /**
898
+ * Indicates where this member appeared in the code, relative to other members.
899
+ * Code ordering may have semantic relevance -- programmers tend to place related fields
900
+ * together. So, using code ordering makes sense in human-readable formats where ordering is
901
+ * otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum
902
+ * value is count(members) - 1. Fields that are members of a union are only ordered relative to
903
+ * the other members of that union, so the maximum value there is count(union.members).
904
+ *
905
+ */
862
906
  GROUP: 1
863
907
  };
864
908
  var Field = class Field extends require_capnp_es_GpvEvMIK.Struct {
@@ -1322,9 +1366,25 @@ var Type_Interface = class extends require_capnp_es_GpvEvMIK.Struct {
1322
1366
  }
1323
1367
  };
1324
1368
  const Type_AnyPointer_Unconstrained_Which = {
1369
+ /**
1370
+ * truly AnyPointer
1371
+ *
1372
+ */
1325
1373
  ANY_KIND: 0,
1374
+ /**
1375
+ * AnyStruct
1376
+ *
1377
+ */
1326
1378
  STRUCT: 1,
1379
+ /**
1380
+ * AnyList
1381
+ *
1382
+ */
1327
1383
  LIST: 2,
1384
+ /**
1385
+ * Capability
1386
+ *
1387
+ */
1328
1388
  CAPABILITY: 3
1329
1389
  };
1330
1390
  var Type_AnyPointer_Unconstrained = class extends require_capnp_es_GpvEvMIK.Struct {
@@ -1416,8 +1476,25 @@ var Type_AnyPointer_ImplicitMethodParameter = class extends require_capnp_es_Gpv
1416
1476
  }
1417
1477
  };
1418
1478
  const Type_AnyPointer_Which = {
1479
+ /**
1480
+ * A regular AnyPointer.
1481
+ *
1482
+ * The name "unconstrained" means as opposed to constraining it to match a type parameter.
1483
+ * In retrospect this name is probably a poor choice given that it may still be constrained
1484
+ * to be a struct, list, or capability.
1485
+ *
1486
+ */
1419
1487
  UNCONSTRAINED: 0,
1488
+ /**
1489
+ * This is actually a reference to a type parameter defined within this scope.
1490
+ *
1491
+ */
1420
1492
  PARAMETER: 1,
1493
+ /**
1494
+ * This is actually a reference to an implicit (generic) parameter of a method. The only
1495
+ * legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.
1496
+ *
1497
+ */
1421
1498
  IMPLICIT_METHOD_PARAMETER: 2
1422
1499
  };
1423
1500
  var Type_AnyPointer = class extends require_capnp_es_GpvEvMIK.Struct {
@@ -1703,7 +1780,15 @@ var Type = class extends require_capnp_es_GpvEvMIK.Struct {
1703
1780
  }
1704
1781
  };
1705
1782
  const Brand_Scope_Which = {
1783
+ /**
1784
+ * ID of the scope to which these params apply.
1785
+ *
1786
+ */
1706
1787
  BIND: 0,
1788
+ /**
1789
+ * List of parameter bindings.
1790
+ *
1791
+ */
1707
1792
  INHERIT: 1
1708
1793
  };
1709
1794
  var Brand_Scope = class Brand_Scope extends require_capnp_es_GpvEvMIK.Struct {
@@ -1872,6 +1957,11 @@ const Value_Which = {
1872
1957
  LIST: 14,
1873
1958
  ENUM: 15,
1874
1959
  STRUCT: 16,
1960
+ /**
1961
+ * The only interface value that can be represented statically is "null", whose methods always
1962
+ * throw exceptions.
1963
+ *
1964
+ */
1875
1965
  INTERFACE: 17,
1876
1966
  ANY_POINTER: 18
1877
1967
  };
@@ -2213,6 +2303,10 @@ var Annotation = class extends require_capnp_es_GpvEvMIK.Struct {
2213
2303
  }
2214
2304
  };
2215
2305
  const ElementSize = {
2306
+ /**
2307
+ * aka "void", but that's a keyword.
2308
+ *
2309
+ */
2216
2310
  EMPTY: 0,
2217
2311
  BIT: 1,
2218
2312
  BYTE: 2,
@@ -3048,16 +3142,16 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3048
3142
  const maybeDefaultArg = hadExplicitDefault ? `, ${fullClassName}._capnp.default${capitalizedName}` : "";
3049
3143
  const union = discriminantValue !== Field.NO_DISCRIMINANT;
3050
3144
  const offset = field._isSlot ? field.slot.offset : 0;
3051
- let adopt$1 = false;
3052
- let disown$1 = false;
3145
+ let adopt = false;
3146
+ let disown = false;
3053
3147
  let has = false;
3054
3148
  let init;
3055
3149
  let get;
3056
3150
  let set;
3057
3151
  switch (whichType) {
3058
3152
  case Type.ANY_POINTER:
3059
- adopt$1 = true;
3060
- disown$1 = true;
3153
+ adopt = true;
3154
+ disown = true;
3061
3155
  has = true;
3062
3156
  get = `$.utils.getPointer(${offset}, this${maybeDefaultArg})`;
3063
3157
  set = `$.utils.copyFrom(value, ${get})`;
@@ -3082,8 +3176,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3082
3176
  break;
3083
3177
  }
3084
3178
  case Type.DATA:
3085
- adopt$1 = true;
3086
- disown$1 = true;
3179
+ adopt = true;
3180
+ disown = true;
3087
3181
  has = true;
3088
3182
  get = `$.utils.getData(${offset}, this${maybeDefaultArg})`;
3089
3183
  set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
@@ -3098,8 +3192,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3098
3192
  let listClass = ConcreteListType[elementType];
3099
3193
  if (elementType === Type.LIST || elementType === Type.STRUCT) listClass = `${fullClassName}._${capitalizedName}`;
3100
3194
  else if (listClass === void 0) throw new Error(require_capnp_es_GpvEvMIK.format(GEN_UNSUPPORTED_LIST_ELEMENT_TYPE, elementType));
3101
- adopt$1 = true;
3102
- disown$1 = true;
3195
+ adopt = true;
3196
+ disown = true;
3103
3197
  has = true;
3104
3198
  get = `$.utils.getList(${offset}, ${listClass}, this${maybeDefaultArg})`;
3105
3199
  set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
@@ -3111,8 +3205,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3111
3205
  break;
3112
3206
  }
3113
3207
  case Type.STRUCT:
3114
- adopt$1 = true;
3115
- disown$1 = true;
3208
+ adopt = true;
3209
+ disown = true;
3116
3210
  has = true;
3117
3211
  get = `$.utils.getStruct(${offset}, ${jsType}, this${maybeDefaultArg})`;
3118
3212
  set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
@@ -3129,13 +3223,13 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
3129
3223
  init = get;
3130
3224
  break;
3131
3225
  }
3132
- if (adopt$1) members.push(`
3226
+ if (adopt) members.push(`
3133
3227
  _adopt${capitalizedName}(value: $.Orphan<${jsType}>): void {
3134
3228
  ${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
3135
3229
  $.utils.adopt(value, $.utils.getPointer(${offset}, this));
3136
3230
  }
3137
3231
  `);
3138
- if (disown$1) members.push(`
3232
+ if (disown) members.push(`
3139
3233
  _disown${capitalizedName}(): $.Orphan<${jsType}> {
3140
3234
  return $.utils.disown(this.${name === "constructor" ? `$${name}` : name});
3141
3235
  }
@@ -3481,9 +3575,9 @@ async function capnpc(options) {
3481
3575
  }
3482
3576
  if (dataBuf.byteLength === 0) {
3483
3577
  const opts = [];
3484
- if (output && (0, __stryke_fs_exists.existsSync)(output)) opts.push(`-o-:${output}`);
3578
+ if (output && (0, _stryke_fs_exists.existsSync)(output)) opts.push(`-o-:${output}`);
3485
3579
  else {
3486
- if (output && !(0, __stryke_fs_exists.existsSync)(output)) require_helpers.writeWarning(`Output directory "${output}" does not exist, will write to schema path...`);
3580
+ if (output && !(0, _stryke_fs_exists.existsSync)(output)) require_helpers.writeWarning(`Output directory "${output}" does not exist, will write to schema path...`);
3487
3581
  opts.push("-o-");
3488
3582
  }
3489
3583
  dataBuf = await new Promise((resolve) => {
package/dist/compile.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./helpers-gxlsFdP8.cjs');
2
- const require_compile = require('./compile-SmxAaHxW.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_compile = require('./compile-Yq1zhccM.cjs');
3
3
 
4
4
  exports.capnpc = require_compile.capnpc;
5
5
  exports.compile = require_compile.compile;
@@ -1,3 +1,38 @@
1
- import "./types-D52qMMoK.cjs";
2
- import { n as compile, t as capnpc } from "./compile-DccxA7WZ.cjs";
3
- export { capnpc, compile };
1
+ import { c as CodeGeneratorRequest_RequestedFile, d as Node, i as CapnpcResult, l as CodeGeneratorRequest_RequestedFile_Import, n as CapnpcOptions, r as CapnpcResolvedOptions, s as CodeGeneratorRequest, u as Field } from "./types-BjCOVfgj.cjs";
2
+ import { Buffer } from "node:buffer";
3
+
4
+ //#region src/compile.d.ts
5
+ /**
6
+ * Compiles Cap'n Proto schemas into TypeScript files.
7
+ *
8
+ * @param options - The options for the compilation process.
9
+ * @returns A promise that resolves to the compilation result.
10
+ */
11
+ declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
12
+ /**
13
+ * Compiles Cap'n Proto schemas into TypeScript files.
14
+ *
15
+ * @param dataBuf - The buffer containing the Cap'n Proto schema data.
16
+ * @param options - The options for the compilation process.
17
+ * @returns A promise that resolves to the compilation result.
18
+ */
19
+ declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
20
+ ctx: {
21
+ files: {
22
+ readonly req: CodeGeneratorRequest;
23
+ readonly file: CodeGeneratorRequest_RequestedFile;
24
+ readonly nodes: Node[];
25
+ readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
26
+ concreteLists: Array<[string, Field]>;
27
+ generatedNodeIds: Set<string>;
28
+ generatedResultsPromiseIds: Set<bigint>;
29
+ tsPath: string;
30
+ codeParts: string[];
31
+ toString(): string;
32
+ }[];
33
+ };
34
+ files: Map<string, string>;
35
+ } | undefined>;
36
+ //#endregion
37
+ export { capnpc, compile };
38
+ //# sourceMappingURL=compile.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.cts","names":[],"sources":["../../src/compile.ts"],"mappings":";;;;;;AAqCA;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,qBAAA,GACR,OAAA,CAAQ,YAAA;;;;;;;;iBA0EW,OAAA,CAAQ,OAAA,EAAS,MAAA,EAAQ,OAAA,EAAS,aAAA,GAAa,OAAA;;;oBAAA,oBAAA;MAAA"}
@@ -1,3 +1,38 @@
1
- import "./types-D03SjfBL.mjs";
2
- import { n as compile, t as capnpc } from "./compile-UkKIpqrK.mjs";
3
- export { capnpc, compile };
1
+ import { c as CodeGeneratorRequest_RequestedFile, d as Node, i as CapnpcResult, l as CodeGeneratorRequest_RequestedFile_Import, n as CapnpcOptions, r as CapnpcResolvedOptions, s as CodeGeneratorRequest, u as Field } from "./types-CVzMn-TI.mjs";
2
+ import { Buffer } from "node:buffer";
3
+
4
+ //#region src/compile.d.ts
5
+ /**
6
+ * Compiles Cap'n Proto schemas into TypeScript files.
7
+ *
8
+ * @param options - The options for the compilation process.
9
+ * @returns A promise that resolves to the compilation result.
10
+ */
11
+ declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
12
+ /**
13
+ * Compiles Cap'n Proto schemas into TypeScript files.
14
+ *
15
+ * @param dataBuf - The buffer containing the Cap'n Proto schema data.
16
+ * @param options - The options for the compilation process.
17
+ * @returns A promise that resolves to the compilation result.
18
+ */
19
+ declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
20
+ ctx: {
21
+ files: {
22
+ readonly req: CodeGeneratorRequest;
23
+ readonly file: CodeGeneratorRequest_RequestedFile;
24
+ readonly nodes: Node[];
25
+ readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
26
+ concreteLists: Array<[string, Field]>;
27
+ generatedNodeIds: Set<string>;
28
+ generatedResultsPromiseIds: Set<bigint>;
29
+ tsPath: string;
30
+ codeParts: string[];
31
+ toString(): string;
32
+ }[];
33
+ };
34
+ files: Map<string, string>;
35
+ } | undefined>;
36
+ //#endregion
37
+ export { capnpc, compile };
38
+ //# sourceMappingURL=compile.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.mts","names":[],"sources":["../../src/compile.ts"],"mappings":";;;;;;AAqCA;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,qBAAA,GACR,OAAA,CAAQ,YAAA;;;;;;;;iBA0EW,OAAA,CAAQ,OAAA,EAAS,MAAA,EAAQ,OAAA,EAAS,aAAA,GAAa,OAAA;;;oBAAA,oBAAA;MAAA"}
package/dist/compile.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import "./helpers-BoYAadSB.mjs";
2
- import { n as compile, t as capnpc } from "./compile-Cx88xgqJ.mjs";
1
+ import { n as compile, t as capnpc } from "./compile-D_BOc0dD.mjs";
3
2
 
4
3
  export { capnpc, compile };