Skip to content

Commit e9489e5

Browse files
Copilotdanmarshall
andcommitted
Add inline DxfParser type declarations, remove from explicit types list
Co-authored-by: danmarshall <[email protected]>
1 parent d92df90 commit e9489e5

File tree

5 files changed

+126
-359
lines changed

5 files changed

+126
-359
lines changed

package-lock.json

Lines changed: 104 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@types/graham_scan": "^1.0.28",
1111
"@types/opentype.js": "^0.7.0",
1212
"@types/pdfkit": "^0.7.36",
13+
"dxf-parser-typings": "^1.3.0",
1314
"rimraf": "^2.6.2"
1415
},
1516
"scripts": {

packages/maker.js/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
"devDependencies": {
9797
"@jscad/csg": "^0.3.7",
9898
"@jscad/stl-serializer": "^0.1.0",
99-
"@types/graham_scan": "^1.0.28"
99+
"@types/graham_scan": "^1.0.28",
100+
"dxf-parser-typings": "^1.3.0"
100101
},
101102
"dependencies": {
102103
"@danmarshall/jscad-typings": "^1.0.0",

packages/maker.js/src/core/dxf.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
/// <reference path="../types/dxf-parser.d.ts" />
1+
// Minimal DxfParser type declarations for DXF export functionality
2+
// Full types provided by dxf-parser-typings package when available
3+
declare namespace DxfParser {
4+
interface Vertex { x: number; y: number; z?: number; bulge?: number; }
5+
interface Entity { type?: string; layer?: string; [key: string]: any; }
6+
interface EntityLINE extends Entity { type: 'LINE'; vertices?: Vertex[]; }
7+
interface EntityCIRCLE extends Entity { type: 'CIRCLE'; center?: Vertex; radius?: number; }
8+
interface EntityARC extends Entity { type: 'ARC'; center?: Vertex; radius?: number; startAngle?: number; endAngle?: number; }
9+
interface EntityVERTEX extends Entity { x: number; y: number; z?: number; bulge?: number; }
10+
interface EntityPOLYLINE extends Entity { type: 'POLYLINE'; vertices?: EntityVERTEX[]; }
11+
interface EntityTEXT extends Entity { type: 'TEXT'; startPoint?: Vertex; text?: string; textHeight?: number; }
12+
interface Layer { name?: string; colorIndex?: number; color?: number; }
13+
interface LineType { name?: string; description?: string; pattern?: number[]; patternLength?: number; }
14+
interface Table { handle?: string; }
15+
interface TableLTYPE extends Table { lineTypes?: { [name: string]: LineType }; }
16+
interface TableLAYER extends Table { layers?: { [name: string]: Layer }; }
17+
type TableNames = 'layer' | 'lineType' | 'viewPort';
18+
interface DXFDocument { entities?: Entity[]; header?: any; tables?: { [name: string]: Table }; }
19+
}
220

321
namespace MakerJs.exporter {
422

0 commit comments

Comments
 (0)