Repository: League-of-Foundry-Developers/foundry-vtt-types
Pull request #3060 (2025-02-03 01:41:29)

Types and tests for `client-esm/canvas/edges/**`
title


Patch:
diff --git a/src/foundry/client-esm/canvas/edges/collision.d.mts b/src/foundry/client-esm/canvas/edges/collision.d.mts
index 90133d264..af96b12f6 100644
--- a/src/foundry/client-esm/canvas/edges/collision.d.mts
+++ b/src/foundry/client-esm/canvas/edges/collision.d.mts
@@ -1,31 +1,24 @@
+import type { NullishProps } from "../../../../utils/index.d.mts";
 import type Edge from "./edge.d.mts";
+import type PolygonVertex from "./vertex.d.mts";
+
 /**
  * A specialized object that contains the result of a collision in the context of the ClockwiseSweepPolygon.
  * This class is not designed or intended for use outside of that context.
- * @internal
  */
 declare class CollisionResult {
-  constructor(values?: {
-    target?: foundry.canvas.edges.PolygonVertex;
-    collisions?: foundry.canvas.edges.PolygonVertex[];
-    cwEdges?: Set<Edge>;
-    ccwEdges?: Set<Edge>;
-    isBehind?: boolean;
-    isLimited?: boolean;
-    wasLimited?: boolean;
-  });
+  constructor(values?: CollisionResult.ConstructorValues);
 
   /**
    * The vertex that was the target of this result
-   * @defaultValue `null`
    */
-  target: foundry.canvas.edges.PolygonVertex | null;
+  target: PolygonVertex;
 
   /**
    * The array of collision points which apply to this result
    * @defaultValue `[]`
    */
-  collisions: foundry.canvas.edges.PolygonVertex[];
+  collisions: PolygonVertex[];
 
   /**
    * The set of edges connected to the target vertex that continue clockwise
@@ -41,18 +34,21 @@ declare class CollisionResult {
 
   /**
    * Is the target vertex for this result behind some closer active edge?
+   * @remarks Set directly from the constructor, so possibly was passed nullish
    */
-  isBehind: boolean | undefined;
+  isBehind: boolean | undefined | null;
 
   /**
    * Does the target vertex for this result impose a limited collision?
+   * @remarks Set directly from the constructor, so possibly was passed nullish
    */
-  isLimited: boolean | undefined;
+  isLimited: boolean | undefined | null;
 
   /**
    * Has the set of collisions for this result encountered a limited edge?
+   * @remarks Set directly from the constructor, so possibly was passed nullish
    */
-  wasLimited: boolean | undefined;
+  wasLimited: boolean | undefined | null;
 
   /**
    * Is this result limited in the clockwise direction?
@@ -91,4 +87,50 @@ declare class CollisionResult {
   blockedCCWPrev: boolean;
 }
 
+declare namespace CollisionResult {
+  interface Any extends AnyCollisionResult {}
+  type AnyConstructor = typeof AnyCollisionResult;
+
+  type _ConstructorValues = NullishProps<{
+    /**
+     * The set of edges connected to the target vertex that continue clockwise
+     * @defaultValue `new Set()`
+     */
+    cwEdges: Set<Edge>;
+
+    /**
+     * The set of edges connected to the target vertex that continue counter-clockwise
+     * @defaultValue `new Set()`
+     */
+    ccwEdges: Set<Edge>;
+
+    /** Is the target vertex for this result behind some closer active edge? */
+    isBehind: boolean;
+
+    /** Does the target vertex for this result impose a limited collision? */
+    isLimited: boolean;
+
+    /** Has the set of collisions for this result encountered a limited edge? */
+    wasLimited: boolean;
+  }>;
+
+  interface ConstructorValues extends _ConstructorValues {
+    /**
+     * The vertex that was the target of this result
+     */
+    target: PolygonVertex;
+
+    /**
+     * The array of collision points which apply to this result
+     * @defaultValue `[]`
+     * @remarks Can't be `null` as it only has a parameter default
+     */
+    collisions?: PolygonVertex[] | undefined;
+  }
+}
+
+declare abstract class AnyCollisionResult extends CollisionResult {
+  constructor(arg0: never, ...args: never[]);
+}
+
 export default CollisionResult;
diff --git a/src/foundry/client-esm/canvas/edges/edge.d.mts b/src/foundry/client-esm/canvas/edges/edge.d.mts
index e21a87b3b..cd9b05367 100644
--- a/src/foundry/client-esm/canvas/edges/edge.d.mts
+++ b/src/foundry/client-esm/canvas/edges/edge.d.mts
@@ -1,4 +1,6 @@
-import type { InexactPartial } from "fvtt-types/utils";
+import type PolygonVertex from "./vertex.d.mts";
+import type { LineIntersection } from "../../../common/utils/geometry.d.mts";
+import type { NullishProps } from "fvtt-types/utils";
 import type { WallThresholdData } from "../../../common/documents/_types.d.mts";
 
 /**
@@ -12,33 +14,7 @@ declare class Edge {
    * @param b - The second endpoint of the edge
    * @param options - Additional options which describe the edge
    */
-  constructor(
-    a: Canvas.Point,
-    b: Canvas.Point,
-    options?: InexactPartial<{
-      /** A string used to uniquely identify this edge */
-      id?: string;
-      /** A PlaceableObject that is responsible for this edge, if any */
-      object?: PlaceableObject;
-      /** The type of edge */
-      type?: Edge.EdgeTypes;
-      /** How this edge restricts light */
-      light?: foundry.CONST.WALL_SENSE_TYPES;
-      /** How this edge restricts movement */
-      move?: foundry.CONST.WALL_SENSE_TYPES;
-      /** How this edge restricts sight */
-      sight?: foundry.CONST.WALL_SENSE_TYPES;
-      /** How this edge restricts sound */
-      sound?: foundry.CONST.WALL_SENSE_TYPES;
-      /**
-       * A direction of effect for the edge
-       * @defaultValue `0`
-       */
-      direction?: foundry.CONST.WALL_DIRECTIONS;
-      /** Configuration of threshold data for this edge */
-      threshold?: WallThresholdData;
-    }>,
-  );
+  constructor(a: Canvas.Point, b: Canvas.Point, options?: Edge.ConstructorOptions);
 
   /**
    * The first endpoint of the edge.
@@ -52,11 +28,20 @@ declare class Edge {
 
   /**
    * A string used to uniquely identify this edge.
+   * @defaultValue `object?.id ?? undefined`
    */
-  id: string;
+  id: string | undefined;
 
-  object: PlaceableObject;
+  /**
+   * A PlaceableObject that is responsible for this edge, if any
+   * @remarks This property is never read by Foundry, so it being nullish won't break anything as of 12.331
+   */
+  object: PlaceableObject.Any | undefined | null;
 
+  /**
+   * The type of edge
+   * @defaultValue `"wall"`
+   */
   type: Edge.EdgeTypes;
 
   /**
@@ -66,28 +51,33 @@ declare class Edge {
 
   /**
    * How this edge restricts light.
+   * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
    */
   light: foundry.CONST.WALL_SENSE_TYPES;
 
   /**
    * How this edge restricts movement.
+   * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
    */
   move: foundry.CONST.WALL_SENSE_TYPES;
 
   /**
    * How this edge restricts sight.
+   * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
    */
   sight: foundry.CONST.WALL_SENSE_TYPES;
 
   /**
    * How this edge restricts sound.
+   * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
    */
   sound: foundry.CONST.WALL_SENSE_TYPES;
 
   /**
    * Specialized threshold data for this edge.
+   * @remarks Foundry only accesses this in nullish-safe ways as of 12.331
    */
-  threshold: WallThresholdData;
+  threshold: WallThresholdData | undefined | null;
 
   /**
    * The endpoint of the edge which is oriented towards the top-left.
@@ -107,37 +97,38 @@ declare class Edge {
   /**
    * Record other edges which this one intersects with.
    */
-  intersections: {
-    edge: Edge;
-    intersection: foundry.utils.LineIntersection;
-  }[];
+  intersections: Edge.IntersectionEntry[];
 
   /**
    * A PolygonVertex instance.
    * Used as part of ClockwiseSweepPolygon computation.
+   * @defaultValue `undefined`
+   * @remarks Only set in {@link ClockwiseSweepPolygon#_identifyVertices} (part of CSP initialization)
    */
-  vertexA: foundry.canvas.edges.PolygonVertex;
+  vertexA: PolygonVertex | undefined;
 
   /**
    * A PolygonVertex instance.
    * Used as part of ClockwiseSweepPolygon computation.
+   * @defaultValue `undefined`
+   * @remarks Only set in {@link ClockwiseSweepPolygon#_identifyVertices} (part of CSP initialization)
    */
-  vertexB: foundry.canvas.edges.PolygonVertex;
+  vertexB: PolygonVertex | undefined;
 
   /**
    * Is this edge limited for a particular type?
    */
-  isLimited(type: "direction" | "light" | "move" | "sight" | "sound"): boolean;
+  isLimited(type: foundry.CONST.WALL_RESTRICTION_TYPES): boolean;
 
   /**
    * Create a copy of the Edge which can be safely mutated.
    */
-  clone(): Edge;
+  clone(): this;
 
   /**
    * Get an intersection point between this Edge and another.
    */
-  getIntersection(other: Edge): foundry.utils.LineIntersection | void;
+  getIntersection(other: Edge): LineIntersection | void;
 
   /**
    * Test whether to apply a proximity threshold to this edge.
@@ -149,7 +140,7 @@ declare class Edge {
    * @returns True if the edge has a threshold greater than 0 for the source type,
    *          and the source type is within that distance.
    */
-  applyThreshold(sourceType: string, sourceOrigin: Canvas.Point, externalRadius?: number): boolean;
+  applyThreshold(sourceType: Edge.AttenuationTypes, sourceOrigin: Canvas.Point, externalRadius?: number): boolean;
 
   /**
    * Determine the orientation of this Edge with respect to a reference point.
@@ -178,7 +169,80 @@ declare class Edge {
 }
 
 declare namespace Edge {
+  interface Any extends AnyEdge {}
+  type AnyConstructor = typeof AnyEdge;
+
+  /** @internal */
+  type _ConstructorOptions = NullishProps<{
+    /**
+     * A string used to uniquely identify this edge
+     *
+     */
+    id: string | null;
+
+    /**
+     * A PlaceableObject that is responsible for this edge, if any
+     * @remarks `Edge#object` is never read by Foundry, so this being nullish won't break anything as of 12.331
+     */
+    object: PlaceableObject.Any;
+
+    /**
+     * The type of edge
+     * @defaultValue `"wall"`
+     */
+    type: Edge.EdgeTypes;
+
+    /**
+     * How this edge restricts light
+     * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
+     */
+    light: foundry.CONST.WALL_SENSE_TYPES;
+
+    /**
+     * How this edge restricts movement
+     * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
+     */
+    move: foundry.CONST.WALL_SENSE_TYPES;
+
+    /**
+     * How this edge restricts sight
+     * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
+     */
+    sight: foundry.CONST.WALL_SENSE_TYPES;
+
+    /**
+     * How this edge restricts sound
+     * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
+     */
+    sound: foundry.CONST.WALL_SENSE_TYPES;
+
+    /**
+     * A direction of effect for the edge
+     * @defaultValue `CONST.WALL_DIRECTIONS.BOTH`
+     */
+    direction: foundry.CONST.WALL_DIRECTIONS;
+
+    /**
+     * Configuration of threshold data for this edge
+     * @remarks Foundry only accesses this in nullish-safe ways as of 12.331
+     */
+    threshold: WallThresholdData;
+  }>;
+
+  interface ConstructorOptions extends _ConstructorOptions {}
+
   type EdgeTypes = "wall" | "darkness" | "innerBounds" | "outerBounds";
+
+  type AttenuationTypes = Exclude<foundry.CONST.WALL_RESTRICTION_TYPES, "move">;
+
+  interface IntersectionEntry {
+    edge: Edge;
+    intersection: LineIntersection;
+  }
+}
+
+declare abstract class AnyEdge extends Edge {
+  constructor(arg0: never, ...args: never[]);
 }
 
 export default Edge;
diff --git a/src/foundry/client-esm/canvas/edges/edges.d.mts b/src/foundry/client-esm/canvas/edges/edges.d.mts
index f522b84a9..8bd2bfece 100644
--- a/src/foundry/client-esm/canvas/edges/edges.d.mts
+++ b/src/foundry/client-esm/canvas/edges/edges.d.mts
@@ -20,4 +20,13 @@ declare class CanvasEdges extends Map<string, Edge> {
   refresh(): void;
 }
 
+declare namespace CanvasEdges {
+  interface Any extends AnyCanvasEdges {}
+  type AnyConstructor = typeof AnyCanvasEdges;
+}
+
+declare abstract class AnyCanvasEdges {
+  constructor(arg0: never, ...args: never[]);
+}
+
 export default CanvasEdges;
diff --git a/src/foundry/client-esm/canvas/edges/vertex.d.mts b/src/foundry/client-esm/canvas/edges/vertex.d.mts
index 774ec1672..c73c3ae11 100644
--- a/src/foundry/client-esm/canvas/edges/vertex.d.mts
+++ b/src/foundry/client-esm/canvas/edges/vertex.d.mts
@@ -1,3 +1,4 @@
+import type { NullishProps } from "../../../../utils/index.d.mts";
 import type Edge from "./edge.d.mts";
 
 /**
@@ -6,19 +7,40 @@ import type Edge from "./edge.d.mts";
  * @internal
  */
 declare class PolygonVertex {
-  constructor(x: number, y: number, { distance, index }?: PolygonVertex.Options);
+  constructor(x: number, y: number, options?: PolygonVertex.ConstructorOptions);
 
   x: number;
 
   y: number;
 
+  /** @defaultValue `PolygonVertex.getKey(this.x, this.y)` */
   key: number;
 
-  protected _distance: number | undefined;
+  /**
+   * @defaultValue `undefined`
+   * @remarks Accessed externally in {@link ClockwiseSweepPolygon#_testCollision}
+   */
+  _distance: number | undefined | null;
 
-  protected _d2: undefined;
+  /**
+   * @defaultValue `undefined`
+   * @remarks Set to `undefined` in the constructor, otherwise only set externally in `ClockwiseSweepPolygon` methods
+   */
+  _d2: number | undefined;
 
-  protected _index: number | undefined;
+  /**
+   * @defaultValue `undefined`
+   * @remarks Accessed externally in `ClockwiseSweepPolygon` methods
+   */
+  _index: number | undefined | null;
+
+  /**
+   * Determine the sort key to use for this vertex, arranging points from north-west to south-east.
+   * @param x - The x-coordinate
+   * @param y - The y-coordinate
+   * @returns The key used to identify the vertex
+   */
+  static getKey(x: number, y: number): number;
 
   /**
    * The set of edges which connect to this vertex.
@@ -41,15 +63,10 @@ declare class PolygonVertex {
 
   /**
    * The set of vertices collinear to this vertex
+   * @defaultValue `new Set()`
    */
   collinearVertices: Set<PolygonVertex>;
 
-  /**
-   * The maximum restriction type of this vertex
-   * @defaultValue `null`
-   */
-  type: number | null;
-
   /**
    * Is this vertex an endpoint of one or more edges?
    */
@@ -83,15 +100,16 @@ declare class PolygonVertex {
 
   /**
    * The maximum restriction imposed by this vertex.
-   * @defaultValue `0`
-   * @remarks Possibly tied to `CONST.WALL_SENSE_TYPES`?
+   * @defaultValue `CONST.WALL_SENSE_TYPES.NONE`
+   * @remarks Actually initialized to `0` literal, but is meant as a `WALL_SENSE_TYPES`
    */
-  restriction: number;
+  restriction: foundry.CONST.WALL_SENSE_TYPES;
 
   /**
    * Record whether this PolygonVertex has been visited in the sweep
    * @defaultValue `false`
-   * @internal
+   * @remarks Set externally during `ClockwiseSweeepPolygon` initialization
+   * @privateRemarks Foundry marked `@internal`
    */
   _visited: boolean;
 
@@ -106,7 +124,7 @@ declare class PolygonVertex {
    * @param orientation - The orientation of the edge with respect to the origin
    * @param type        - The restriction type of the polygon being created
    */
-  attachEdge(edge: Edge, orientation: number, type: string): void;
+  attachEdge(edge: Edge, orientation: number, type: foundry.CONST.WALL_RESTRICTION_TYPES): void;
 
   /**
    * Is this vertex terminal (at the maximum radius)
@@ -123,14 +141,24 @@ declare class PolygonVertex {
    * @param options - Additional options that apply to this vertex
    * @returns The constructed vertex
    */
-  static fromPoint(point: Canvas.Point, options?: PolygonVertex.Options): PolygonVertex;
+  static fromPoint(point: Canvas.Point, options?: PolygonVertex.ConstructorOptions): PolygonVertex;
 }
 
 declare namespace PolygonVertex {
-  interface Options {
-    distance: PolygonVertex["_distance"];
-    index: PolygonVertex["_index"];
-  }
+  interface Any extends AnyPolygonVertex {}
+  type AnyConstructor = typeof AnyPolygonVertex;
+
+  /** @internal */
+  type _ConstructorOptions = NullishProps<{
+    distance: number;
+    index: number;
+  }>;
+
+  interface ConstructorOptions extends _ConstructorOptions {}
+}
+
+declare abstract class AnyPolygonVertex {
+  constructor(arg0: never, ...args: never[]);
 }
 
 export default PolygonVertex;


Test patch:
diff --git a/tests/foundry/client-esm/canvas/edges/collision.test-d.ts b/tests/foundry/client-esm/canvas/edges/collision.test-d.ts
index ab3e03073..990bd8e50 100644
--- a/tests/foundry/client-esm/canvas/edges/collision.test-d.ts
+++ b/tests/foundry/client-esm/canvas/edges/collision.test-d.ts
@@ -1,13 +1,25 @@
 import { expectTypeOf } from "vitest";
+import type Edge from "../../../../../src/foundry/client-esm/canvas/edges/edge.d.mts";
+import type PolygonVertex from "../../../../../src/foundry/client-esm/canvas/edges/vertex.d.mts";
 
-const myCollisionResult = new foundry.canvas.edges.CollisionResult();
+type NullishBoolean = boolean | undefined | null;
+declare const somePV: PolygonVertex;
+declare const someEdge: Edge;
 
-expectTypeOf(myCollisionResult.target).toEqualTypeOf<foundry.canvas.edges.PolygonVertex | null>();
-expectTypeOf(myCollisionResult.collisions).toEqualTypeOf<foundry.canvas.edges.PolygonVertex[]>();
-expectTypeOf(myCollisionResult.cwEdges).toEqualTypeOf<Set<foundry.canvas.edges.Edge>>();
-expectTypeOf(myCollisionResult.isBehind).toEqualTypeOf<boolean | undefined>();
-expectTypeOf(myCollisionResult.isLimited).toEqualTypeOf<boolean | undefined>();
-expectTypeOf(myCollisionResult.wasLimited).toEqualTypeOf<boolean | undefined>();
+const myCollisionResult = new foundry.canvas.edges.CollisionResult({
+  target: somePV,
+  isBehind: false,
+  wasLimited: true,
+  isLimited: false,
+  cwEdges: new Set([someEdge]),
+});
+
+expectTypeOf(myCollisionResult.target).toEqualTypeOf<PolygonVertex>();
+expectTypeOf(myCollisionResult.collisions).toEqualTypeOf<PolygonVertex[]>();
+expectTypeOf(myCollisionResult.cwEdges).toEqualTypeOf<Set<Edge>>();
+expectTypeOf(myCollisionResult.isBehind).toEqualTypeOf<NullishBoolean>();
+expectTypeOf(myCollisionResult.isLimited).toEqualTypeOf<NullishBoolean>();
+expectTypeOf(myCollisionResult.wasLimited).toEqualTypeOf<NullishBoolean>();
 expectTypeOf(myCollisionResult.limitedCW).toEqualTypeOf<boolean>();
 expectTypeOf(myCollisionResult.limitedCCW).toEqualTypeOf<boolean>();
 expectTypeOf(myCollisionResult.blockedCW).toEqualTypeOf<boolean>();
diff --git a/tests/foundry/client-esm/canvas/edges/edge.test-d.ts b/tests/foundry/client-esm/canvas/edges/edge.test-d.ts
index 2ee9ada0c..247f8e843 100644
--- a/tests/foundry/client-esm/canvas/edges/edge.test-d.ts
+++ b/tests/foundry/client-esm/canvas/edges/edge.test-d.ts
@@ -1,35 +1,54 @@
 import { expectTypeOf } from "vitest";
-import type { PIXI } from "../../../../../src/configuration/globals.d.mts";
 import type { WallThresholdData } from "../../../../../src/foundry/common/documents/_types.d.mts";
+import type PolygonVertex from "../../../../../src/foundry/client-esm/canvas/edges/vertex.d.mts";
+import type Edge from "../../../../../src/foundry/client-esm/canvas/edges/edge.d.mts";
 
 declare const p: Canvas.Point;
-const edge = new foundry.canvas.edges.Edge(p, p);
+declare const someWall: Wall.ConfiguredInstance;
+
+const edge = new foundry.canvas.edges.Edge(p, p, {
+  type: "darkness",
+  sight: CONST.WALL_SENSE_TYPES.DISTANCE,
+  move: CONST.WALL_SENSE_TYPES.LIMITED,
+  sound: CONST.WALL_SENSE_TYPES.PROXIMITY,
+  light: CONST.WALL_SENSE_TYPES.NONE,
+  id: foundry.utils.randomID(),
+  object: someWall,
+  direction: CONST.WALL_DIRECTIONS.LEFT,
+  threshold: {
+    attenuation: true,
+    sound: 400,
+    light: 200,
+    sight: 2000,
+  },
+});
 
 expectTypeOf(edge.a).toEqualTypeOf<PIXI.Point>();
 expectTypeOf(edge.b).toEqualTypeOf<PIXI.Point>();
-expectTypeOf(edge.id).toEqualTypeOf<string>();
-expectTypeOf(edge.object).toEqualTypeOf<PlaceableObject>();
-expectTypeOf(edge.type).toEqualTypeOf<foundry.canvas.edges.Edge.EdgeTypes>();
+
+expectTypeOf(edge.id).toEqualTypeOf<string | undefined>();
+if (edge.object) expectTypeOf(edge.object).toEqualTypeOf<PlaceableObject.Any>();
+expectTypeOf(edge.type).toEqualTypeOf<Edge.EdgeTypes>();
 expectTypeOf(edge.direction).toEqualTypeOf<foundry.CONST.WALL_DIRECTIONS>();
 expectTypeOf(edge.light).toEqualTypeOf<foundry.CONST.WALL_SENSE_TYPES>();
 expectTypeOf(edge.move).toEqualTypeOf<foundry.CONST.WALL_SENSE_TYPES>();
 expectTypeOf(edge.sight).toEqualTypeOf<foundry.CONST.WALL_SENSE_TYPES>();
 expectTypeOf(edge.sound).toEqualTypeOf<foundry.CONST.WALL_SENSE_TYPES>();
-expectTypeOf(edge.threshold).toEqualTypeOf<WallThresholdData>();
+expectTypeOf(edge.threshold).toEqualTypeOf<WallThresholdData | undefined | null>();
 expectTypeOf(edge.nw).toEqualTypeOf<Canvas.Point>();
 expectTypeOf(edge.se).toEqualTypeOf<Canvas.Point>();
 expectTypeOf(edge.bounds).toEqualTypeOf<PIXI.Rectangle>();
-expectTypeOf(edge.intersections).toEqualTypeOf<
-  { edge: foundry.canvas.edges.Edge; intersection: foundry.utils.LineIntersection }[]
->();
-expectTypeOf(edge.vertexA).toEqualTypeOf<foundry.canvas.edges.PolygonVertex>();
-expectTypeOf(edge.vertexB).toEqualTypeOf<foundry.canvas.edges.PolygonVertex>();
-expectTypeOf(edge.isLimited("direction")).toEqualTypeOf<boolean>();
+expectTypeOf(edge.intersections).toEqualTypeOf<Edge.IntersectionEntry[]>();
+
+if (edge.vertexA) expectTypeOf(edge.vertexA).toEqualTypeOf<PolygonVertex>();
+expectTypeOf(edge.vertexB).toEqualTypeOf<PolygonVertex | undefined>();
+
+expectTypeOf(edge.isLimited("sight")).toEqualTypeOf<boolean>();
 expectTypeOf(edge.clone()).toEqualTypeOf<foundry.canvas.edges.Edge>();
 
-declare const edge2: foundry.canvas.edges.Edge;
+declare const edge2: Edge;
 expectTypeOf(edge.getIntersection(edge2)).toEqualTypeOf<foundry.utils.LineIntersection | void>();
-expectTypeOf(edge.applyThreshold("", p)).toEqualTypeOf<boolean>();
+expectTypeOf(edge.applyThreshold("sound", p)).toEqualTypeOf<boolean>();
 expectTypeOf(edge.orientPoint(p)).toEqualTypeOf<foundry.CONST.WALL_DIRECTIONS>();
 expectTypeOf(edge.recordIntersections(edge2)).toEqualTypeOf<void>();
 expectTypeOf(edge.removeIntersections()).toEqualTypeOf<void>();
diff --git a/tests/foundry/client-esm/canvas/edges/vertex.test-d.ts b/tests/foundry/client-esm/canvas/edges/vertex.test-d.ts
index 9f7f81961..e3bc85b48 100644
--- a/tests/foundry/client-esm/canvas/edges/vertex.test-d.ts
+++ b/tests/foundry/client-esm/canvas/edges/vertex.test-d.ts
@@ -9,19 +9,18 @@ expectTypeOf(vertex.edges).toEqualTypeOf<Set<foundry.canvas.edges.Edge>>();
 expectTypeOf(vertex.cwEdges).toEqualTypeOf<Set<foundry.canvas.edges.Edge>>();
 expectTypeOf(vertex.ccwEdges).toEqualTypeOf<Set<foundry.canvas.edges.Edge>>();
 expectTypeOf(vertex.collinearVertices).toEqualTypeOf<Set<foundry.canvas.edges.PolygonVertex>>();
-expectTypeOf(vertex.type).toEqualTypeOf<number | null>();
 expectTypeOf(vertex.isEndpoint).toEqualTypeOf<boolean | undefined>();
 expectTypeOf(vertex.isLimitingCCW).toEqualTypeOf<boolean | undefined>();
 expectTypeOf(vertex.isLimitingCW).toEqualTypeOf<boolean | undefined>();
 expectTypeOf(vertex.isBlockingCCW).toEqualTypeOf<boolean | undefined>();
 expectTypeOf(vertex.isBlockingCW).toEqualTypeOf<boolean | undefined>();
 expectTypeOf(vertex.isInternal).toEqualTypeOf<boolean>();
-expectTypeOf(vertex.restriction).toEqualTypeOf<number>();
+expectTypeOf(vertex.restriction).toEqualTypeOf<foundry.CONST.WALL_SENSE_TYPES>();
 expectTypeOf(vertex._visited).toEqualTypeOf<boolean>();
 expectTypeOf(vertex.isLimited).toEqualTypeOf<boolean>();
 
 declare const edge: foundry.canvas.edges.Edge;
-expectTypeOf(vertex.attachEdge(edge, 3, "")).toEqualTypeOf<void>();
+expectTypeOf(vertex.attachEdge(edge, 3, "light")).toEqualTypeOf<void>();
 expectTypeOf(vertex.equals(vertex)).toEqualTypeOf<boolean>();
 
 declare const p: Canvas.Point;