@mylasertools/kerfscript 0.2.0 → 0.2.1

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.
@@ -14,7 +14,19 @@ export interface EvalOptions {
14
14
  resolve?: (path: string) => string | undefined;
15
15
  fonts?: FontBook;
16
16
  maxSteps?: number;
17
+ limits?: Partial<Limits>;
17
18
  }
19
+ export interface Limits {
20
+ maxParts: number;
21
+ maxSegments: number;
22
+ maxListLength: number;
23
+ maxListItems: number;
24
+ maxTextLength: number;
25
+ maxPoints: number;
26
+ maxOutputPoints: number;
27
+ maxSheets: number;
28
+ }
29
+ export declare const DEFAULT_LIMITS: Limits;
18
30
  interface ModDef {
19
31
  params: Param[];
20
32
  body: Stmt[];
@@ -63,6 +75,10 @@ export declare class Evaluator {
63
75
  private steps;
64
76
  private depth;
65
77
  private maxSteps;
78
+ readonly limits: Limits;
79
+ private pointCount;
80
+ private itemCount;
81
+ private copies;
66
82
  readonly echoes: string[];
67
83
  readonly warnings: string[];
68
84
  readonly layers: Map<string, LayerDef>;
@@ -73,6 +89,7 @@ export declare class Evaluator {
73
89
  private tick;
74
90
  private load;
75
91
  private hoist;
92
+ private included;
76
93
  private assign;
77
94
  block(stmts: Stmt[], env: Env, top?: boolean): Shape;
78
95
  private stmt;
@@ -86,8 +103,11 @@ export declare class Evaluator {
86
103
  callFunction(f: FnDef | Closure, args: Args, caller: Env, name: string): Value;
87
104
  expr(x: Expr, env: Env): Value;
88
105
  private listItem;
106
+ private grow;
107
+ private charge;
89
108
  private call;
90
109
  private specialFunction;
110
+ private echo;
91
111
  private echoText;
92
112
  private arith;
93
113
  private arg;
@@ -95,6 +115,9 @@ export declare class Evaluator {
95
115
  private vec2;
96
116
  private points;
97
117
  private dyn;
118
+ private spend;
119
+ private checkValue;
120
+ private checkSize;
98
121
  private segs;
99
122
  private thickness;
100
123
  private fingerWidth;
@@ -14,7 +14,19 @@ export interface EvalOptions {
14
14
  resolve?: (path: string) => string | undefined;
15
15
  fonts?: FontBook;
16
16
  maxSteps?: number;
17
+ limits?: Partial<Limits>;
17
18
  }
19
+ export interface Limits {
20
+ maxParts: number;
21
+ maxSegments: number;
22
+ maxListLength: number;
23
+ maxListItems: number;
24
+ maxTextLength: number;
25
+ maxPoints: number;
26
+ maxOutputPoints: number;
27
+ maxSheets: number;
28
+ }
29
+ export declare const DEFAULT_LIMITS: Limits;
18
30
  interface ModDef {
19
31
  params: Param[];
20
32
  body: Stmt[];
@@ -63,6 +75,10 @@ export declare class Evaluator {
63
75
  private steps;
64
76
  private depth;
65
77
  private maxSteps;
78
+ readonly limits: Limits;
79
+ private pointCount;
80
+ private itemCount;
81
+ private copies;
66
82
  readonly echoes: string[];
67
83
  readonly warnings: string[];
68
84
  readonly layers: Map<string, LayerDef>;
@@ -73,6 +89,7 @@ export declare class Evaluator {
73
89
  private tick;
74
90
  private load;
75
91
  private hoist;
92
+ private included;
76
93
  private assign;
77
94
  block(stmts: Stmt[], env: Env, top?: boolean): Shape;
78
95
  private stmt;
@@ -86,8 +103,11 @@ export declare class Evaluator {
86
103
  callFunction(f: FnDef | Closure, args: Args, caller: Env, name: string): Value;
87
104
  expr(x: Expr, env: Env): Value;
88
105
  private listItem;
106
+ private grow;
107
+ private charge;
89
108
  private call;
90
109
  private specialFunction;
110
+ private echo;
91
111
  private echoText;
92
112
  private arith;
93
113
  private arg;
@@ -95,6 +115,9 @@ export declare class Evaluator {
95
115
  private vec2;
96
116
  private points;
97
117
  private dyn;
118
+ private spend;
119
+ private checkValue;
120
+ private checkSize;
98
121
  private segs;
99
122
  private thickness;
100
123
  private fingerWidth;
@@ -1,6 +1,8 @@
1
1
  import type { LayerDef } from '../evaluator.cjs';
2
+ import { type Poly } from '../geometry.cjs';
2
3
  import type { Placed } from '../render.cjs';
3
4
  export declare const n: (v: number) => string;
5
+ export declare function tidy(p: Poly, closed: boolean): [string, string][];
4
6
  export interface LayerPath {
5
7
  name: string;
6
8
  mode: LayerDef['mode'];
@@ -1,6 +1,8 @@
1
1
  import type { LayerDef } from '../evaluator.js';
2
+ import { type Poly } from '../geometry.js';
2
3
  import type { Placed } from '../render.js';
3
4
  export declare const n: (v: number) => string;
5
+ export declare function tidy(p: Poly, closed: boolean): [string, string][];
4
6
  export interface LayerPath {
5
7
  name: string;
6
8
  mode: LayerDef['mode'];