@mylasertools/kerfscript 0.4.0 → 0.6.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +125 -1
  2. package/LANGUAGE.md +26 -11
  3. package/README.md +79 -5
  4. package/dist/ast.d.cts +13 -1
  5. package/dist/ast.d.ts +13 -1
  6. package/dist/cli.js +7509 -1629
  7. package/dist/diagnostics.d.cts +6 -0
  8. package/dist/diagnostics.d.ts +6 -0
  9. package/dist/evaluator.d.cts +12 -0
  10. package/dist/evaluator.d.ts +12 -0
  11. package/dist/format.d.cts +4 -0
  12. package/dist/format.d.ts +4 -0
  13. package/dist/highlight.cjs +151 -0
  14. package/dist/highlight.d.cts +13 -0
  15. package/dist/highlight.d.ts +13 -0
  16. package/dist/highlight.js +131 -0
  17. package/dist/import/dbg.d.cts +1 -0
  18. package/dist/import/dbg.d.ts +1 -0
  19. package/dist/import/index.d.cts +16 -0
  20. package/dist/import/index.d.ts +16 -0
  21. package/dist/import/shapes.d.cts +76 -0
  22. package/dist/import/shapes.d.ts +76 -0
  23. package/dist/import/svg.d.cts +48 -0
  24. package/dist/import/svg.d.ts +48 -0
  25. package/dist/import/xml.d.cts +12 -0
  26. package/dist/import/xml.d.ts +12 -0
  27. package/dist/index.cjs +391 -13
  28. package/dist/index.d.cts +7 -3
  29. package/dist/index.d.ts +7 -3
  30. package/dist/index.js +391 -13
  31. package/dist/language.cjs +417 -0
  32. package/dist/language.d.cts +143 -0
  33. package/dist/language.d.ts +143 -0
  34. package/dist/language.js +417 -0
  35. package/dist/lexer.d.cts +17 -0
  36. package/dist/lexer.d.ts +17 -0
  37. package/dist/libraries.cjs +380 -0
  38. package/dist/libraries.d.cts +112 -0
  39. package/dist/libraries.d.ts +112 -0
  40. package/dist/libraries.js +380 -0
  41. package/dist/lsp.d.cts +12 -0
  42. package/dist/lsp.d.ts +12 -0
  43. package/dist/paths.d.cts +1 -1
  44. package/dist/paths.d.ts +1 -1
  45. package/dist/signatures.cjs +675 -0
  46. package/dist/signatures.d.cts +20 -0
  47. package/dist/signatures.d.ts +20 -0
  48. package/dist/signatures.js +655 -0
  49. package/docs/cli.md +54 -2
  50. package/docs/desktop.md +5 -0
  51. package/docs/editors.md +121 -0
  52. package/docs/import.md +149 -0
  53. package/docs/javascript.md +177 -10
  54. package/docs/kerf.md +10 -0
  55. package/docs/library/box.svg +11 -0
  56. package/docs/library/calibration.svg +11 -0
  57. package/docs/library/dividers.svg +11 -0
  58. package/docs/library/enclosure.svg +11 -0
  59. package/docs/library/hanging.svg +11 -0
  60. package/docs/library/hinge.svg +11 -0
  61. package/docs/library/tabs.svg +11 -0
  62. package/docs/library.md +339 -0
  63. package/docs/mcp.md +88 -0
  64. package/docs/openscad.md +1 -1
  65. package/docs/shared-libraries.md +229 -0
  66. package/docs/specification.md +529 -0
  67. package/docs/versions.md +2 -2
  68. package/package.json +52 -6
@@ -0,0 +1,48 @@
1
+ import { type Matrix, type Pt } from '../geometry.js';
2
+ export type Seg = {
3
+ c: 'L';
4
+ a: Pt;
5
+ b: Pt;
6
+ } | {
7
+ c: 'C';
8
+ a: Pt;
9
+ p1: Pt;
10
+ p2: Pt;
11
+ b: Pt;
12
+ };
13
+ export interface Sub {
14
+ segs: Seg[];
15
+ closed: boolean;
16
+ }
17
+ export interface LayerRef {
18
+ name: string;
19
+ mode: 'cut' | 'line' | 'fill' | 'guide';
20
+ color: string;
21
+ }
22
+ export interface Item {
23
+ subs: Sub[];
24
+ layer: LayerRef;
25
+ fillRule: 'nonzero' | 'evenodd';
26
+ names: string[];
27
+ filled?: boolean;
28
+ }
29
+ export interface TextItem {
30
+ text: string;
31
+ at: Pt;
32
+ size: number;
33
+ angle: number;
34
+ font: string;
35
+ anchor: 'left' | 'center' | 'right';
36
+ layer: LayerRef;
37
+ }
38
+ export interface SvgDrawing {
39
+ items: Item[];
40
+ texts: TextItem[];
41
+ notes: string[];
42
+ }
43
+ export interface ReadOptions {
44
+ dpi?: number;
45
+ }
46
+ export declare const LAYERS: Record<string, LayerRef>;
47
+ export declare function parseTransform(s: string | undefined): Matrix;
48
+ export declare function readSvg(src: string, opts?: ReadOptions): SvgDrawing;
@@ -0,0 +1,12 @@
1
+ export interface XmlElement {
2
+ name: string;
3
+ attrs: Record<string, string>;
4
+ children: XmlElement[];
5
+ text: string;
6
+ }
7
+ export interface XmlDocument {
8
+ root: XmlElement;
9
+ comments: string[];
10
+ }
11
+ export declare function decode(s: string, custom?: Record<string, string>): string;
12
+ export declare function parseXml(src: string): XmlDocument;
@@ -0,0 +1,12 @@
1
+ export interface XmlElement {
2
+ name: string;
3
+ attrs: Record<string, string>;
4
+ children: XmlElement[];
5
+ text: string;
6
+ }
7
+ export interface XmlDocument {
8
+ root: XmlElement;
9
+ comments: string[];
10
+ }
11
+ export declare function decode(s: string, custom?: Record<string, string>): string;
12
+ export declare function parseXml(src: string): XmlDocument;