@stryke/capnp 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,13 +1,129 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-AHJJINE5.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkM5QB7J6Hcjs = require('./chunk-M5QB7J6H.cjs');
5
4
 
6
5
 
7
- var _chunkCFDWCYSUcjs = require('./chunk-CFDWCYSU.cjs');
8
- require('./chunk-5MK6PQWW.cjs');
9
- require('./chunk-ORA4UQMU.cjs');
10
6
 
11
7
 
12
8
 
13
- exports.capnp = _chunkCFDWCYSUcjs.dist_exports; exports.capnpc = _chunkM5QB7J6Hcjs.capnpc;
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
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+ var _chunkX74MKAHTcjs = require('./chunk-X74MKAHT.cjs');
63
+
64
+
65
+ var _chunkR2JXWA7Qcjs = require('./chunk-R2JXWA7Q.cjs');
66
+ require('./chunk-USNT2KNT.cjs');
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ exports.AnyPointerList = _chunkX74MKAHTcjs.AnyPointerList; exports.BoolList = _chunkX74MKAHTcjs.BoolList; exports.CapnpRPC = _chunkX74MKAHTcjs.CapnpRPC; exports.CodeGeneratorContext = _chunkR2JXWA7Qcjs.CodeGeneratorContext; exports.CompositeList = _chunkX74MKAHTcjs.CompositeList; exports.Conn = _chunkX74MKAHTcjs.Conn; exports.Data = _chunkX74MKAHTcjs.Data; exports.DataList = _chunkX74MKAHTcjs.DataList; exports.Deferred = _chunkX74MKAHTcjs.Deferred; exports.DeferredTransport = _chunkX74MKAHTcjs.DeferredTransport; exports.ErrorClient = _chunkX74MKAHTcjs.ErrorClient; exports.Float32List = _chunkX74MKAHTcjs.Float32List; exports.Float64List = _chunkX74MKAHTcjs.Float64List; exports.Int16List = _chunkX74MKAHTcjs.Int16List; exports.Int32List = _chunkX74MKAHTcjs.Int32List; exports.Int64List = _chunkX74MKAHTcjs.Int64List; exports.Int8List = _chunkX74MKAHTcjs.Int8List; exports.Interface = _chunkX74MKAHTcjs.Interface; exports.InterfaceList = _chunkX74MKAHTcjs.InterfaceList; exports.List = _chunkX74MKAHTcjs.List; exports.ListElementSize = _chunkX74MKAHTcjs.ListElementSize; exports.Message = _chunkX74MKAHTcjs.Message; exports.MessageChannelTransport = _chunkX74MKAHTcjs.MessageChannelTransport; exports.ObjectSize = _chunkX74MKAHTcjs.ObjectSize; exports.Orphan = _chunkX74MKAHTcjs.Orphan; exports.Pipeline = _chunkX74MKAHTcjs.Pipeline; exports.Pointer = _chunkX74MKAHTcjs.Pointer; exports.PointerList = _chunkX74MKAHTcjs.PointerList; exports.PointerType = _chunkX74MKAHTcjs.PointerType; exports.Registry = _chunkX74MKAHTcjs.Registry; exports.Server = _chunkX74MKAHTcjs.Server; exports.Struct = _chunkX74MKAHTcjs.Struct; exports.Text = _chunkX74MKAHTcjs.Text; exports.TextList = _chunkX74MKAHTcjs.TextList; exports.Uint16List = _chunkX74MKAHTcjs.Uint16List; exports.Uint32List = _chunkX74MKAHTcjs.Uint32List; exports.Uint64List = _chunkX74MKAHTcjs.Uint64List; exports.Uint8List = _chunkX74MKAHTcjs.Uint8List; exports.Void = _chunkX74MKAHTcjs.Void; exports.VoidList = _chunkX74MKAHTcjs.VoidList; exports.answerPipelineClient = _chunkX74MKAHTcjs.answerPipelineClient; exports.clientFromResolution = _chunkX74MKAHTcjs.clientFromResolution; exports.clientOrNull = _chunkX74MKAHTcjs.clientOrNull; exports.copyCall = _chunkX74MKAHTcjs.copyCall; exports.getBitMask = _chunkX74MKAHTcjs.getBitMask; exports.getFloat32Mask = _chunkX74MKAHTcjs.getFloat32Mask; exports.getFloat64Mask = _chunkX74MKAHTcjs.getFloat64Mask; exports.getInt16Mask = _chunkX74MKAHTcjs.getInt16Mask; exports.getInt32Mask = _chunkX74MKAHTcjs.getInt32Mask; exports.getInt64Mask = _chunkX74MKAHTcjs.getInt64Mask; exports.getInt8Mask = _chunkX74MKAHTcjs.getInt8Mask; exports.getUint16Mask = _chunkX74MKAHTcjs.getUint16Mask; exports.getUint32Mask = _chunkX74MKAHTcjs.getUint32Mask; exports.getUint64Mask = _chunkX74MKAHTcjs.getUint64Mask; exports.getUint8Mask = _chunkX74MKAHTcjs.getUint8Mask; exports.isDataCall = _chunkX74MKAHTcjs.isDataCall; exports.isFuncCall = _chunkX74MKAHTcjs.isFuncCall; exports.isSameClient = _chunkX74MKAHTcjs.isSameClient; exports.placeParams = _chunkX74MKAHTcjs.placeParams; exports.readRawPointer = _chunkX74MKAHTcjs.readRawPointer; exports.utils = _chunkX74MKAHTcjs.utils;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- import * as capnpEs from 'capnp-es';
2
- export { capnpEs as capnp };
3
- export { capnpc } from './compile.cjs';
1
+ export { CapnpRPC, MessageChannelTransport } from './rpc.cjs';
4
2
  export { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.cjs';
3
+ export * from 'capnp-es';
4
+ import 'capnp-es/capnp/rpc';
5
+ import 'node:worker_threads';
5
6
  import 'capnp-es/capnp/schema';
6
7
  import 'typescript';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import * as capnpEs from 'capnp-es';
2
- export { capnpEs as capnp };
3
- export { capnpc } from './compile.js';
1
+ export { CapnpRPC, MessageChannelTransport } from './rpc.js';
4
2
  export { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.js';
3
+ export * from 'capnp-es';
4
+ import 'capnp-es/capnp/rpc';
5
+ import 'node:worker_threads';
5
6
  import 'capnp-es/capnp/schema';
6
7
  import 'typescript';
package/dist/index.js CHANGED
@@ -1,13 +1,129 @@
1
- import "./chunk-TZHOQHWF.js";
2
1
  import {
3
- capnpc
4
- } from "./chunk-QHIE4YNG.js";
2
+ AnyPointerList,
3
+ BoolList,
4
+ CapnpRPC,
5
+ CompositeList,
6
+ Conn,
7
+ Data,
8
+ DataList,
9
+ Deferred,
10
+ DeferredTransport,
11
+ ErrorClient,
12
+ Float32List,
13
+ Float64List,
14
+ Int16List,
15
+ Int32List,
16
+ Int64List,
17
+ Int8List,
18
+ Interface,
19
+ InterfaceList,
20
+ List,
21
+ ListElementSize,
22
+ Message,
23
+ MessageChannelTransport,
24
+ ObjectSize,
25
+ Orphan,
26
+ Pipeline,
27
+ Pointer,
28
+ PointerList,
29
+ PointerType,
30
+ Registry,
31
+ Server,
32
+ Struct,
33
+ Text,
34
+ TextList,
35
+ Uint16List,
36
+ Uint32List,
37
+ Uint64List,
38
+ Uint8List,
39
+ Void,
40
+ VoidList,
41
+ answerPipelineClient,
42
+ clientFromResolution,
43
+ clientOrNull,
44
+ copyCall,
45
+ getBitMask,
46
+ getFloat32Mask,
47
+ getFloat64Mask,
48
+ getInt16Mask,
49
+ getInt32Mask,
50
+ getInt64Mask,
51
+ getInt8Mask,
52
+ getUint16Mask,
53
+ getUint32Mask,
54
+ getUint64Mask,
55
+ getUint8Mask,
56
+ isDataCall,
57
+ isFuncCall,
58
+ isSameClient,
59
+ placeParams,
60
+ readRawPointer,
61
+ utils
62
+ } from "./chunk-PYRZUPFR.js";
5
63
  import {
6
- dist_exports
7
- } from "./chunk-COUAFT7O.js";
8
- import "./chunk-N5AOPRAP.js";
9
- import "./chunk-OULCUN6I.js";
64
+ CodeGeneratorContext
65
+ } from "./chunk-CCU32X36.js";
66
+ import "./chunk-SHUYVCID.js";
10
67
  export {
11
- dist_exports as capnp,
12
- capnpc
68
+ AnyPointerList,
69
+ BoolList,
70
+ CapnpRPC,
71
+ CodeGeneratorContext,
72
+ CompositeList,
73
+ Conn,
74
+ Data,
75
+ DataList,
76
+ Deferred,
77
+ DeferredTransport,
78
+ ErrorClient,
79
+ Float32List,
80
+ Float64List,
81
+ Int16List,
82
+ Int32List,
83
+ Int64List,
84
+ Int8List,
85
+ Interface,
86
+ InterfaceList,
87
+ List,
88
+ ListElementSize,
89
+ Message,
90
+ MessageChannelTransport,
91
+ ObjectSize,
92
+ Orphan,
93
+ Pipeline,
94
+ Pointer,
95
+ PointerList,
96
+ PointerType,
97
+ Registry,
98
+ Server,
99
+ Struct,
100
+ Text,
101
+ TextList,
102
+ Uint16List,
103
+ Uint32List,
104
+ Uint64List,
105
+ Uint8List,
106
+ Void,
107
+ VoidList,
108
+ answerPipelineClient,
109
+ clientFromResolution,
110
+ clientOrNull,
111
+ copyCall,
112
+ getBitMask,
113
+ getFloat32Mask,
114
+ getFloat64Mask,
115
+ getInt16Mask,
116
+ getInt32Mask,
117
+ getInt64Mask,
118
+ getInt8Mask,
119
+ getUint16Mask,
120
+ getUint32Mask,
121
+ getUint64Mask,
122
+ getUint8Mask,
123
+ isDataCall,
124
+ isFuncCall,
125
+ isSameClient,
126
+ placeParams,
127
+ readRawPointer,
128
+ utils
13
129
  };
package/dist/rpc.cjs CHANGED
@@ -1,108 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _chunkX74MKAHTcjs = require('./chunk-X74MKAHT.cjs');
5
+ require('./chunk-USNT2KNT.cjs');
4
6
 
5
- var _chunkCFDWCYSUcjs = require('./chunk-CFDWCYSU.cjs');
6
7
 
7
8
 
8
-
9
- var _chunk5MK6PQWWcjs = require('./chunk-5MK6PQWW.cjs');
10
-
11
- // src/rpc.ts
12
- var _worker_threads = require('worker_threads');
13
- var CapnpRPC = (_class = class {constructor() { _class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this); }
14
- static {
15
- _chunk5MK6PQWWcjs.__name.call(void 0, this, "CapnpRPC");
16
- }
17
- __init() {this.acceptQueue = new Array()}
18
- __init2() {this.connections = {}}
19
- __init3() {this.connectQueue = new Array()}
20
- /**
21
- * Creates a new {@link Conn} instance.
22
- *
23
- * @remarks
24
- * This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.
25
- */
26
- connect(id = 0) {
27
- if (this.connections[id] !== void 0) return this.connections[id];
28
- const ch = new (0, _worker_threads.MessageChannel)();
29
- const conn = new (0, _chunkCFDWCYSUcjs.Conn)(new MessageChannelTransport(ch.port1));
30
- const accept = this.acceptQueue.pop();
31
- this.connections[id] = conn;
32
- if (accept === void 0) {
33
- this.connectQueue.push(ch.port2);
34
- } else {
35
- accept.resolve(new (0, _chunkCFDWCYSUcjs.Conn)(new MessageChannelTransport(ch.port2)));
36
- }
37
- return conn;
38
- }
39
- /**
40
- * Accepts a connection from the connect queue.
41
- *
42
- * @returns A promise that resolves to a Conn instance when a connection is accepted.
43
- * @throws If no connections are available in the connect queue.
44
- */
45
- async accept() {
46
- const port2 = this.connectQueue.pop();
47
- if (port2 !== void 0) {
48
- return Promise.resolve(new (0, _chunkCFDWCYSUcjs.Conn)(new MessageChannelTransport(port2)));
49
- }
50
- const deferred = new (0, _chunkCFDWCYSUcjs.Deferred)();
51
- this.acceptQueue.push(deferred);
52
- return deferred.promise;
53
- }
54
- /**
55
- * Closes all connections and clears the queues.
56
- *
57
- * @remarks
58
- * This method will reject all pending accept promises and close all
59
- * connections in the connect queue.
60
- */
61
- close() {
62
- let i = this.acceptQueue.length;
63
- while (--i >= 0) {
64
- _optionalChain([this, 'access', _ => _.acceptQueue, 'access', _2 => _2[i], 'optionalAccess', _3 => _3.reject, 'call', _4 => _4()]);
65
- }
66
- i = this.connectQueue.length;
67
- while (--i >= 0) {
68
- _optionalChain([this, 'access', _5 => _5.connectQueue, 'access', _6 => _6[i], 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]);
69
- }
70
- for (const id in this.connections) {
71
- _optionalChain([this, 'access', _9 => _9.connections, 'access', _10 => _10[id], 'optionalAccess', _11 => _11.shutdown, 'call', _12 => _12()]);
72
- }
73
- this.acceptQueue.length = 0;
74
- this.connectQueue.length = 0;
75
- this.connections = {};
76
- }
77
- }, _class);
78
- var MessageChannelTransport = class extends _chunkCFDWCYSUcjs.DeferredTransport {
79
- static {
80
- _chunk5MK6PQWWcjs.__name.call(void 0, this, "MessageChannelTransport");
81
- }
82
-
83
- constructor(port) {
84
- super(), this.port = port, this.close = () => {
85
- this.port.off("message", this.resolve);
86
- this.port.off("messageerror", this.reject);
87
- this.port.off("close", this.close);
88
- this.port.close();
89
- super.close();
90
- };
91
- this.port.on("message", this.resolve);
92
- this.port.on("messageerror", this.reject);
93
- this.port.on("close", this.close);
94
- }
95
-
96
- sendMessage(msg) {
97
- const m = new (0, _chunk5MK6PQWWcjs.Message)();
98
- m.setRoot(msg);
99
- const buf = m.toArrayBuffer();
100
- this.port.postMessage(buf, [
101
- buf
102
- ]);
103
- }
104
- };
105
-
106
-
107
-
108
- exports.CapnpRPC = CapnpRPC; exports.MessageChannelTransport = MessageChannelTransport;
9
+ exports.CapnpRPC = _chunkX74MKAHTcjs.CapnpRPC; exports.MessageChannelTransport = _chunkX74MKAHTcjs.MessageChannelTransport;
package/dist/rpc.js CHANGED
@@ -1,107 +1,8 @@
1
1
  import {
2
- Conn,
3
- Deferred,
4
- DeferredTransport
5
- } from "./chunk-COUAFT7O.js";
6
- import {
7
- Message,
8
- __name
9
- } from "./chunk-N5AOPRAP.js";
10
-
11
- // src/rpc.ts
12
- import { MessageChannel } from "node:worker_threads";
13
- var CapnpRPC = class {
14
- static {
15
- __name(this, "CapnpRPC");
16
- }
17
- acceptQueue = new Array();
18
- connections = {};
19
- connectQueue = new Array();
20
- /**
21
- * Creates a new {@link Conn} instance.
22
- *
23
- * @remarks
24
- * This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.
25
- */
26
- connect(id = 0) {
27
- if (this.connections[id] !== void 0) return this.connections[id];
28
- const ch = new MessageChannel();
29
- const conn = new Conn(new MessageChannelTransport(ch.port1));
30
- const accept = this.acceptQueue.pop();
31
- this.connections[id] = conn;
32
- if (accept === void 0) {
33
- this.connectQueue.push(ch.port2);
34
- } else {
35
- accept.resolve(new Conn(new MessageChannelTransport(ch.port2)));
36
- }
37
- return conn;
38
- }
39
- /**
40
- * Accepts a connection from the connect queue.
41
- *
42
- * @returns A promise that resolves to a Conn instance when a connection is accepted.
43
- * @throws If no connections are available in the connect queue.
44
- */
45
- async accept() {
46
- const port2 = this.connectQueue.pop();
47
- if (port2 !== void 0) {
48
- return Promise.resolve(new Conn(new MessageChannelTransport(port2)));
49
- }
50
- const deferred = new Deferred();
51
- this.acceptQueue.push(deferred);
52
- return deferred.promise;
53
- }
54
- /**
55
- * Closes all connections and clears the queues.
56
- *
57
- * @remarks
58
- * This method will reject all pending accept promises and close all
59
- * connections in the connect queue.
60
- */
61
- close() {
62
- let i = this.acceptQueue.length;
63
- while (--i >= 0) {
64
- this.acceptQueue[i]?.reject();
65
- }
66
- i = this.connectQueue.length;
67
- while (--i >= 0) {
68
- this.connectQueue[i]?.close();
69
- }
70
- for (const id in this.connections) {
71
- this.connections[id]?.shutdown();
72
- }
73
- this.acceptQueue.length = 0;
74
- this.connectQueue.length = 0;
75
- this.connections = {};
76
- }
77
- };
78
- var MessageChannelTransport = class extends DeferredTransport {
79
- static {
80
- __name(this, "MessageChannelTransport");
81
- }
82
- port;
83
- constructor(port) {
84
- super(), this.port = port, this.close = () => {
85
- this.port.off("message", this.resolve);
86
- this.port.off("messageerror", this.reject);
87
- this.port.off("close", this.close);
88
- this.port.close();
89
- super.close();
90
- };
91
- this.port.on("message", this.resolve);
92
- this.port.on("messageerror", this.reject);
93
- this.port.on("close", this.close);
94
- }
95
- close;
96
- sendMessage(msg) {
97
- const m = new Message();
98
- m.setRoot(msg);
99
- const buf = m.toArrayBuffer();
100
- this.port.postMessage(buf, [
101
- buf
102
- ]);
103
- }
104
- };
2
+ CapnpRPC,
3
+ MessageChannelTransport
4
+ } from "./chunk-PYRZUPFR.js";
5
+ import "./chunk-SHUYVCID.js";
105
6
  export {
106
7
  CapnpRPC,
107
8
  MessageChannelTransport
package/dist/types.cjs CHANGED
@@ -1 +1,7 @@
1
- "use strict";require('./chunk-ORA4UQMU.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkR2JXWA7Qcjs = require('./chunk-R2JXWA7Q.cjs');
4
+ require('./chunk-USNT2KNT.cjs');
5
+
6
+
7
+ exports.CodeGeneratorContext = _chunkR2JXWA7Qcjs.CodeGeneratorContext;
package/dist/types.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { Node, CodeGeneratorRequest_RequestedFile_Import, Field, CodeGeneratorRequest, CodeGeneratorRequest_RequestedFile } from 'capnp-es/capnp/schema';
2
- import ts from 'typescript';
1
+ import { Node, CodeGeneratorRequest_RequestedFile_Import, Field } from 'capnp-es/capnp/schema';
2
+ import { ParsedCommandLine } from 'typescript';
3
3
 
4
4
  interface CodeGeneratorFileContext {
5
5
  readonly nodes: Node[];
@@ -9,30 +9,35 @@ interface CodeGeneratorFileContext {
9
9
  generatedResultsPromiseIds: Set<bigint>;
10
10
  tsPath: string;
11
11
  codeParts?: string[];
12
- constructor: (req: CodeGeneratorRequest, file: CodeGeneratorRequest_RequestedFile) => any;
12
+ constructor: any;
13
13
  toString: () => string;
14
14
  }
15
- interface CodeGeneratorContext {
15
+ declare class CodeGeneratorContext {
16
16
  files: CodeGeneratorFileContext[];
17
17
  }
18
18
  interface CapnpcCLIOptions {
19
19
  ts?: boolean;
20
+ noTs?: boolean;
20
21
  js?: boolean;
21
22
  dts?: boolean;
22
- schema: string[];
23
+ noDts?: boolean;
24
+ schema: string;
23
25
  output?: string;
24
26
  importPath?: string[];
25
27
  tsconfig: string;
26
28
  generateId?: boolean;
27
29
  standardImport?: boolean;
30
+ projectRoot: string;
28
31
  workspaceRoot: string;
32
+ tty?: boolean;
29
33
  }
30
- type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig"> & {
31
- tsconfig: ts.ParsedCommandLine;
34
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "noTs" | "noDts" | "tsconfig" | "schema"> & {
35
+ tsconfig: ParsedCommandLine;
36
+ schemas: string[];
32
37
  };
33
38
  interface CapnpcResult {
34
39
  ctx: CodeGeneratorContext;
35
40
  files: Map<string, string>;
36
41
  }
37
42
 
38
- export type { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
43
+ export { type CapnpcCLIOptions, type CapnpcOptions, type CapnpcResult, CodeGeneratorContext, type CodeGeneratorFileContext };
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Node, CodeGeneratorRequest_RequestedFile_Import, Field, CodeGeneratorRequest, CodeGeneratorRequest_RequestedFile } from 'capnp-es/capnp/schema';
2
- import ts from 'typescript';
1
+ import { Node, CodeGeneratorRequest_RequestedFile_Import, Field } from 'capnp-es/capnp/schema';
2
+ import { ParsedCommandLine } from 'typescript';
3
3
 
4
4
  interface CodeGeneratorFileContext {
5
5
  readonly nodes: Node[];
@@ -9,30 +9,35 @@ interface CodeGeneratorFileContext {
9
9
  generatedResultsPromiseIds: Set<bigint>;
10
10
  tsPath: string;
11
11
  codeParts?: string[];
12
- constructor: (req: CodeGeneratorRequest, file: CodeGeneratorRequest_RequestedFile) => any;
12
+ constructor: any;
13
13
  toString: () => string;
14
14
  }
15
- interface CodeGeneratorContext {
15
+ declare class CodeGeneratorContext {
16
16
  files: CodeGeneratorFileContext[];
17
17
  }
18
18
  interface CapnpcCLIOptions {
19
19
  ts?: boolean;
20
+ noTs?: boolean;
20
21
  js?: boolean;
21
22
  dts?: boolean;
22
- schema: string[];
23
+ noDts?: boolean;
24
+ schema: string;
23
25
  output?: string;
24
26
  importPath?: string[];
25
27
  tsconfig: string;
26
28
  generateId?: boolean;
27
29
  standardImport?: boolean;
30
+ projectRoot: string;
28
31
  workspaceRoot: string;
32
+ tty?: boolean;
29
33
  }
30
- type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig"> & {
31
- tsconfig: ts.ParsedCommandLine;
34
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "noTs" | "noDts" | "tsconfig" | "schema"> & {
35
+ tsconfig: ParsedCommandLine;
36
+ schemas: string[];
32
37
  };
33
38
  interface CapnpcResult {
34
39
  ctx: CodeGeneratorContext;
35
40
  files: Map<string, string>;
36
41
  }
37
42
 
38
- export type { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
43
+ export { type CapnpcCLIOptions, type CapnpcOptions, type CapnpcResult, CodeGeneratorContext, type CodeGeneratorFileContext };
package/dist/types.js CHANGED
@@ -1 +1,7 @@
1
- import "./chunk-OULCUN6I.js";
1
+ import {
2
+ CodeGeneratorContext
3
+ } from "./chunk-CCU32X36.js";
4
+ import "./chunk-SHUYVCID.js";
5
+ export {
6
+ CodeGeneratorContext
7
+ };