screeps-clockwork 0.7.1 → 0.8.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.
@@ -0,0 +1 @@
1
+ export function clockworkcostmatrix_get_pointer(value: any): any;
@@ -1,7 +1,10 @@
1
- import { DistanceMap, MultiroomDistanceMap } from '../wasm/screeps_clockwork';
1
+ import { DistanceMap, DirectionOrder, MultiroomDistanceMap } from '../wasm/screeps_clockwork';
2
2
  import { ClockworkMultiroomFlowField } from './multiroomFlowField';
3
3
  import { ClockworkMultiroomMonoFlowField } from './multiroomMonoFlowField';
4
4
  import { ClockworkPath } from './path';
5
+ export interface DirectionOrderOptions {
6
+ directionOrder?: DirectionOrder;
7
+ }
5
8
  /**
6
9
  * A distance map that covers multiple rooms. Typically returned by a function
7
10
  * like `bfsMultiroomDistanceMap` rather than created directly.
@@ -31,14 +34,17 @@ export declare class ClockworkMultiroomDistanceMap {
31
34
  free(): void;
32
35
  /**
33
36
  * Path to the origin from a given position.
37
+ * Pass `DirectionOrder.DiagonalFirst` to prefer diagonal steps when multiple neighbors are equally close.
34
38
  */
35
- pathToOrigin(start: RoomPosition): ClockworkPath;
39
+ pathToOrigin(start: RoomPosition, options?: DirectionOrderOptions): ClockworkPath;
36
40
  /**
37
41
  * Flow field for this distance map.
42
+ * Pass `DirectionOrder.DiagonalFirst` to prefer diagonal directions when multiple neighbors are equally close.
38
43
  */
39
- toFlowField(): ClockworkMultiroomFlowField;
44
+ toFlowField(options?: DirectionOrderOptions): ClockworkMultiroomFlowField;
40
45
  /**
41
46
  * Mono-directional flow field for this distance map.
47
+ * Pass `DirectionOrder.DiagonalFirst` to prefer diagonal directions when multiple neighbors are equally close.
42
48
  */
43
- toMonoFlowField(): ClockworkMultiroomMonoFlowField;
49
+ toMonoFlowField(options?: DirectionOrderOptions): ClockworkMultiroomMonoFlowField;
44
50
  }
@@ -1,7 +1,7 @@
1
1
  import { Path } from '../wasm/screeps_clockwork';
2
2
  /**
3
3
  * A path from a start position to an end position. Typically returned by a
4
- * function like `pathToFlowFieldOrigin` rather than created directly.
4
+ * function like `ClockworkMultiroomFlowField.pathToOrigin` rather than created directly.
5
5
  */
6
6
  export declare class ClockworkPath {
7
7
  private readonly path;
@@ -12,7 +12,7 @@ export declare class ClockworkPath {
12
12
  * @example
13
13
  * ```typescript
14
14
  * for (const pos of path) {
15
- * console.log(pos);
15
+ * console.logUnsafe(pos);
16
16
  * }
17
17
  * ```
18
18
  */
@@ -28,7 +28,7 @@ export declare class ClockworkPath {
28
28
  * @example
29
29
  * ```typescript
30
30
  * for (const pos of path.reversed()) {
31
- * console.log(pos);
31
+ * console.logUnsafe(pos);
32
32
  * }
33
33
  * ```
34
34
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screeps-clockwork",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "A WASM movement library for Screeps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "build:docs": "typedoc",
12
12
  "build:pserver": "run-s build:lib build:src && rollup -c --environment DEST:pserver",
13
13
  "watch": "run-s build watch:both",
14
- "watch:lib": "cargo-watch -w lib -s \"npm run build:lib\"",
14
+ "watch:lib": "bacon --headless -j build-lib",
15
15
  "watch:src": "wait-on src/wasm/screeps_clockwork_bg.wasm && rollup -cw",
16
16
  "watch:pserver": "rollup -cw --environment DEST:pserver",
17
17
  "watch:both": "run-p watch:lib watch:pserver"
@@ -33,15 +33,15 @@
33
33
  },
34
34
  "homepage": "https://github.com/glitchassassin/screeps-clockwork#readme",
35
35
  "devDependencies": {
36
- "@rollup/plugin-commonjs": "^28.0.1",
36
+ "@rollup/plugin-commonjs": "^29.0.2",
37
37
  "@rollup/plugin-node-resolve": "^16.0.0",
38
38
  "@rollup/plugin-typescript": "^12.1.1",
39
39
  "@rollup/plugin-wasm": "^6.2.2",
40
- "@types/node": "^22.10.1",
40
+ "@types/node": "^24.12.4",
41
41
  "@types/screeps": "^3.3.0",
42
42
  "@typescript-eslint/eslint-plugin": "^8.17.0",
43
43
  "@typescript-eslint/parser": "^8.17.0",
44
- "eslint": "^9.16.0",
44
+ "eslint": "^10.3.0",
45
45
  "npm-run-all": "^4.1.5",
46
46
  "prettier": "^3.4.2",
47
47
  "rollup": "2.79.2",
@@ -50,8 +50,8 @@
50
50
  "rollup-plugin-screeps": "^1.0.1",
51
51
  "source-map": "0.6.1",
52
52
  "tslib": "^2.8.1",
53
- "typedoc": "^0.27.3",
54
- "typescript": "^5.7.2"
53
+ "typedoc": "^0.28.5",
54
+ "typescript": "^6.0.3"
55
55
  },
56
56
  "dependencies": {
57
57
  "fastestsmallesttextencoderdecoder-encodeinto": "^1.0.22"