@linkiez/dxf-renew 7.1.0 → 7.2.3

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 (398) hide show
  1. package/.eslintrc.json +1 -16
  2. package/.yarn/install-state.gz +0 -0
  3. package/ARCHITECTURE.md +163 -0
  4. package/CHANGELOG.md +34 -0
  5. package/README.md +72 -10
  6. package/{PLAN.md → ROADMAP.md} +227 -35
  7. package/build.mjs +28 -0
  8. package/dist/dxf.js +1090 -344
  9. package/docs/FIXTURE_VALIDATION_EZDXF.md +1 -1
  10. package/lib/Helper.cjs +4 -0
  11. package/lib/Helper.cjs.map +3 -3
  12. package/lib/Helper.d.ts +19 -0
  13. package/lib/Helper.d.ts.map +1 -0
  14. package/lib/Helper.js +4 -0
  15. package/lib/Helper.js.map +2 -2
  16. package/lib/applyTransforms.d.ts +12 -0
  17. package/lib/applyTransforms.d.ts.map +1 -0
  18. package/lib/cli.cjs +1 -2
  19. package/lib/cli.cjs.map +1 -1
  20. package/lib/cli.d.ts +3 -0
  21. package/lib/cli.d.ts.map +1 -0
  22. package/lib/config.d.ts +4 -0
  23. package/lib/config.d.ts.map +1 -0
  24. package/lib/constants.d.ts +3 -0
  25. package/lib/constants.d.ts.map +1 -0
  26. package/lib/denormalise.d.ts +3 -0
  27. package/lib/denormalise.d.ts.map +1 -0
  28. package/lib/dimensionToSVG.d.ts +18 -0
  29. package/lib/dimensionToSVG.d.ts.map +1 -0
  30. package/lib/entityToPolyline.cjs +95 -0
  31. package/lib/entityToPolyline.cjs.map +3 -3
  32. package/lib/entityToPolyline.d.ts +48 -0
  33. package/lib/entityToPolyline.d.ts.map +1 -0
  34. package/lib/entityToPolyline.js +95 -0
  35. package/lib/entityToPolyline.js.map +2 -2
  36. package/lib/getRGBForEntity.d.ts +5 -0
  37. package/lib/getRGBForEntity.d.ts.map +1 -0
  38. package/lib/groupEntitiesByLayer.d.ts +3 -0
  39. package/lib/groupEntitiesByLayer.d.ts.map +1 -0
  40. package/lib/handlers/blocks.d.ts +3 -0
  41. package/lib/handlers/blocks.d.ts.map +1 -0
  42. package/lib/handlers/entities.cjs +22 -2
  43. package/lib/handlers/entities.cjs.map +3 -3
  44. package/lib/handlers/entities.d.ts +4 -0
  45. package/lib/handlers/entities.d.ts.map +1 -0
  46. package/lib/handlers/entities.js +22 -2
  47. package/lib/handlers/entities.js.map +2 -2
  48. package/lib/handlers/entity/arc.d.ts +20 -0
  49. package/lib/handlers/entity/arc.d.ts.map +1 -0
  50. package/lib/handlers/entity/attdef.d.ts +11 -0
  51. package/lib/handlers/entity/attdef.d.ts.map +1 -0
  52. package/lib/handlers/entity/attrib.d.ts +9 -0
  53. package/lib/handlers/entity/attrib.d.ts.map +1 -0
  54. package/lib/handlers/entity/circle.d.ts +17 -0
  55. package/lib/handlers/entity/circle.d.ts.map +1 -0
  56. package/lib/handlers/entity/common.d.ts +3 -0
  57. package/lib/handlers/entity/common.d.ts.map +1 -0
  58. package/lib/handlers/entity/dgnUnderlay.d.ts +33 -0
  59. package/lib/handlers/entity/dgnUnderlay.d.ts.map +1 -0
  60. package/lib/handlers/entity/dimension.d.ts +35 -0
  61. package/lib/handlers/entity/dimension.d.ts.map +1 -0
  62. package/lib/handlers/entity/dwfUnderlay.d.ts +33 -0
  63. package/lib/handlers/entity/dwfUnderlay.d.ts.map +1 -0
  64. package/lib/handlers/entity/ellipse.d.ts +10 -0
  65. package/lib/handlers/entity/ellipse.d.ts.map +1 -0
  66. package/lib/handlers/entity/hatch.d.ts +9 -0
  67. package/lib/handlers/entity/hatch.d.ts.map +1 -0
  68. package/lib/handlers/entity/image.d.ts +26 -0
  69. package/lib/handlers/entity/image.d.ts.map +1 -0
  70. package/lib/handlers/entity/insert.d.ts +10 -0
  71. package/lib/handlers/entity/insert.d.ts.map +1 -0
  72. package/lib/handlers/entity/leader.d.ts +48 -0
  73. package/lib/handlers/entity/leader.d.ts.map +1 -0
  74. package/lib/handlers/entity/line.d.ts +16 -0
  75. package/lib/handlers/entity/line.d.ts.map +1 -0
  76. package/lib/handlers/entity/lwpolyline.d.ts +10 -0
  77. package/lib/handlers/entity/lwpolyline.d.ts.map +1 -0
  78. package/lib/handlers/entity/mleader.cjs +69 -0
  79. package/lib/handlers/entity/mleader.cjs.map +7 -0
  80. package/lib/handlers/entity/mleader.d.ts +15 -0
  81. package/lib/handlers/entity/mleader.d.ts.map +1 -0
  82. package/lib/handlers/entity/mleader.js +34 -0
  83. package/lib/handlers/entity/mleader.js.map +7 -0
  84. package/lib/handlers/entity/mline.cjs +91 -0
  85. package/lib/handlers/entity/mline.cjs.map +7 -0
  86. package/lib/handlers/entity/mline.d.ts +17 -0
  87. package/lib/handlers/entity/mline.d.ts.map +1 -0
  88. package/lib/handlers/entity/mline.js +56 -0
  89. package/lib/handlers/entity/mline.js.map +7 -0
  90. package/lib/handlers/entity/mtext.d.ts +62 -0
  91. package/lib/handlers/entity/mtext.d.ts.map +1 -0
  92. package/lib/handlers/entity/ole2Frame.d.ts +9 -0
  93. package/lib/handlers/entity/ole2Frame.d.ts.map +1 -0
  94. package/lib/handlers/entity/oleframe.cjs +98 -0
  95. package/lib/handlers/entity/oleframe.cjs.map +7 -0
  96. package/lib/handlers/entity/oleframe.d.ts +9 -0
  97. package/lib/handlers/entity/oleframe.d.ts.map +1 -0
  98. package/lib/handlers/entity/oleframe.js +63 -0
  99. package/lib/handlers/entity/oleframe.js.map +7 -0
  100. package/lib/handlers/entity/pdfUnderlay.d.ts +33 -0
  101. package/lib/handlers/entity/pdfUnderlay.d.ts.map +1 -0
  102. package/lib/handlers/entity/point.d.ts +17 -0
  103. package/lib/handlers/entity/point.d.ts.map +1 -0
  104. package/lib/handlers/entity/polyline.d.ts +21 -0
  105. package/lib/handlers/entity/polyline.d.ts.map +1 -0
  106. package/lib/handlers/entity/ray.cjs +81 -0
  107. package/lib/handlers/entity/ray.cjs.map +7 -0
  108. package/lib/handlers/entity/ray.d.ts +15 -0
  109. package/lib/handlers/entity/ray.d.ts.map +1 -0
  110. package/lib/handlers/entity/ray.js +46 -0
  111. package/lib/handlers/entity/ray.js.map +7 -0
  112. package/lib/handlers/entity/region.cjs +67 -0
  113. package/lib/handlers/entity/region.cjs.map +7 -0
  114. package/lib/handlers/entity/region.d.ts +14 -0
  115. package/lib/handlers/entity/region.d.ts.map +1 -0
  116. package/lib/handlers/entity/region.js +32 -0
  117. package/lib/handlers/entity/region.js.map +7 -0
  118. package/lib/handlers/entity/shape.cjs +95 -0
  119. package/lib/handlers/entity/shape.cjs.map +7 -0
  120. package/lib/handlers/entity/shape.d.ts +22 -0
  121. package/lib/handlers/entity/shape.d.ts.map +1 -0
  122. package/lib/handlers/entity/shape.js +60 -0
  123. package/lib/handlers/entity/shape.js.map +7 -0
  124. package/lib/handlers/entity/solid.d.ts +15 -0
  125. package/lib/handlers/entity/solid.d.ts.map +1 -0
  126. package/lib/handlers/entity/spline.d.ts +30 -0
  127. package/lib/handlers/entity/spline.d.ts.map +1 -0
  128. package/lib/handlers/entity/table.cjs +71 -0
  129. package/lib/handlers/entity/table.cjs.map +7 -0
  130. package/lib/handlers/entity/table.d.ts +16 -0
  131. package/lib/handlers/entity/table.d.ts.map +1 -0
  132. package/lib/handlers/entity/table.js +36 -0
  133. package/lib/handlers/entity/table.js.map +7 -0
  134. package/lib/handlers/entity/text.d.ts +31 -0
  135. package/lib/handlers/entity/text.d.ts.map +1 -0
  136. package/lib/handlers/entity/threeDFace.d.ts +14 -0
  137. package/lib/handlers/entity/threeDFace.d.ts.map +1 -0
  138. package/lib/handlers/entity/tolerance.d.ts +25 -0
  139. package/lib/handlers/entity/tolerance.d.ts.map +1 -0
  140. package/lib/handlers/entity/trace.cjs +101 -0
  141. package/lib/handlers/entity/trace.cjs.map +7 -0
  142. package/lib/handlers/entity/trace.d.ts +15 -0
  143. package/lib/handlers/entity/trace.d.ts.map +1 -0
  144. package/lib/handlers/entity/trace.js +66 -0
  145. package/lib/handlers/entity/trace.js.map +7 -0
  146. package/lib/handlers/entity/vertex.d.ts +10 -0
  147. package/lib/handlers/entity/vertex.d.ts.map +1 -0
  148. package/lib/handlers/entity/viewport.d.ts +9 -0
  149. package/lib/handlers/entity/viewport.d.ts.map +1 -0
  150. package/lib/handlers/entity/wipeout.cjs +122 -0
  151. package/lib/handlers/entity/wipeout.cjs.map +7 -0
  152. package/lib/handlers/entity/wipeout.d.ts +28 -0
  153. package/lib/handlers/entity/wipeout.d.ts.map +1 -0
  154. package/lib/handlers/entity/wipeout.js +87 -0
  155. package/lib/handlers/entity/wipeout.js.map +7 -0
  156. package/lib/handlers/entity/xline.cjs +81 -0
  157. package/lib/handlers/entity/xline.cjs.map +7 -0
  158. package/lib/handlers/entity/xline.d.ts +15 -0
  159. package/lib/handlers/entity/xline.d.ts.map +1 -0
  160. package/lib/handlers/entity/xline.js +46 -0
  161. package/lib/handlers/entity/xline.js.map +7 -0
  162. package/lib/handlers/header.d.ts +3 -0
  163. package/lib/handlers/header.d.ts.map +1 -0
  164. package/lib/handlers/objects.cjs +43 -1
  165. package/lib/handlers/objects.cjs.map +2 -2
  166. package/lib/handlers/objects.d.ts +3 -0
  167. package/lib/handlers/objects.d.ts.map +1 -0
  168. package/lib/handlers/objects.js +43 -1
  169. package/lib/handlers/objects.js.map +2 -2
  170. package/lib/handlers/tables.cjs +96 -17
  171. package/lib/handlers/tables.cjs.map +2 -2
  172. package/lib/handlers/tables.d.ts +13 -0
  173. package/lib/handlers/tables.d.ts.map +1 -0
  174. package/lib/handlers/tables.js +96 -17
  175. package/lib/handlers/tables.js.map +2 -2
  176. package/lib/index.cjs +5 -2
  177. package/lib/index.cjs.map +3 -3
  178. package/lib/index.d.ts +10 -0
  179. package/lib/index.d.ts.map +1 -0
  180. package/lib/index.js +18 -16
  181. package/lib/index.js.map +3 -3
  182. package/lib/parseString.d.ts +3 -0
  183. package/lib/parseString.d.ts.map +1 -0
  184. package/lib/toJson.cjs +29 -0
  185. package/lib/toJson.cjs.map +7 -0
  186. package/lib/toJson.d.ts +3 -0
  187. package/lib/toJson.d.ts.map +1 -0
  188. package/lib/toJson.js +9 -0
  189. package/lib/toJson.js.map +7 -0
  190. package/lib/toPolylines.d.ts +4 -0
  191. package/lib/toPolylines.d.ts.map +1 -0
  192. package/lib/toSVG.cjs +34 -3
  193. package/lib/toSVG.cjs.map +2 -2
  194. package/lib/toSVG.d.ts +7 -0
  195. package/lib/toSVG.d.ts.map +1 -0
  196. package/lib/toSVG.js +34 -3
  197. package/lib/toSVG.js.map +2 -2
  198. package/lib/types/arc-entity.d.ts +8 -0
  199. package/lib/types/arc-entity.d.ts.map +1 -0
  200. package/lib/types/base-entity.d.ts +22 -0
  201. package/lib/types/base-entity.d.ts.map +1 -0
  202. package/lib/types/circle-entity.d.ts +6 -0
  203. package/lib/types/circle-entity.d.ts.map +1 -0
  204. package/lib/types/common.d.ts +30 -0
  205. package/lib/types/common.d.ts.map +1 -0
  206. package/lib/types/dimension-entity.d.ts +31 -0
  207. package/lib/types/dimension-entity.d.ts.map +1 -0
  208. package/lib/types/dxf.d.ts +55 -0
  209. package/lib/types/dxf.d.ts.map +1 -0
  210. package/lib/types/ellipse-entity.d.ts +11 -0
  211. package/lib/types/ellipse-entity.d.ts.map +1 -0
  212. package/lib/types/entity.cjs.map +1 -1
  213. package/lib/types/entity.d.ts +30 -0
  214. package/lib/types/entity.d.ts.map +1 -0
  215. package/lib/types/handler-internal.d.ts +44 -0
  216. package/lib/types/handler-internal.d.ts.map +1 -0
  217. package/lib/types/handler.d.ts +8 -0
  218. package/lib/types/handler.d.ts.map +1 -0
  219. package/lib/types/hatch-entity.d.ts +116 -0
  220. package/lib/types/hatch-entity.d.ts.map +1 -0
  221. package/lib/types/helper.cjs.map +1 -1
  222. package/lib/types/helper.d.ts +11 -0
  223. package/lib/types/helper.d.ts.map +1 -0
  224. package/lib/types/image-entity.d.ts +25 -0
  225. package/lib/types/image-entity.d.ts.map +1 -0
  226. package/lib/types/index.cjs +20 -0
  227. package/lib/types/index.cjs.map +2 -2
  228. package/lib/types/index.d.ts +43 -0
  229. package/lib/types/index.d.ts.map +1 -0
  230. package/lib/types/index.js +10 -0
  231. package/lib/types/index.js.map +2 -2
  232. package/lib/types/insert-entity.d.ts +16 -0
  233. package/lib/types/insert-entity.d.ts.map +1 -0
  234. package/lib/types/layer-groups.d.ts +6 -0
  235. package/lib/types/layer-groups.d.ts.map +1 -0
  236. package/lib/types/leader-entity.d.ts +28 -0
  237. package/lib/types/leader-entity.d.ts.map +1 -0
  238. package/lib/types/line-entity.d.ts +8 -0
  239. package/lib/types/line-entity.d.ts.map +1 -0
  240. package/lib/types/mleader-entity.cjs +17 -0
  241. package/lib/types/mleader-entity.cjs.map +7 -0
  242. package/lib/types/mleader-entity.d.ts +7 -0
  243. package/lib/types/mleader-entity.d.ts.map +1 -0
  244. package/lib/types/mleader-entity.js +1 -0
  245. package/lib/types/mleader-entity.js.map +7 -0
  246. package/lib/types/mline-entity.cjs +17 -0
  247. package/lib/types/mline-entity.cjs.map +7 -0
  248. package/lib/types/mline-entity.d.ts +10 -0
  249. package/lib/types/mline-entity.d.ts.map +1 -0
  250. package/lib/types/mline-entity.js +1 -0
  251. package/lib/types/mline-entity.js.map +7 -0
  252. package/lib/types/mtext-entity.d.ts +33 -0
  253. package/lib/types/mtext-entity.d.ts.map +1 -0
  254. package/lib/types/ole2frame-entity.d.ts +33 -0
  255. package/lib/types/ole2frame-entity.d.ts.map +1 -0
  256. package/lib/types/oleframe-entity.cjs +17 -0
  257. package/lib/types/oleframe-entity.cjs.map +7 -0
  258. package/lib/types/oleframe-entity.d.ts +33 -0
  259. package/lib/types/oleframe-entity.d.ts.map +1 -0
  260. package/lib/types/oleframe-entity.js +1 -0
  261. package/lib/types/oleframe-entity.js.map +7 -0
  262. package/lib/types/options.cjs.map +1 -1
  263. package/lib/types/options.d.ts +57 -0
  264. package/lib/types/options.d.ts.map +1 -0
  265. package/lib/types/point-entity.d.ts +5 -0
  266. package/lib/types/point-entity.d.ts.map +1 -0
  267. package/lib/types/polyline-entity.d.ts +17 -0
  268. package/lib/types/polyline-entity.d.ts.map +1 -0
  269. package/lib/types/polylines.d.ts +18 -0
  270. package/lib/types/polylines.d.ts.map +1 -0
  271. package/lib/types/ray-entity.cjs +17 -0
  272. package/lib/types/ray-entity.cjs.map +7 -0
  273. package/lib/types/ray-entity.d.ts +10 -0
  274. package/lib/types/ray-entity.d.ts.map +1 -0
  275. package/lib/types/ray-entity.js +1 -0
  276. package/lib/types/ray-entity.js.map +7 -0
  277. package/lib/types/region-entity.cjs +17 -0
  278. package/lib/types/region-entity.cjs.map +7 -0
  279. package/lib/types/region-entity.d.ts +10 -0
  280. package/lib/types/region-entity.d.ts.map +1 -0
  281. package/lib/types/region-entity.js +1 -0
  282. package/lib/types/region-entity.js.map +7 -0
  283. package/lib/types/shape-entity.cjs +17 -0
  284. package/lib/types/shape-entity.cjs.map +7 -0
  285. package/lib/types/shape-entity.d.ts +17 -0
  286. package/lib/types/shape-entity.d.ts.map +1 -0
  287. package/lib/types/shape-entity.js +1 -0
  288. package/lib/types/shape-entity.js.map +7 -0
  289. package/lib/types/solid-entity.d.ts +7 -0
  290. package/lib/types/solid-entity.d.ts.map +1 -0
  291. package/lib/types/spline-entity.d.ts +10 -0
  292. package/lib/types/spline-entity.d.ts.map +1 -0
  293. package/lib/types/svg.d.ts +27 -0
  294. package/lib/types/svg.d.ts.map +1 -0
  295. package/lib/types/table-entity.cjs +17 -0
  296. package/lib/types/table-entity.cjs.map +7 -0
  297. package/lib/types/table-entity.d.ts +12 -0
  298. package/lib/types/table-entity.d.ts.map +1 -0
  299. package/lib/types/table-entity.js +1 -0
  300. package/lib/types/table-entity.js.map +7 -0
  301. package/lib/types/tables.cjs.map +1 -1
  302. package/lib/types/tables.d.ts +549 -0
  303. package/lib/types/tables.d.ts.map +1 -0
  304. package/lib/types/text-entity.d.ts +21 -0
  305. package/lib/types/text-entity.d.ts.map +1 -0
  306. package/lib/types/tolerance-entity.d.ts +14 -0
  307. package/lib/types/tolerance-entity.d.ts.map +1 -0
  308. package/lib/types/trace-entity.cjs +17 -0
  309. package/lib/types/trace-entity.cjs.map +7 -0
  310. package/lib/types/trace-entity.d.ts +10 -0
  311. package/lib/types/trace-entity.d.ts.map +1 -0
  312. package/lib/types/trace-entity.js +1 -0
  313. package/lib/types/trace-entity.js.map +7 -0
  314. package/lib/types/underlay-entity.d.ts +26 -0
  315. package/lib/types/underlay-entity.d.ts.map +1 -0
  316. package/lib/types/util-types.d.ts +22 -0
  317. package/lib/types/util-types.d.ts.map +1 -0
  318. package/lib/types/viewport-entity.d.ts +79 -0
  319. package/lib/types/viewport-entity.d.ts.map +1 -0
  320. package/lib/types/wipeout-entity.cjs +17 -0
  321. package/lib/types/wipeout-entity.cjs.map +7 -0
  322. package/lib/types/wipeout-entity.d.ts +18 -0
  323. package/lib/types/wipeout-entity.d.ts.map +1 -0
  324. package/lib/types/wipeout-entity.js +1 -0
  325. package/lib/types/wipeout-entity.js.map +7 -0
  326. package/lib/types/xline-entity.cjs +17 -0
  327. package/lib/types/xline-entity.cjs.map +7 -0
  328. package/lib/types/xline-entity.d.ts +10 -0
  329. package/lib/types/xline-entity.d.ts.map +1 -0
  330. package/lib/types/xline-entity.js +1 -0
  331. package/lib/types/xline-entity.js.map +7 -0
  332. package/lib/types.d.ts +2 -0
  333. package/lib/types.d.ts.map +1 -0
  334. package/lib/util/bSpline.d.ts +8 -0
  335. package/lib/util/bSpline.d.ts.map +1 -0
  336. package/lib/util/colors.d.ts +5 -0
  337. package/lib/util/colors.d.ts.map +1 -0
  338. package/lib/util/createArcForLWPolyline.d.ts +9 -0
  339. package/lib/util/createArcForLWPolyline.d.ts.map +1 -0
  340. package/lib/util/dxfColorToRGB.d.ts +22 -0
  341. package/lib/util/dxfColorToRGB.d.ts.map +1 -0
  342. package/lib/util/escapeXmlText.d.ts +2 -0
  343. package/lib/util/escapeXmlText.d.ts.map +1 -0
  344. package/lib/util/insertKnot.d.ts +9 -0
  345. package/lib/util/insertKnot.d.ts.map +1 -0
  346. package/lib/util/logger.d.ts +10 -0
  347. package/lib/util/logger.d.ts.map +1 -0
  348. package/lib/util/rgbToColorAttribute.d.ts +7 -0
  349. package/lib/util/rgbToColorAttribute.d.ts.map +1 -0
  350. package/lib/util/rotate.d.ts +9 -0
  351. package/lib/util/rotate.d.ts.map +1 -0
  352. package/lib/util/round10.d.ts +2 -0
  353. package/lib/util/round10.d.ts.map +1 -0
  354. package/lib/util/toPiecewiseBezier.d.ts +18 -0
  355. package/lib/util/toPiecewiseBezier.d.ts.map +1 -0
  356. package/lib/util/transformBoundingBoxAndElement.d.ts +9 -0
  357. package/lib/util/transformBoundingBoxAndElement.d.ts.map +1 -0
  358. package/package.json +5 -19
  359. package/src/Helper.ts +6 -1
  360. package/src/entityToPolyline.ts +124 -2
  361. package/src/handlers/entities.ts +21 -1
  362. package/src/handlers/entity/mleader.ts +46 -0
  363. package/src/handlers/entity/mline.ts +74 -0
  364. package/src/handlers/entity/oleframe.ts +62 -0
  365. package/src/handlers/entity/ray.ts +52 -0
  366. package/src/handlers/entity/region.ts +42 -0
  367. package/src/handlers/entity/shape.ts +73 -0
  368. package/src/handlers/entity/table.ts +49 -0
  369. package/src/handlers/entity/trace.ts +72 -0
  370. package/src/handlers/entity/wipeout.ts +114 -0
  371. package/src/handlers/entity/xline.ts +52 -0
  372. package/src/handlers/objects.ts +64 -8
  373. package/src/handlers/tables.ts +134 -21
  374. package/src/index.ts +9 -18
  375. package/src/toJson.ts +8 -0
  376. package/src/toSVG.ts +45 -3
  377. package/src/types/entity.ts +20 -0
  378. package/src/types/helper.ts +2 -1
  379. package/src/types/index.ts +10 -0
  380. package/src/types/mleader-entity.ts +8 -0
  381. package/src/types/mline-entity.ts +12 -0
  382. package/src/types/oleframe-entity.ts +40 -0
  383. package/src/types/options.ts +7 -0
  384. package/src/types/ray-entity.ts +12 -0
  385. package/src/types/region-entity.ts +11 -0
  386. package/src/types/shape-entity.ts +19 -0
  387. package/src/types/table-entity.ts +14 -0
  388. package/src/types/tables.ts +76 -0
  389. package/src/types/trace-entity.ts +14 -0
  390. package/src/types/wipeout-entity.ts +20 -0
  391. package/src/types/xline-entity.ts +12 -0
  392. package/docs/DIMENSION_SUMMARY.md +0 -254
  393. package/docs/DXF_VERSION_SUPPORT.md +0 -45
  394. package/docs/ENTITY_SVG_ROADMAP.md +0 -96
  395. package/docs/IMPLEMENTED-2D-ENTITIES.md +0 -54
  396. package/docs/README.md +0 -22
  397. package/docs/SVG_RENDERING_INTEGRATION_TESTS.md +0 -119
  398. package/docs/TEXT-MTEXT-DIMENSION-SUPPORT.md +0 -241
@@ -17,6 +17,17 @@ This document describes a phased plan to align this project’s DXF parsing beha
17
17
  - Full ObjectARX/.NET API parity (this is a DXF parser, not a CAD kernel).
18
18
  - Perfect fidelity for every proprietary/extension object (fallback behavior is acceptable).
19
19
 
20
+ ## Progress
21
+
22
+ Last updated: 2026-01-01
23
+
24
+ - M0 — Baseline & Regression Harness: done (existing unit + integration coverage is in place).
25
+ - M1 — DXF Format & Section-Level Compliance: ongoing (incremental hardening as fixtures demand).
26
+ - M2 — TABLES Coverage (2D-Relevant): in progress (added minimal parsing for APPID, BLOCK_RECORD, UCS, VIEW).
27
+ - M3 — OBJECTS Coverage (2D-Relevant): in progress (DICTIONARY/XRECORD/IMAGEDEF/UNDERLAY definitions exist; added minimal DIMASSOC parsing).
28
+ - M4 — ENTITIES: Complete 2D Set: ongoing (added TRACE parse + toPolylines support).
29
+ - M5 — Rendering Parity (toPolylines / toSVG): ongoing (TRACE now renders in SVG as a filled path; LEADER now converts to polylines; RAY/XLINE now render via finite polyline fallback; SHAPE renders as text fallback).
30
+
20
31
  ## References
21
32
 
22
33
  ### Primary (ezdxf stable docs)
@@ -36,7 +47,186 @@ When behavior is ambiguous or disputed, treat Autodesk’s DXF reference as auth
36
47
 
37
48
  Project documentation index:
38
49
 
39
- - `docs/README.md`
50
+ This plan also serves as the documentation index.
51
+
52
+ Standalone reference docs that remain under `docs/`:
53
+
54
+ - `docs/autocad_2012_pdf_dxf-reference_enu.md` (local reference copy)
55
+ - `docs/EZDXF_REFERENCE_SITEMAP.md` (ezdxf reference navigation)
56
+ - `docs/FIXTURE_VALIDATION_EZDXF.md` (ezdxf-based fixture validation)
57
+
58
+ ## Documentation (Consolidated)
59
+
60
+ This section consolidates documentation previously living under `docs/` so the project roadmap and implementation guidance are in one place.
61
+
62
+ ### Where to Start
63
+
64
+ - Entity support overview: “Implemented Entities (2D)” below
65
+ - DXF version support notes: “DXF Version Support” below
66
+ - Text + annotation notes: “TEXT / MTEXT / DIMENSION (SVG)” below
67
+ - SVG integration testing: “SVG Rendering Integration Tests” below
68
+ - Entity-by-entity workflow: “Entity SVG Roadmap” below
69
+
70
+ ### DXF Version Support
71
+
72
+ The parser is designed around DXF group codes and sections, and does not currently gate behavior on `$ACADVER`.
73
+
74
+ In practice, this means:
75
+
76
+ - We aim to parse and render supported entities across many DXF versions.
77
+ - We treat `$ACADVER` primarily as a fixture metadata signal and future compatibility hook.
78
+
79
+ Supporting “the latest AutoCAD DXF” is best defined as:
80
+
81
+ - The library can load DXF files produced by recent AutoCAD versions without rejecting due to version, and
82
+ - The library has fixtures that include a recent `$ACADVER` value, validated by ezdxf.
83
+
84
+ Recommended strategy:
85
+
86
+ - Track `$ACADVER` in fixture validation (see `docs/FIXTURE_VALIDATION_EZDXF.md`).
87
+ - Add at least one fixture exported from a recent AutoCAD version (keep it small and single-purpose; prefer a fixture that includes DIMENSION + text).
88
+ - Add an integration test for that fixture (goal: “does not throw + expected key SVG features exist”).
89
+ - Document which `$ACADVER` values are present in fixtures.
90
+
91
+ Non-goals:
92
+
93
+ - Guarantee support for every new entity introduced by new DXF versions.
94
+ - Guarantee binary DXF support (unless explicitly added).
95
+
96
+ If version-specific behavior is needed later:
97
+
98
+ - Add a header helper that exposes `$ACADVER` in a typed way.
99
+ - Add tests covering version-specific parsing/rendering differences.
100
+
101
+ ### Implemented Entities (2D)
102
+
103
+ This list was generated based on the AutoCAD 2012 DXF reference documentation. It catalogs 2D entities, indicating whether they have already been implemented in this project.
104
+
105
+ | Entity | Implemented | Description |
106
+ | :--- | :---: | :--- |
107
+ | **ARC** | ✅ | A circular arc. |
108
+ | **CIRCLE** | ✅ | A circle. |
109
+ | **ELLIPSE** | ✅ | An ellipse or elliptical arc. |
110
+ | **HATCH** | ✅ | Fills a bounded area with a pattern, solid color, or gradient. |
111
+ | **LINE** | ✅ | A straight line segment. |
112
+ | **LWPOLYLINE** | ✅ | A lightweight 2D polyline. |
113
+ | **MTEXT** | ✅ | Multi-line text with advanced formatting (partial formatting support in SVG). |
114
+ | **POINT** | ✅ | A point entity. |
115
+ | **POLYLINE** | ✅ | A 2D or 3D polyline (with vertices). |
116
+ | **SOLID** | ✅ | A 2D area filled with solid color. |
117
+ | **SPLINE** | ✅ | A spline curve. |
118
+ | **TEXT** | ✅ | A single line of text. |
119
+ | **DIMENSION** | ✅ | Dimension entity (linear, angular, radial, etc.). DIMSTYLE integration and SVG rendering are implemented (see “DIMENSION Implementation Summary”). |
120
+ | **INSERT** | ✅ | A block insertion (block reference). |
121
+ | **ATTDEF** | ✅ | Attribute definition for a block. |
122
+ | **ATTRIB** | ✅ | An attribute instance attached to a block. |
123
+ | **OLE2FRAME** | ✅ | An OLE (Object Linking and Embedding) object. |
124
+ | **LEADER** | ✅ | A leader line, used for annotations. |
125
+ | **MLINE** | ❌ | A multi-line entity with parallel lines. |
126
+ | **RAY** | ✅ | A semi-infinite line that extends infinitely in one direction from its start point. |
127
+ | **SHAPE** | ✅ | A shape from a shape file (.shx). |
128
+ | **TOLERANCE** | ✅ | A geometric tolerance (feature control frame). |
129
+ | **TRACE** | ✅ | A solid 2D line with width. |
130
+ | **WIPEOUT** | ✅ | A background masking area (currently rendered as an outline-only fallback; no masking yet). |
131
+ | **XLINE** | ✅ | An infinite construction line. |
132
+
133
+ ### TEXT / MTEXT / DIMENSION (SVG)
134
+
135
+ This project supports SVG rendering for TEXT, MTEXT, and DIMENSION entities.
136
+
137
+ Notes:
138
+
139
+ - Text font selection is not currently respected in SVG (defaults to browser font).
140
+ - Complex MTEXT formatting is not fully supported (kept intentionally incremental).
141
+ - Text bounding boxes are approximate.
142
+
143
+ Supported group code highlights:
144
+
145
+ - TEXT: text (1), insertion point (10/20/30), alignment point (11/21/31), height (40), scale X (41), rotation (50), oblique (51), align (72/73)
146
+ - MTEXT: text (1/3), insertion point (10/20/30), X-axis direction (11/21/31), nominal height (40), reference width (41), attachment (71), drawing direction (72)
147
+ - DIMENSION: block name (2), definition point (10/20/30), text midpoint (11/21/31), measurement points (13/23/33, 14/24/34), rotation (50), type (70)
148
+
149
+ Example:
150
+
151
+ ```typescript
152
+ import { Helper } from '@linkiez/dxf-renew'
153
+
154
+ const helper = new Helper(dxfString)
155
+ const svg = helper.toSVG()
156
+ ```
157
+
158
+ ### SVG Rendering Integration Tests
159
+
160
+ Goal: validate final SVG output for real DXF fixtures:
161
+
162
+ `DXF fixture → parseString() → (optional denormalise) → toSVG() → SVG assertions`
163
+
164
+ Framework:
165
+
166
+ - Final rendering integration tests run in a real browser using Playwright.
167
+
168
+ Where tests live:
169
+
170
+ - Integration tests: `test/integration/**`
171
+ - Browser integration tests: `test/integration-browser/**`
172
+ - DXF fixtures: `test/resources/*.dxf`
173
+
174
+ Recommended assertions:
175
+
176
+ 1. SVG well-formed envelope (`<svg>`, `</svg>`, `viewBox`)
177
+ 2. Entity-specific elements (`<line>`, `<path>`, `<circle>`, `<text>`, `<image>`)
178
+ 3. Critical attributes (e.g. `marker-start` / `marker-end` for DIMENSION)
179
+ 4. Text content (when applicable)
180
+ 5. “Does not throw” for a curated set of fixtures
181
+
182
+ Saved render artifacts (PNG):
183
+
184
+ - Browser integration tests should save a screenshot under `test/rendered/` for manual review.
185
+ - Prefer deterministic filenames tied to fixtures, e.g. `test/rendered/dimension-vertical.png`.
186
+
187
+ Handling non-deterministic IDs:
188
+
189
+ - Some SVG IDs are timestamp-based (e.g. DIMENSION arrow markers). Validate prefix-based patterns instead of exact IDs.
190
+
191
+ ### Entity SVG Roadmap (Fixture → ezdxf → SVG Integration)
192
+
193
+ This roadmap is a repeatable checklist for each DXF entity:
194
+
195
+ - Confirm/produce a fixture in `test/resources/`.
196
+ - Validate it with ezdxf (see `docs/FIXTURE_VALIDATION_EZDXF.md`).
197
+ - Add/extend unit parsing tests.
198
+ - Add final SVG integration tests.
199
+
200
+ Template:
201
+
202
+ - Fixture: add or pick a DXF fixture in `test/resources/<entity>-<scenario>.dxf` (keep fixtures minimal).
203
+ - ezdxf validation: run `yarn validate:fixtures`, confirm the file loads, `$ACADVER` is present, and entity counts include your target entity.
204
+ - Unit tests: add unit parsing tests under `test/unit/`, assert minimum required fields for the entity type.
205
+ - SVG integration tests: add `test/integration-browser/<entity>-rendering.browser.spec.js`, assert SVG envelope + required elements/attributes + expected text content when applicable.
206
+
207
+ Saved PNG per entity (required):
208
+
209
+ - Every browser integration test should save a screenshot to `test/rendered/<fixture-name>.png`.
210
+
211
+ ### DIMENSION Implementation Summary
212
+
213
+ The DIMENSION entity is implemented with support for the DIMSTYLE system, including parsing, storage, and SVG rendering.
214
+
215
+ Highlights:
216
+
217
+ - DIMSTYLE parsing in `src/handlers/tables.ts` (dozens of properties including arrow blocks, tolerances, alternate units).
218
+ - Rendering module `src/dimensionToSVG.ts` dispatches by dimension type and generates SVG markers for arrows.
219
+ - Color + lineweight support via DIMSTYLE values (dimension, extension, and text colors; line weights).
220
+
221
+ Dimension types supported in SVG rendering:
222
+
223
+ - Type 0/1 (linear): extension lines, dimension line, arrows, rotated text
224
+ - Type 2 (angular): arc dimension line, arrows, rotated text
225
+ - Type 3 (diameter): ⌀ symbol
226
+ - Type 4 (radius): R prefix
227
+ - Type 6 (ordinate): leader line and coordinate text
228
+
229
+ Optional features (not implemented): custom arrow blocks rendering, full tolerances/alternate units formatting, per-entity XDATA overrides.
40
230
 
41
231
  ## “Sitemap” / Checklist Source
42
232
 
@@ -52,8 +242,8 @@ This section is intentionally short; it highlights gaps relevant to the migratio
52
242
 
53
243
  Entity parsers currently exist for (see `src/handlers/entities.ts` and `src/handlers/entity/*`):
54
244
 
55
- - Implemented: ARC, ATTDEF, ATTRIB, CIRCLE, DIMENSION, ELLIPSE, HATCH, INSERT, LINE, LWPOLYLINE, MTEXT, OLE2FRAME, POINT, POLYLINE, SOLID, SPLINE, TEXT, 3DFACE, VERTEX, VIEWPORT.
56
- - Missing (not exhaustive): IMAGE, LEADER, MLEADER, MLINE, OLEFRAME, RAY, REGION, SEQEND handling robustness, TRACE, UNDERLAY, WIPEOUT, XLINE, SHAPE, TABLE (entity), TOLERANCE.
245
+ - Implemented: ARC, ATTDEF, ATTRIB, CIRCLE, DIMENSION, ELLIPSE, HATCH, INSERT, LEADER, LINE, LWPOLYLINE, MTEXT, OLE2FRAME, POINT, POLYLINE, RAY, SHAPE, SOLID, SPLINE, TEXT, TOLERANCE, TRACE, WIPEOUT, XLINE, 3DFACE, VERTEX, VIEWPORT.
246
+ - Missing (not exhaustive): SEQEND handling robustness.
57
247
 
58
248
  ### Tables
59
249
 
@@ -66,8 +256,8 @@ Entity parsers currently exist for (see `src/handlers/entities.ts` and `src/hand
66
256
 
67
257
  `src/handlers/objects.ts` currently parses:
68
258
 
69
- - Implemented: LAYOUT (partial), DICTIONARY, XRECORD.
70
- - Missing from Autodesk TOC subset above: DIMASSOC, IMAGEDEF (+ reactor), FIELD, TABLESTYLE, GROUP, etc.
259
+ - Implemented: LAYOUT (partial), DICTIONARY, XRECORD, DIMASSOC, FIELD, IMAGEDEF (+ reactor), UNDERLAY definitions.
260
+ - Missing from Autodesk TOC subset above: TABLESTYLE, GROUP, etc.
71
261
 
72
262
  ## Project Analysis (Code-Backed)
73
263
 
@@ -279,7 +469,7 @@ There is already substantial fixture coverage in `test/resources/*.dxf` and unit
279
469
 
280
470
  1. Implement missing entity handlers (prioritized)
281
471
 
282
- Annotation: LEADER, MLEADER, TOLERANCE. Geometry: REGION, TRACE. Reference: IMAGE, UNDERLAY, WIPEOUT. Construction: RAY, XLINE. Legacy: OLEFRAME. Table-in-entities: TABLE (entity). Optional/edge: SHAPE, MLINE.
472
+ Annotation: MLEADER. Geometry: REGION. Reference: IMAGE, UNDERLAY. Legacy: OLEFRAME. Table-in-entities: TABLE (entity). Optional/edge: MLINE.
283
473
 
284
474
  1. Ensure common fields are handled consistently
285
475
 
@@ -340,27 +530,29 @@ Legend:
340
530
 
341
531
  ### A.1 Entities (2D-critical)
342
532
 
343
- Already parsed (handlers exist): LINE, LWPOLYLINE, POLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE, TEXT, MTEXT, DIMENSION, INSERT, ATTDEF, ATTRIB, HATCH, SOLID, POINT, VIEWPORT, OLE2FRAME.
533
+ Already parsed (handlers exist): LINE, LWPOLYLINE, POLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE, TEXT, MTEXT, DIMENSION, INSERT, ATTDEF, ATTRIB, HATCH, SOLID, TRACE, POINT, VIEWPORT, OLE2FRAME, LEADER, RAY, XLINE, SHAPE, TOLERANCE, WIPEOUT.
534
+
535
+ Also parsed (parse-only / safe ignore): MLEADER, MLINE, OLEFRAME, REGION, TABLE (entity).
344
536
 
345
537
  The items below are the main gaps to reach “complete 2D” as defined in this plan.
346
538
 
347
539
  | Entity | Parse | Render (SVG) | Render (Polylines) | Block-safe | Minimal implementation checklist |
348
540
  | --- | --- | --- | --- | --- | --- |
349
541
  | SEQEND | Sentinel only | N/A | N/A | N/A | Add `src/handlers/entity/seqend.ts` (optional) or harden sequencing in `src/handlers/entities.ts` + add fixture that stresses POLYLINE/VERTEX/SEQEND ordering |
350
- | LEADER | Yes | Yes | No | No | Add `src/types/leader-entity.ts` + export in `src/types/index.ts`; add `src/handlers/entity/leader.ts`; add `toSVG` case (even minimal); add fixture + unit test |
351
- | MLEADER | No | No | No | No | Add `src/types/mleader-entity.ts`; add `src/handlers/entity/mleader.ts`; likely requires OBJECTS support (DICTIONARY/XRECORD) for full fidelity; start with parse-only + safe ignore in render |
352
- | TOLERANCE | Yes | Yes | No | No | Add `src/types/tolerance-entity.ts`; add `src/handlers/entity/tolerance.ts`; render as text fallback (SVG only) |
542
+ | LEADER | Yes | Yes | Yes | No | Implemented (minimal polyline support + SVG routing) |
543
+ | MLEADER | Yes | No | No | No | Implemented parse-only + safe ignore in rendering |
544
+ | TOLERANCE | Yes | Yes | No | No | Implemented (SVG text fallback only) |
353
545
  | IMAGE | Yes | No | No | No | Add `src/types/image-entity.ts`; add `src/handlers/entity/image.ts`; add OBJECTS: IMAGEDEF/IMAGEDEF_REACTOR; render as placeholder rect or ignore safely |
354
546
  | UNDERLAY | Yes | No | No | No | Add `src/types/underlay-entity.ts`; add `src/handlers/entity/dwfUnderlay.ts` + `src/handlers/entity/dgnUnderlay.ts`; add OBJECTS: UNDERLAYDEFINITION; render placeholder/ignore |
355
- | WIPEOUT | No | No | No | No | Add `src/types/wipeout-entity.ts`; add `src/handlers/entity/wipeout.ts`; render as polygon mask approximation or ignore safely |
356
- | RAY | No | No | No | No | Add `src/types/ray-entity.ts`; add `src/handlers/entity/ray.ts`; render as long line (bounded by extents) or ignore |
357
- | XLINE | No | No | No | No | Add `src/types/xline-entity.ts`; add `src/handlers/entity/xline.ts`; render as long line (bounded by extents) or ignore |
358
- | OLEFRAME | No | No | No | No | Add `src/types/oleframe-entity.ts`; add `src/handlers/entity/oleframe.ts`; render placeholder/ignore |
359
- | TRACE | No | No | No | No | Add `src/types/trace-entity.ts`; add `src/handlers/entity/trace.ts`; render as closed polyline (both SVG and polylines) |
360
- | REGION | No | No | No | No | Add `src/types/region-entity.ts`; add `src/handlers/entity/region.ts`; start with parse-only + safe ignore in render |
361
- | TABLE (entity) | No | No | No | No | Add `src/types/table-entity.ts`; add `src/handlers/entity/table.ts`; render minimal (text grid) or ignore safely |
362
- | SHAPE | No | No | No | No | Add `src/types/shape-entity.ts`; add `src/handlers/entity/shape.ts`; likely depends on STYLE/LTYPE; start parse-only |
363
- | MLINE | No | No | No | No | Add `src/types/mline-entity.ts`; add `src/handlers/entity/mline.ts`; likely depends on MLSTYLE object/table; start parse-only |
547
+ | WIPEOUT | Yes | Yes | Yes | No | Implemented (outline-only; masking not yet implemented) |
548
+ | RAY | Yes | Yes | Yes | No | Implemented (finite fallback in polyline/SVG) |
549
+ | XLINE | Yes | Yes | Yes | No | Implemented (finite fallback in polyline/SVG) |
550
+ | OLEFRAME | Yes | No | No | No | Implemented parse-only + safe ignore in rendering |
551
+ | TRACE | Yes | Yes | Yes | No | Implemented (filled SVG + closed polyline) |
552
+ | REGION | Yes | No | No | No | Implemented parse-only + safe ignore in rendering |
553
+ | TABLE (entity) | Yes | No | No | No | Implemented parse-only + safe ignore in rendering |
554
+ | SHAPE | Yes | Yes | Yes | No | Implemented (minimal polyline + SVG text fallback) |
555
+ | MLINE | Yes | No | No | No | Implemented parse-only + safe ignore in rendering |
364
556
 
365
557
  ### A.2 Tables (2D-relevant)
366
558
 
@@ -377,10 +569,10 @@ The items below are the main gaps to reach “complete 2D” as defined in this
377
569
  | --- | --- | --- | --- |
378
570
  | DICTIONARY | Implemented | `src/handlers/objects.ts` (+ new types file if desired) | Group objects by `0`; add DICTIONARY parser; store by handle for lookup |
379
571
  | XRECORD | Implemented | `src/handlers/objects.ts` | Add XRECORD parser; preserve raw records for downstream consumers |
380
- | DIMASSOC | Missing | `src/handlers/objects.ts` | Add DIMASSOC parse with safe unresolved references; add fixture-based test |
572
+ | DIMASSOC | Implemented | `src/handlers/objects.ts` | Implemented minimal parse; preserves raw tuples for downstream consumers |
381
573
  | IMAGEDEF / IMAGEDEF_REACTOR | Implemented | `src/handlers/objects.ts` | Parse enough to resolve IMAGE entity references; do not crash if external files missing |
382
574
  | UNDERLAYDEFINITION | Implemented | `src/handlers/objects.ts` | Parse enough to resolve DWFUNDERLAY/DGNUNDERLAY references; do not crash if external files missing |
383
- | FIELD | Missing | `src/handlers/objects.ts` | Parse as raw text/value pairs; do not attempt full evaluation initially |
575
+ | FIELD | Implemented | `src/handlers/objects.ts` | Implemented minimal parse; preserves raw tuples for downstream consumers |
384
576
  | TABLESTYLE | Missing | `src/handlers/objects.ts` | Parse style basics; used later for TABLE entity rendering |
385
577
  | GROUP | Missing | `src/handlers/objects.ts` | Parse group membership; safe ignore if not used |
386
578
 
@@ -400,7 +592,7 @@ This appendix provides an explicit sequence of PRs. The intent is to keep each P
400
592
  - **Stabilize existing behavior**: ✅ PR B1.1 (POLYLINE/VERTEX/SEQEND sequencing), ✅ PR B1.2 (block basepoint for TEXT/MTEXT/DIMENSION).
401
593
  - **Unblock references and metadata**: ✅ PR B1.3 (OBJECTS dispatch + DICTIONARY), ✅ PR B1.4 (XRECORD).
402
594
  - **Enable images/underlays**: ✅ PR B1.5 (IMAGEDEF / IMAGEDEF_REACTOR), ✅ PR B1.6 (IMAGE entity), ✅ PR B1.7 (UNDERLAY defs + UNDERLAY entity).
403
- - **Add remaining common 2D annotation**: ✅ PR B1.8 (LEADER), ✅ PR B1.9 (TOLERANCE), PR B1.10 (DIMASSOC), PR B1.11 (MLEADER).
595
+ - **Add remaining common 2D annotation**: ✅ PR B1.8 (LEADER), ✅ PR B1.9 (TOLERANCE), PR B1.10 (DIMASSOC), PR B1.11 (MLEADER).
404
596
 
405
597
  ### B.2 PR templates by feature type
406
598
 
@@ -434,20 +626,20 @@ This table expands Appendix A into explicit PR steps.
434
626
 
435
627
  | Entity | PR 1 (Parse) | PR 2 (SVG) | PR 3 (Polylines) | PR 4 (Block-safe) |
436
628
  | --- | --- | --- | --- | --- |
437
- | LEADER | Add type + handler + register + tests | Add minimal `toSVG` case | Optional (usually not needed) | Update `denormalise` if leader can appear in blocks |
438
- | MLEADER | Add type + handler + register + tests (parse-only) | Safe ignore or placeholder first | N/A | Later, after DICTIONARY/XRECORD/DIMASSOC coverage |
439
- | TOLERANCE | Add type + handler + register + tests | Render as text fallback | N/A | Update `denormalise` if used in blocks |
629
+ | LEADER | Done | Done | Done | Optional |
630
+ | MLEADER | Done (parse-only) | Safe ignore or placeholder first | N/A | Later, after DICTIONARY/XRECORD/DIMASSOC coverage |
631
+ | TOLERANCE | Done | Done (text fallback) | N/A | Optional |
440
632
  | IMAGE | Add IMAGEDEF(+reactor) objects, then IMAGE entity parse + tests | Placeholder rect/image element or safe ignore | N/A | Update `denormalise` for block-contained images |
441
633
  | UNDERLAY | Add underlay defs objects, then UNDERLAY entity parse + tests | Placeholder | N/A | Optional |
442
- | WIPEOUT | Add type + handler + tests (parse-only) | Placeholder or safe ignore | Optional (as polygon) | Optional |
443
- | RAY | Add type + handler + tests | Render as bounded line | Optional | Optional |
444
- | XLINE | Add type + handler + tests | Render as bounded line | Optional | Optional |
445
- | OLEFRAME | Add type + handler + tests | Placeholder or safe ignore | N/A | Optional |
446
- | TRACE | Add type + handler + tests | Render as closed polyline | Add polyline conversion | Optional |
447
- | REGION | Add type + handler + tests (parse-only) | Safe ignore first | Safe ignore | N/A |
448
- | TABLE (entity) | Add type + handler + tests (parse-only) | Safe ignore/placeholder | N/A | Optional |
449
- | SHAPE | Add type + handler + tests (parse-only) | Safe ignore first | N/A | N/A |
450
- | MLINE | Add type + handler + tests (parse-only) | Safe ignore first | N/A | N/A |
634
+ | WIPEOUT | Done | Done (outline-only fallback) | Done | Optional |
635
+ | RAY | Done | Done | Done | Optional |
636
+ | XLINE | Done | Done | Done | Optional |
637
+ | OLEFRAME | Done | Placeholder or safe ignore | N/A | Optional |
638
+ | TRACE | Done | Done | Done | Optional |
639
+ | REGION | Done (parse-only) | Safe ignore first | Safe ignore | N/A |
640
+ | TABLE (entity) | Done (parse-only) | Safe ignore/placeholder | N/A | Optional |
641
+ | SHAPE | Done | Done (text fallback) | Done | N/A |
642
+ | MLINE | Done (parse-only) | Safe ignore first | N/A | N/A |
451
643
 
452
644
  ### B.4 Concrete PR checklist for missing tables
453
645
 
@@ -462,6 +654,6 @@ This table expands Appendix A into explicit PR steps.
462
654
  - PR: Add XRECORD support + tests.
463
655
  - PR: Add DIMASSOC support + tests.
464
656
  - PR: Add IMAGEDEF / IMAGEDEF_REACTOR support + tests.
465
- - PR: Add FIELD support + tests.
657
+ - PR: Add FIELD support + tests.
466
658
  - PR: Add TABLESTYLE support + tests.
467
659
  - PR: Add GROUP support + tests.
package/build.mjs CHANGED
@@ -1,8 +1,29 @@
1
1
  // esbuild configuration for building the project
2
2
  import * as esbuild from 'esbuild'
3
+ import { execFile } from 'node:child_process'
3
4
  import { readdir } from 'node:fs/promises'
4
5
  import { join } from 'node:path'
5
6
 
7
+ async function emitTypeDeclarations() {
8
+ // Generate *.d.ts into ./lib without emitting JS (esbuild handles JS output)
9
+ await new Promise((resolve, reject) => {
10
+ const child = execFile(
11
+ process.execPath,
12
+ ['./node_modules/typescript/bin/tsc', '-p', './tsconfig.json', '--emitDeclarationOnly'],
13
+ { stdio: 'inherit' },
14
+ error => {
15
+ if (error) {
16
+ reject(error)
17
+ return
18
+ }
19
+ resolve(undefined)
20
+ },
21
+ )
22
+
23
+ child.on('error', reject)
24
+ })
25
+ }
26
+
6
27
  async function getEntryPoints(dir) {
7
28
  const entries = []
8
29
  const stack = [dir]
@@ -29,6 +50,8 @@ async function getEntryPoints(dir) {
29
50
  }
30
51
 
31
52
  async function build() {
53
+ await emitTypeDeclarations()
54
+
32
55
  const entryPoints = await getEntryPoints('src')
33
56
 
34
57
  // Build ESM version
@@ -52,6 +75,11 @@ async function build() {
52
75
  target: 'es2020',
53
76
  sourcemap: true,
54
77
  outExtension: { '.js': '.cjs' },
78
+ // CJS output does not support import.meta; this prevents warnings for code
79
+ // that uses import.meta.url only as an ESM fallback.
80
+ define: {
81
+ 'import.meta.url': '__filename',
82
+ },
55
83
  logLevel: 'info',
56
84
  })
57
85