@mylasertools/kerfscript 0.2.1 → 0.3.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.
@@ -98,6 +98,8 @@ export declare class Evaluator {
98
98
  private loop;
99
99
  private evalArgs;
100
100
  private bindParams;
101
+ private unknownArg;
102
+ private warn;
101
103
  private callModule;
102
104
  private childStmts;
103
105
  callFunction(f: FnDef | Closure, args: Args, caller: Env, name: string): Value;
@@ -107,6 +109,7 @@ export declare class Evaluator {
107
109
  private charge;
108
110
  private call;
109
111
  private specialFunction;
112
+ private assert;
110
113
  private echo;
111
114
  private echoText;
112
115
  private arith;
@@ -98,6 +98,8 @@ export declare class Evaluator {
98
98
  private loop;
99
99
  private evalArgs;
100
100
  private bindParams;
101
+ private unknownArg;
102
+ private warn;
101
103
  private callModule;
102
104
  private childStmts;
103
105
  callFunction(f: FnDef | Closure, args: Args, caller: Env, name: string): Value;
@@ -107,6 +109,7 @@ export declare class Evaluator {
107
109
  private charge;
108
110
  private call;
109
111
  private specialFunction;
112
+ private assert;
110
113
  private echo;
111
114
  private echoText;
112
115
  private arith;
@@ -1,3 +1,3 @@
1
- import type { LayerDef } from '../evaluator.cjs';
1
+ import { type LayerDef } from '../evaluator.cjs';
2
2
  import type { Placed } from '../render.cjs';
3
3
  export declare function toDxf(items: Placed[], _width: number, height: number, layers: LayerDef[]): string;
@@ -1,3 +1,3 @@
1
- import type { LayerDef } from '../evaluator.js';
1
+ import { type LayerDef } from '../evaluator.js';
2
2
  import type { Placed } from '../render.js';
3
3
  export declare function toDxf(items: Placed[], _width: number, height: number, layers: LayerDef[]): string;
@@ -0,0 +1,3 @@
1
+ export declare const BUILTIN_FONT = "Atkinson";
2
+ /** Adds the built-in font after the given fonts, unless one has its name. */
3
+ export declare function withBuiltinFont(fonts: Record<string, Uint8Array>): Record<string, Uint8Array>;
package/dist/font.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare const BUILTIN_FONT = "Atkinson";
2
+ /** Adds the built-in font after the given fonts, unless one has its name. */
3
+ export declare function withBuiltinFont(fonts: Record<string, Uint8Array>): Record<string, Uint8Array>;
@@ -1,4 +1,23 @@
1
1
  import { type Value } from './values.cjs';
2
- type Fn = (args: Value[], named: Map<string, Value>) => Value;
3
- export declare const FUNCTIONS: Record<string, Fn>;
2
+ export interface FnCtx {
3
+ maxLength: number;
4
+ step: (n?: number) => void;
5
+ given: number;
6
+ }
7
+ type Run = (args: Value[], c: FnCtx) => Value;
8
+ export interface Builtin {
9
+ params: string[];
10
+ rest: boolean;
11
+ order?: (n: number) => string[];
12
+ run: Run;
13
+ }
14
+ export declare function givenTwice(f: Builtin, pos: Value[], named: Map<string, Value>): string[];
15
+ export declare function bindArgs(f: Builtin, pos: Value[], named: Map<string, Value>): Value[];
16
+ /**
17
+ * Steps a built-in takes to go through its arguments: one for each item of a
18
+ * list or range and each character of a string. len() of a list is a single
19
+ * step. A range is counted up to just past max, the most items it may hold.
20
+ */
21
+ export declare function argumentWork(name: string, args: Value[], max: number): number;
22
+ export declare const FUNCTIONS: Record<string, Builtin>;
4
23
  export {};
@@ -1,4 +1,23 @@
1
1
  import { type Value } from './values.js';
2
- type Fn = (args: Value[], named: Map<string, Value>) => Value;
3
- export declare const FUNCTIONS: Record<string, Fn>;
2
+ export interface FnCtx {
3
+ maxLength: number;
4
+ step: (n?: number) => void;
5
+ given: number;
6
+ }
7
+ type Run = (args: Value[], c: FnCtx) => Value;
8
+ export interface Builtin {
9
+ params: string[];
10
+ rest: boolean;
11
+ order?: (n: number) => string[];
12
+ run: Run;
13
+ }
14
+ export declare function givenTwice(f: Builtin, pos: Value[], named: Map<string, Value>): string[];
15
+ export declare function bindArgs(f: Builtin, pos: Value[], named: Map<string, Value>): Value[];
16
+ /**
17
+ * Steps a built-in takes to go through its arguments: one for each item of a
18
+ * list or range and each character of a string. len() of a list is a single
19
+ * step. A range is counted up to just past max, the most items it may hold.
20
+ */
21
+ export declare function argumentWork(name: string, args: Value[], max: number): number;
22
+ export declare const FUNCTIONS: Record<string, Builtin>;
4
23
  export {};