@linuxcnc-node/types 1.0.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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/constants.d.ts +95 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +111 -0
- package/dist/constants.js.map +1 -0
- package/dist/core.d.ts +594 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +34 -0
- package/dist/core.js.map +1 -0
- package/dist/gcode.d.ts +291 -0
- package/dist/gcode.d.ts.map +1 -0
- package/dist/gcode.js +49 -0
- package/dist/gcode.js.map +1 -0
- package/dist/hal.d.ts +29 -0
- package/dist/hal.d.ts.map +1 -0
- package/dist/hal.js +4 -0
- package/dist/hal.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/nml.d.ts +567 -0
- package/dist/nml.d.ts.map +1 -0
- package/dist/nml.js +3 -0
- package/dist/nml.js.map +1 -0
- package/package.json +34 -0
package/dist/gcode.d.ts
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* G-Code Parser Types
|
|
3
|
+
*
|
|
4
|
+
* Defines all TypeScript interfaces for G-code operations parsed by the
|
|
5
|
+
* LinuxCNC rs274ngc interpreter.
|
|
6
|
+
*/
|
|
7
|
+
import { ProgramUnits } from "./constants";
|
|
8
|
+
import { Position, Position3 } from "./core";
|
|
9
|
+
/**
|
|
10
|
+
* Types of operations that can be parsed from G-code.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum OperationType {
|
|
13
|
+
TRAVERSE = 1,
|
|
14
|
+
FEED = 2,
|
|
15
|
+
ARC = 3,
|
|
16
|
+
PROBE = 4,
|
|
17
|
+
RIGID_TAP = 5,
|
|
18
|
+
DWELL = 6,
|
|
19
|
+
NURBS_G5 = 7,
|
|
20
|
+
NURBS_G6 = 8,
|
|
21
|
+
UNITS_CHANGE = 10,
|
|
22
|
+
PLANE_CHANGE = 11,
|
|
23
|
+
G5X_OFFSET = 12,
|
|
24
|
+
G92_OFFSET = 13,
|
|
25
|
+
XY_ROTATION = 14,
|
|
26
|
+
TOOL_OFFSET = 15,
|
|
27
|
+
TOOL_CHANGE = 16,
|
|
28
|
+
FEED_RATE_CHANGE = 17
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Plane selection for arc and NURBS operations.
|
|
32
|
+
*/
|
|
33
|
+
export declare enum Plane {
|
|
34
|
+
XY = 1,
|
|
35
|
+
YZ = 2,
|
|
36
|
+
XZ = 3,
|
|
37
|
+
UV = 4,
|
|
38
|
+
VW = 5,
|
|
39
|
+
UW = 6
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* G0 rapid traverse motion.
|
|
43
|
+
*/
|
|
44
|
+
export interface TraverseOperation {
|
|
45
|
+
type: OperationType.TRAVERSE;
|
|
46
|
+
/** Source G-code line number */
|
|
47
|
+
lineNumber: number;
|
|
48
|
+
/** Target position */
|
|
49
|
+
pos: Position;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* G1 linear feed motion.
|
|
53
|
+
*/
|
|
54
|
+
export interface FeedOperation {
|
|
55
|
+
type: OperationType.FEED;
|
|
56
|
+
/** Source G-code line number */
|
|
57
|
+
lineNumber: number;
|
|
58
|
+
/** Target position */
|
|
59
|
+
pos: Position;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* G2/G3 arc motion.
|
|
63
|
+
* Arc data is provided for reconstruction without tessellation.
|
|
64
|
+
*/
|
|
65
|
+
export interface ArcOperation {
|
|
66
|
+
type: OperationType.ARC;
|
|
67
|
+
/** Source G-code line number */
|
|
68
|
+
lineNumber: number;
|
|
69
|
+
/** Target position */
|
|
70
|
+
pos: Position;
|
|
71
|
+
/** Plane in which the arc lies */
|
|
72
|
+
plane: Plane;
|
|
73
|
+
/** Arc geometry data for reconstruction */
|
|
74
|
+
arcData: {
|
|
75
|
+
/** Center coordinate on the first axis of the plane (e.g., X for XY plane) */
|
|
76
|
+
centerFirst: number;
|
|
77
|
+
/** Center coordinate on the second axis of the plane (e.g., Y for XY plane) */
|
|
78
|
+
centerSecond: number;
|
|
79
|
+
/**
|
|
80
|
+
* Rotation direction and count.
|
|
81
|
+
* Positive = CCW (G3), Negative = CW (G2).
|
|
82
|
+
* Magnitude > 1 indicates multiple full turns.
|
|
83
|
+
*/
|
|
84
|
+
rotation: number;
|
|
85
|
+
/** End point on the axis perpendicular to the plane (helix axis) */
|
|
86
|
+
axisEndPoint: number;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* G38.x probe motion.
|
|
91
|
+
*/
|
|
92
|
+
export interface ProbeOperation {
|
|
93
|
+
type: OperationType.PROBE;
|
|
94
|
+
/** Source G-code line number */
|
|
95
|
+
lineNumber: number;
|
|
96
|
+
/** Target probe position */
|
|
97
|
+
pos: Position;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* G33.1 rigid tapping motion.
|
|
101
|
+
*/
|
|
102
|
+
export interface RigidTapOperation {
|
|
103
|
+
type: OperationType.RIGID_TAP;
|
|
104
|
+
/** Source G-code line number */
|
|
105
|
+
lineNumber: number;
|
|
106
|
+
/** Target tap position as Position3: [x, y, z] */
|
|
107
|
+
pos: Position3;
|
|
108
|
+
/** Tap scale factor */
|
|
109
|
+
scale: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* G4 dwell (pause) operation.
|
|
113
|
+
*/
|
|
114
|
+
export interface DwellOperation {
|
|
115
|
+
type: OperationType.DWELL;
|
|
116
|
+
/** Position where dwell occurs */
|
|
117
|
+
pos: Position;
|
|
118
|
+
/** Dwell duration in seconds */
|
|
119
|
+
duration: number;
|
|
120
|
+
/** Current plane at time of dwell */
|
|
121
|
+
plane: Plane;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* G5 NURBS (non-rational B-spline) feed motion.
|
|
125
|
+
*/
|
|
126
|
+
export interface NurbsG5Operation {
|
|
127
|
+
type: OperationType.NURBS_G5;
|
|
128
|
+
/** Source G-code line number */
|
|
129
|
+
lineNumber: number;
|
|
130
|
+
/** Target position */
|
|
131
|
+
pos: Position;
|
|
132
|
+
/** Plane in which the NURBS curve lies */
|
|
133
|
+
plane: Plane;
|
|
134
|
+
/** NURBS curve data */
|
|
135
|
+
nurbsData: {
|
|
136
|
+
/** B-spline order */
|
|
137
|
+
order: number;
|
|
138
|
+
/** Control points with weights */
|
|
139
|
+
controlPoints: Array<{
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
weight: number;
|
|
143
|
+
}>;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* G6 NURBS (rational B-spline with knots) feed motion.
|
|
148
|
+
*/
|
|
149
|
+
export interface NurbsG6Operation {
|
|
150
|
+
type: OperationType.NURBS_G6;
|
|
151
|
+
/** Source G-code line number */
|
|
152
|
+
lineNumber: number;
|
|
153
|
+
/** Target position */
|
|
154
|
+
pos: Position;
|
|
155
|
+
/** Plane in which the NURBS curve lies */
|
|
156
|
+
plane: Plane;
|
|
157
|
+
/** NURBS curve data */
|
|
158
|
+
nurbsData: {
|
|
159
|
+
/** B-spline order */
|
|
160
|
+
order: number;
|
|
161
|
+
/** Control points with R and K values */
|
|
162
|
+
controlPoints: Array<{
|
|
163
|
+
x: number;
|
|
164
|
+
y: number;
|
|
165
|
+
/** R value from G-code */
|
|
166
|
+
r: number;
|
|
167
|
+
/** Knot parameter */
|
|
168
|
+
k: number;
|
|
169
|
+
}>;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* G20/G21 units change operation.
|
|
174
|
+
*/
|
|
175
|
+
export interface UnitsChangeOperation {
|
|
176
|
+
type: OperationType.UNITS_CHANGE;
|
|
177
|
+
/** New active units */
|
|
178
|
+
units: ProgramUnits;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* G17/G18/G19 plane change operation.
|
|
182
|
+
*/
|
|
183
|
+
export interface PlaneChangeOperation {
|
|
184
|
+
type: OperationType.PLANE_CHANGE;
|
|
185
|
+
/** New active plane */
|
|
186
|
+
plane: Plane;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* G54-G59.3 coordinate system offset change.
|
|
190
|
+
*/
|
|
191
|
+
export interface G5xOffsetOperation {
|
|
192
|
+
type: OperationType.G5X_OFFSET;
|
|
193
|
+
/** Coordinate system origin index (1=G54, 2=G55, ..., 9=G59.3) */
|
|
194
|
+
origin: number;
|
|
195
|
+
/** Offset values */
|
|
196
|
+
offset: Position;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* G92 coordinate offset change.
|
|
200
|
+
*/
|
|
201
|
+
export interface G92OffsetOperation {
|
|
202
|
+
type: OperationType.G92_OFFSET;
|
|
203
|
+
/** Offset values */
|
|
204
|
+
offset: Position;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* XY plane rotation change (from G10 L2 R...).
|
|
208
|
+
*/
|
|
209
|
+
export interface XYRotationOperation {
|
|
210
|
+
type: OperationType.XY_ROTATION;
|
|
211
|
+
/** Rotation angle in degrees */
|
|
212
|
+
rotation: number;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* G43/G49 tool length offset change.
|
|
216
|
+
*/
|
|
217
|
+
export interface ToolOffsetOperation {
|
|
218
|
+
type: OperationType.TOOL_OFFSET;
|
|
219
|
+
/** Tool offset values */
|
|
220
|
+
offset: Position;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* M6 tool change operation with complete tool data.
|
|
224
|
+
*/
|
|
225
|
+
export interface ToolChangeOperation {
|
|
226
|
+
type: OperationType.TOOL_CHANGE;
|
|
227
|
+
/** Tool number to change to */
|
|
228
|
+
toolNumber: number;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Feed rate change (F word).
|
|
232
|
+
*/
|
|
233
|
+
export interface FeedRateChangeOperation {
|
|
234
|
+
type: OperationType.FEED_RATE_CHANGE;
|
|
235
|
+
/** New feed rate in current units per minute */
|
|
236
|
+
feedRate: number;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Union of all possible G-code operations.
|
|
240
|
+
*/
|
|
241
|
+
export type GCodeOperation = TraverseOperation | FeedOperation | ArcOperation | ProbeOperation | RigidTapOperation | DwellOperation | NurbsG5Operation | NurbsG6Operation | UnitsChangeOperation | PlaneChangeOperation | G5xOffsetOperation | G92OffsetOperation | XYRotationOperation | ToolOffsetOperation | ToolChangeOperation | FeedRateChangeOperation;
|
|
242
|
+
/**
|
|
243
|
+
* Bounding box extents of the parsed G-code program.
|
|
244
|
+
* Min/max stored as Float64Array(3): [x, y, z]
|
|
245
|
+
*/
|
|
246
|
+
export interface Extents {
|
|
247
|
+
/** Minimum coordinates encountered as Position3: [x, y, z] */
|
|
248
|
+
min: Position3;
|
|
249
|
+
/** Maximum coordinates encountered as Position3: [x, y, z] */
|
|
250
|
+
max: Position3;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Complete result from parsing a G-code file.
|
|
254
|
+
*/
|
|
255
|
+
export interface GCodeParseResult {
|
|
256
|
+
/** Sequential list of operations in execution order */
|
|
257
|
+
operations: GCodeOperation[];
|
|
258
|
+
/** Bounding box of all motion operations */
|
|
259
|
+
extents: Extents;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Progress information reported during parsing.
|
|
263
|
+
*/
|
|
264
|
+
export interface ParseProgress {
|
|
265
|
+
/** Number of bytes read from the file */
|
|
266
|
+
bytesRead: number;
|
|
267
|
+
/** Total file size in bytes */
|
|
268
|
+
totalBytes: number;
|
|
269
|
+
/** Percentage complete (0-100) */
|
|
270
|
+
percent: number;
|
|
271
|
+
/** Number of operations parsed so far */
|
|
272
|
+
operationCount: number;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Options for parsing a G-code file.
|
|
276
|
+
*/
|
|
277
|
+
export interface ParseOptions {
|
|
278
|
+
/** Path to LinuxCNC INI file (required) */
|
|
279
|
+
iniPath: string;
|
|
280
|
+
/** Progress callback, called periodically during parsing */
|
|
281
|
+
onProgress?: (progress: ParseProgress) => void;
|
|
282
|
+
/**
|
|
283
|
+
* Target number of progress updates during parsing.
|
|
284
|
+
* The actual interval is calculated based on file size to achieve
|
|
285
|
+
* approximately this many updates. Default is 40.
|
|
286
|
+
* Set to 0 to disable progress callbacks entirely.
|
|
287
|
+
* @default 40
|
|
288
|
+
*/
|
|
289
|
+
progressUpdates?: number;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=gcode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcode.d.ts","sourceRoot":"","sources":["../src/gcode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAM7C;;GAEG;AACH,oBAAY,aAAa;IAEvB,QAAQ,IAAI;IACZ,IAAI,IAAI;IACR,GAAG,IAAI;IACP,KAAK,IAAI;IACT,SAAS,IAAI;IACb,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,QAAQ,IAAI;IAGZ,YAAY,KAAK;IACjB,YAAY,KAAK;IACjB,UAAU,KAAK;IACf,UAAU,KAAK;IACf,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,gBAAgB,KAAK;CACtB;AAED;;GAEG;AACH,oBAAY,KAAK;IACf,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;CACP;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC,QAA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OAAO;IACtB,8DAA8D;IAC9D,GAAG,EAAE,SAAS,CAAC;IACf,8DAA8D;IAC9D,GAAG,EAAE,SAAS,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
package/dist/gcode.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* G-Code Parser Types
|
|
4
|
+
*
|
|
5
|
+
* Defines all TypeScript interfaces for G-code operations parsed by the
|
|
6
|
+
* LinuxCNC rs274ngc interpreter.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Plane = exports.OperationType = void 0;
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Enums
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Types of operations that can be parsed from G-code.
|
|
15
|
+
*/
|
|
16
|
+
var OperationType;
|
|
17
|
+
(function (OperationType) {
|
|
18
|
+
// Motion operations
|
|
19
|
+
OperationType[OperationType["TRAVERSE"] = 1] = "TRAVERSE";
|
|
20
|
+
OperationType[OperationType["FEED"] = 2] = "FEED";
|
|
21
|
+
OperationType[OperationType["ARC"] = 3] = "ARC";
|
|
22
|
+
OperationType[OperationType["PROBE"] = 4] = "PROBE";
|
|
23
|
+
OperationType[OperationType["RIGID_TAP"] = 5] = "RIGID_TAP";
|
|
24
|
+
OperationType[OperationType["DWELL"] = 6] = "DWELL";
|
|
25
|
+
OperationType[OperationType["NURBS_G5"] = 7] = "NURBS_G5";
|
|
26
|
+
OperationType[OperationType["NURBS_G6"] = 8] = "NURBS_G6";
|
|
27
|
+
// State change operations
|
|
28
|
+
OperationType[OperationType["UNITS_CHANGE"] = 10] = "UNITS_CHANGE";
|
|
29
|
+
OperationType[OperationType["PLANE_CHANGE"] = 11] = "PLANE_CHANGE";
|
|
30
|
+
OperationType[OperationType["G5X_OFFSET"] = 12] = "G5X_OFFSET";
|
|
31
|
+
OperationType[OperationType["G92_OFFSET"] = 13] = "G92_OFFSET";
|
|
32
|
+
OperationType[OperationType["XY_ROTATION"] = 14] = "XY_ROTATION";
|
|
33
|
+
OperationType[OperationType["TOOL_OFFSET"] = 15] = "TOOL_OFFSET";
|
|
34
|
+
OperationType[OperationType["TOOL_CHANGE"] = 16] = "TOOL_CHANGE";
|
|
35
|
+
OperationType[OperationType["FEED_RATE_CHANGE"] = 17] = "FEED_RATE_CHANGE";
|
|
36
|
+
})(OperationType || (exports.OperationType = OperationType = {}));
|
|
37
|
+
/**
|
|
38
|
+
* Plane selection for arc and NURBS operations.
|
|
39
|
+
*/
|
|
40
|
+
var Plane;
|
|
41
|
+
(function (Plane) {
|
|
42
|
+
Plane[Plane["XY"] = 1] = "XY";
|
|
43
|
+
Plane[Plane["YZ"] = 2] = "YZ";
|
|
44
|
+
Plane[Plane["XZ"] = 3] = "XZ";
|
|
45
|
+
Plane[Plane["UV"] = 4] = "UV";
|
|
46
|
+
Plane[Plane["VW"] = 5] = "VW";
|
|
47
|
+
Plane[Plane["UW"] = 6] = "UW";
|
|
48
|
+
})(Plane || (exports.Plane = Plane = {}));
|
|
49
|
+
//# sourceMappingURL=gcode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcode.js","sourceRoot":"","sources":["../src/gcode.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;GAEG;AACH,IAAY,aAoBX;AApBD,WAAY,aAAa;IACvB,oBAAoB;IACpB,yDAAY,CAAA;IACZ,iDAAQ,CAAA;IACR,+CAAO,CAAA;IACP,mDAAS,CAAA;IACT,2DAAa,CAAA;IACb,mDAAS,CAAA;IACT,yDAAY,CAAA;IACZ,yDAAY,CAAA;IAEZ,0BAA0B;IAC1B,kEAAiB,CAAA;IACjB,kEAAiB,CAAA;IACjB,8DAAe,CAAA;IACf,8DAAe,CAAA;IACf,gEAAgB,CAAA;IAChB,gEAAgB,CAAA;IAChB,gEAAgB,CAAA;IAChB,0EAAqB,CAAA;AACvB,CAAC,EApBW,aAAa,6BAAb,aAAa,QAoBxB;AAED;;GAEG;AACH,IAAY,KAOX;AAPD,WAAY,KAAK;IACf,6BAAM,CAAA;IACN,6BAAM,CAAA;IACN,6BAAM,CAAA;IACN,6BAAM,CAAA;IACN,6BAAM,CAAA;IACN,6BAAM,CAAA;AACR,CAAC,EAPW,KAAK,qBAAL,KAAK,QAOhB"}
|
package/dist/hal.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type HalType = "bit" | "float" | "s32" | "u32" | "s64" | "u64";
|
|
2
|
+
export type HalPinDir = "in" | "out" | "io";
|
|
3
|
+
export type HalParamDir = "ro" | "rw";
|
|
4
|
+
export type RtapiMsgLevel = "none" | "err" | "warn" | "info" | "dbg" | "all";
|
|
5
|
+
export interface HalPinInfo {
|
|
6
|
+
name: string;
|
|
7
|
+
value: any;
|
|
8
|
+
type: HalType;
|
|
9
|
+
direction: HalPinDir;
|
|
10
|
+
ownerId: number;
|
|
11
|
+
signalName?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface HalSignalInfo {
|
|
14
|
+
name: string;
|
|
15
|
+
value: any;
|
|
16
|
+
type: HalType;
|
|
17
|
+
driver: string | null;
|
|
18
|
+
readers: number;
|
|
19
|
+
writers: number;
|
|
20
|
+
bidirs: number;
|
|
21
|
+
}
|
|
22
|
+
export interface HalParamInfo {
|
|
23
|
+
name: string;
|
|
24
|
+
value: any;
|
|
25
|
+
type: HalType;
|
|
26
|
+
direction: HalParamDir;
|
|
27
|
+
ownerId: number;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=hal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hal.d.ts","sourceRoot":"","sources":["../src/hal.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtE,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/hal.js
ADDED
package/dist/hal.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hal.js","sourceRoot":"","sources":["../src/hal.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// LinuxCNC Node.js bindings type definitions
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./core"), exports);
|
|
20
|
+
__exportStar(require("./hal"), exports);
|
|
21
|
+
__exportStar(require("./gcode"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;;;;;;;;;;;;;;AAE7C,8CAA4B;AAC5B,yCAAuB;AACvB,wCAAsB;AACtB,0CAAwB"}
|