Repository: League-of-Foundry-Developers/foundry-vtt-types
Pull request #2631 (2024-07-12 23:00:55)

Canvas/edges
Added client-esm/canvas/edges files, which included some migrations from client/pixi/core/shapes


Patch:
diff --git a/package-lock.json b/package-lock.json
index 532e2b080..716866479 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,28 +14,28 @@
         "@pixi/particle-emitter": "^5.0.8",
         "@types/fvtt-types": "file:.",
         "@types/jquery": "~3.5.22",
-        "@types/showdown": "~2.0.2",
+        "@types/showdown": "~2.0.6",
         "@types/simple-peer": "~9.11.1",
         "@types/youtube": "~0.0.48",
-        "handlebars": "^4.7.7",
+        "handlebars": "^4.7.8",
         "patch-package": "^8.0.0",
-        "pixi.js": "^7.2.4",
+        "pixi.js": "^7.4.2",
         "postinstall-postinstall": "^2.1.0",
-        "prosemirror-collab": "^1.3.0",
-        "prosemirror-commands": "^1.5.1",
-        "prosemirror-dropcursor": "^1.8.0",
-        "prosemirror-gapcursor": "^1.3.1",
-        "prosemirror-history": "^1.3.0",
-        "prosemirror-inputrules": "^1.2.0",
-        "prosemirror-keymap": "^1.2.1",
-        "prosemirror-model": "^1.19.0",
-        "prosemirror-schema-list": "^1.2.2",
-        "prosemirror-state": "^1.4.2",
-        "prosemirror-tables": "^1.3.2",
-        "prosemirror-transform": "^1.7.1",
-        "prosemirror-view": "^1.30.2",
-        "socket.io-client": "^4.6.1",
-        "tinymce": "^6.7.1"
+        "prosemirror-collab": "^1.3.1",
+        "prosemirror-commands": "^1.5.2",
+        "prosemirror-dropcursor": "^1.8.1",
+        "prosemirror-gapcursor": "^1.3.2",
+        "prosemirror-history": "^1.4.0",
+        "prosemirror-inputrules": "^1.4.0",
+        "prosemirror-keymap": "^1.2.2",
+        "prosemirror-model": "^1.21.0",
+        "prosemirror-schema-list": "^1.3.0",
+        "prosemirror-state": "^1.4.3",
+        "prosemirror-tables": "^1.3.7",
+        "prosemirror-transform": "^1.9.0",
+        "prosemirror-view": "^1.33.6",
+        "socket.io-client": "^4.7.5",
+        "tinymce": "^6.8.3"
       },
       "devDependencies": {
         "@typescript-eslint/eslint-plugin": "^6.7.4",
@@ -3860,9 +3860,9 @@
       }
     },
     "node_modules/prosemirror-model": {
-      "version": "1.19.4",
-      "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.19.4.tgz",
-      "integrity": "sha512-RPmVXxUfOhyFdayHawjuZCxiROsm9L4FCUA6pWI+l7n2yCBsWy9VpdE1hpDHUS8Vad661YLY9AzqfjLhAKQ4iQ==",
+      "version": "1.21.3",
+      "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.21.3.tgz",
+      "integrity": "sha512-nt2Xs/RNGepD9hrrkzXvtCm1mpGJoQfFSPktGa0BF/aav6XsnmVGZ9sTXNWRLupAz5SCLa3EyKlFeK7zJWROKg==",
       "dependencies": {
         "orderedmap": "^2.0.0"
       }
@@ -3900,19 +3900,19 @@
       }
     },
     "node_modules/prosemirror-transform": {
-      "version": "1.8.0",
-      "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.8.0.tgz",
-      "integrity": "sha512-BaSBsIMv52F1BVVMvOmp1yzD3u65uC3HTzCBQV1WDPqJRQ2LuHKcyfn0jwqodo8sR9vVzMzZyI+Dal5W9E6a9A==",
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.9.0.tgz",
+      "integrity": "sha512-5UXkr1LIRx3jmpXXNKDhv8OyAOeLTGuXNwdVfg8x27uASna/wQkr9p6fD3eupGOi4PLJfbezxTyi/7fSJypXHg==",
       "dependencies": {
-        "prosemirror-model": "^1.0.0"
+        "prosemirror-model": "^1.21.0"
       }
     },
     "node_modules/prosemirror-view": {
-      "version": "1.33.3",
-      "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.3.tgz",
-      "integrity": "sha512-P4Ao/bc4OrU/2yLIf8dL4lJaEtjLR3QjIvQHgJYp2jUS7kYM4bSR6okbBjkqzOs/FwUon6UGjTLdKMnPL1MZqw==",
+      "version": "1.33.8",
+      "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.8.tgz",
+      "integrity": "sha512-4PhMr/ufz2cdvFgpUAnZfs+0xij3RsFysreeG9V/utpwX7AJtYCDVyuRxzWoMJIEf4C7wVihuBNMPpFLPCiLQw==",
       "dependencies": {
-        "prosemirror-model": "^1.16.0",
+        "prosemirror-model": "^1.20.0",
         "prosemirror-state": "^1.0.0",
         "prosemirror-transform": "^1.1.0"
       }
diff --git a/package.json b/package.json
index 616af00ff..78c14e2ed 100644
--- a/package.json
+++ b/package.json
@@ -59,35 +59,35 @@
     "foundry",
     "foundry-vtt",
     "types",
-    "typscript"
+    "typescript"
   ],
   "dependencies": {
     "@pixi/graphics-smooth": "^1.1.0",
     "@pixi/particle-emitter": "^5.0.8",
     "@types/fvtt-types": "file:.",
     "@types/jquery": "~3.5.22",
-    "@types/showdown": "~2.0.2",
+    "@types/showdown": "~2.0.6",
     "@types/simple-peer": "~9.11.1",
     "@types/youtube": "~0.0.48",
-    "handlebars": "^4.7.7",
+    "handlebars": "^4.7.8",
     "patch-package": "^8.0.0",
-    "pixi.js": "^7.2.4",
+    "pixi.js": "^7.4.2",
     "postinstall-postinstall": "^2.1.0",
-    "prosemirror-collab": "^1.3.0",
-    "prosemirror-commands": "^1.5.1",
-    "prosemirror-dropcursor": "^1.8.0",
-    "prosemirror-gapcursor": "^1.3.1",
-    "prosemirror-history": "^1.3.0",
-    "prosemirror-inputrules": "^1.2.0",
-    "prosemirror-keymap": "^1.2.1",
-    "prosemirror-model": "^1.19.0",
-    "prosemirror-schema-list": "^1.2.2",
-    "prosemirror-state": "^1.4.2",
-    "prosemirror-tables": "^1.3.2",
-    "prosemirror-transform": "^1.7.1",
-    "prosemirror-view": "^1.30.2",
-    "socket.io-client": "^4.6.1",
-    "tinymce": "^6.7.1"
+    "prosemirror-collab": "^1.3.1",
+    "prosemirror-commands": "^1.5.2",
+    "prosemirror-dropcursor": "^1.8.1",
+    "prosemirror-gapcursor": "^1.3.2",
+    "prosemirror-history": "^1.4.0",
+    "prosemirror-inputrules": "^1.4.0",
+    "prosemirror-keymap": "^1.2.2",
+    "prosemirror-model": "^1.21.0",
+    "prosemirror-schema-list": "^1.3.0",
+    "prosemirror-state": "^1.4.3",
+    "prosemirror-tables": "^1.3.7",
+    "prosemirror-transform": "^1.9.0",
+    "prosemirror-view": "^1.33.6",
+    "socket.io-client": "^4.7.5",
+    "tinymce": "^6.8.3"
   },
   "devDependencies": {
     "@typescript-eslint/eslint-plugin": "^6.7.4",
diff --git a/src/foundry/client-esm/canvas/edges/collision.d.mts b/src/foundry/client-esm/canvas/edges/collision.d.mts
new file mode 100644
index 000000000..0203ed597
--- /dev/null
+++ b/src/foundry/client-esm/canvas/edges/collision.d.mts
@@ -0,0 +1,93 @@
+/**
+ * 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?: EdgeSet;
+    ccwEdges?: EdgeSet;
+    isBehind?: boolean;
+    isLimited?: boolean;
+    wasLimited?: boolean;
+  });
+
+  /**
+   * The vertex that was the target of this result
+   * @defaultValue `null`
+   */
+  target: foundry.canvas.edges.PolygonVertex | null;
+
+  /**
+   * The array of collision points which apply to this result
+   * @defaultValue `[]`
+   */
+  collisions: foundry.canvas.edges.PolygonVertex[];
+
+  /**
+   * The set of edges connected to the target vertex that continue clockwise
+   * @defaultValue `new Set()`
+   */
+  cwEdges: EdgeSet;
+
+  /**
+   * The set of edges connected to the target vertex that continue counter-clockwise
+   * @defaultValue `new Set()`
+   */
+  ccwEdges: EdgeSet;
+
+  /**
+   * Is the target vertex for this result behind some closer active edge?
+   */
+  isBehind: boolean | undefined;
+
+  /**
+   * Does the target vertex for this result impose a limited collision?
+   */
+  isLimited: boolean | undefined;
+
+  /**
+   * Has the set of collisions for this result encountered a limited edge?
+   */
+  wasLimited: boolean | undefined;
+
+  /**
+   * Is this result limited in the clockwise direction?
+   * @defaultValue `false`
+   */
+  limitedCW: boolean;
+
+  /**
+   * Is this result limited in the counter-clockwise direction?
+   * @defaultValue `false`
+   */
+  limitedCCW: boolean;
+
+  /**
+   * Is this result blocking in the clockwise direction?
+   * @defaultValue `false`
+   */
+  blockedCW: boolean;
+
+  /**
+   * Is this result blocking in the counter-clockwise direction?
+   * @defaultValue `false`
+   */
+  blockedCCW: boolean;
+
+  /**
+   * Previously blocking in the clockwise direction?
+   * @defaultValue `false`
+   */
+  blockedCWPrev: boolean;
+
+  /**
+   * Previously blocking in the counter-clockwise direction?
+   * @defaultValue `false`
+   */
+  blockedCCWPrev: boolean;
+}
+
+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
new file mode 100644
index 000000000..5bbb7b800
--- /dev/null
+++ b/src/foundry/client-esm/canvas/edges/edge.d.mts
@@ -0,0 +1,182 @@
+import type { InexactPartial } from "../../../../types/utils.d.mts";
+
+/**
+ * A data structure used to represent potential edges used by the ClockwiseSweepPolygon.
+ * Edges are not polygon-specific, meaning they can be reused across many polygon instances.
+ */
+declare class Edge {
+  /**
+   * Identify intersections between a provided iterable of edges.
+   * @param edges - An iterable of edges
+   */
+  static identifyEdgeIntersections(edges: Iterable<Edge>): void;
+  /**
+   * Construct an Edge by providing the following information.
+   * @param a - The first endpoint of the edge
+   * @param b - The second endpoint of the edge
+   * @param options - Additional options which describe the edge
+   */
+  constructor(
+    a: Point,
+    b: 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;
+    }>,
+  );
+
+  /**
+   * The first endpoint of the edge.
+   */
+  a: PIXI.Point;
+
+  /**
+   * The second endpoint of the edge.
+   */
+  b: PIXI.Point;
+
+  /**
+   * A string used to uniquely identify this edge.
+   */
+  id: string;
+
+  object: PlaceableObject;
+
+  type: Edge.EdgeTypes;
+
+  /**
+   * The direction of effect for the edge.
+   */
+  direction: foundry.CONST.WALL_DIRECTIONS;
+
+  /**
+   * 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;
+
+  /**
+   * Specialized threshold data for this edge.
+   */
+  threshold: WallThresholdData;
+
+  /**
+   * The endpoint of the edge which is oriented towards the top-left.
+   */
+  nw: Point;
+
+  /**
+   * The endpoint of the edge which is oriented towards the bottom-right.
+   */
+  se: Point;
+
+  /**
+   * The rectangular bounds of the edge. Used by the quadtree.
+   */
+  bounds: PIXI.Rectangle;
+
+  /**
+   * Record other edges which this one intersects with.
+   */
+  intersections: {
+    edge: Edge;
+    intersection: foundry.utils.LineIntersection;
+  }[];
+
+  /**
+   * A PolygonVertex instance.
+   * Used as part of ClockwiseSweepPolygon computation.
+   */
+  vertexA: foundry.canvas.edges.PolygonVertex;
+
+  /**
+   * A PolygonVertex instance.
+   * Used as part of ClockwiseSweepPolygon computation.
+   */
+  vertexB: foundry.canvas.edges.PolygonVertex;
+
+  /**
+   * Is this edge limited for a particular type?
+   */
+  isLimited(type: "direction" | "light" | "move" | "sight" | "sound"): boolean;
+
+  /**
+   * Create a copy of the Edge which can be safely mutated.
+   */
+  clone(): Edge;
+
+  /**
+   * Get an intersection point between this Edge and another.
+   */
+  getIntersection(other: Edge): foundry.utils.LineIntersection | void;
+
+  /**
+   * Test whether to apply a proximity threshold to this edge.
+   * If the proximity threshold is met, this edge excluded from perception calculations.
+   * @param sourceType     - Sense type for the source
+   * @param sourceOrigin   - The origin or position of the source on the canvas
+   * @param externalRadius - The external radius of the source
+   *                         (default: `0`)
+   * @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: Point, externalRadius?: number): boolean;
+
+  /**
+   * Determine the orientation of this Edge with respect to a reference point.
+   * @param point - Some reference point, relative to which orientation is determined
+   * @returns An orientation in CONST.WALL_DIRECTIONS which indicates whether the Point is left,
+   *          right, or collinear (both) with the Edge
+   */
+  orientPoint(point: Point): foundry.CONST.WALL_DIRECTIONS;
+
+  /**
+   * Record the intersections between two edges.
+   * @param other - Another edge to test and record
+   */
+  recordIntersections(other: Edge): void;
+
+  /**
+   * Remove intersections of this edge with all other edges.
+   */
+  removeIntersections(): void;
+}
+
+declare namespace Edge {
+  type EdgeTypes = "wall" | "darkness" | "innerBounds" | "outerBounds";
+}
+
+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
new file mode 100644
index 000000000..f522b84a9
--- /dev/null
+++ b/src/foundry/client-esm/canvas/edges/edges.d.mts
@@ -0,0 +1,23 @@
+import type Edge from "./edge.d.mts";
+
+/**
+ * A special class of Map which defines all the edges used to restrict perception in a Scene.
+ */
+declare class CanvasEdges extends Map<string, Edge> {
+  /**
+   * Initialize all active edges for the Scene. This workflow occurs once only when the Canvas is first initialized.
+   * Edges are created from the following sources:
+   * 1. Wall documents
+   * 2. Canvas boundaries (inner and outer bounds)
+   * 3. Darkness sources
+   * 4. Programmatically defined in the "initializeEdges" hook
+   */
+  initialize(): void;
+
+  /**
+   * Incrementally refresh Edges by computing intersections between all registered edges.
+   */
+  refresh(): void;
+}
+
+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
new file mode 100644
index 000000000..57ff3a286
--- /dev/null
+++ b/src/foundry/client-esm/canvas/edges/vertex.d.mts
@@ -0,0 +1,134 @@
+/**
+ * A specialized point data structure used to represent vertices in the context of the ClockwiseSweepPolygon.
+ * This class is not designed or intended for use outside of that context.
+ * @internal
+ */
+declare class PolygonVertex {
+  constructor(x: number, y: number, { distance, index }?: PolygonVertex.Options);
+
+  x: number;
+
+  y: number;
+
+  key: number;
+
+  protected _distance: number | undefined;
+
+  protected _d2: undefined;
+
+  protected _index: number | undefined;
+
+  /**
+   * The set of edges which connect to this vertex.
+   * This set is initially empty and populated later after vertices are de-duplicated.
+   * @defaultValue `new Set()`
+   */
+  edges: EdgeSet;
+
+  /**
+   * The subset of edges which continue clockwise from this vertex.
+   * @defaultValue `new Set()`
+   */
+  cwEdges: EdgeSet;
+
+  /**
+   * The subset of edges which continue counter-clockwise from this vertex.
+   * @defaultValue `new Set()`
+   */
+  ccwEdges: EdgeSet;
+
+  /**
+   * The set of vertices collinear to this vertex
+   */
+  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?
+   */
+  isEndpoint: boolean | undefined;
+
+  /**
+   * Does this vertex have a single counterclockwise limiting edge?
+   */
+  isLimitingCCW: boolean | undefined;
+
+  /**
+   * Does this vertex have a single clockwise limiting edge?
+   */
+  isLimitingCW: boolean | undefined;
+
+  /**
+   * Does this vertex have non-limited edges or 2+ limited edges counterclockwise?
+   */
+  isBlockingCCW: boolean | undefined;
+
+  /**
+   * Does this vertex have non-limited edges or 2+ limited edges clockwise?
+   */
+  isBlockingCW: boolean | undefined;
+
+  /**
+   * Does this vertex result from an internal collision?
+   * @defaultValue `false`
+   */
+  isInternal: boolean;
+
+  /**
+   * The maximum restriction imposed by this vertex.
+   * @defaultValue `0`
+   * @remarks Possibly tied to `CONST.WALL_SENSE_TYPES`?
+   */
+  restriction: number;
+
+  /**
+   * Record whether this PolygonVertex has been visited in the sweep
+   * @defaultValue `false`
+   * @internal
+   */
+  _visited: boolean;
+
+  /**
+   * Is this vertex limited in type?
+   */
+  get isLimited(): boolean;
+
+  /**
+   * Associate an edge with this vertex.
+   * @param edge        - The edge being attached
+   * @param orientation - The orientation of the edge with respect to the origin
+   * @param type        - The restriction type of the polygon being created
+   */
+  attachEdge(edge: PolygonEdge, orientation: number, type: string): void;
+
+  /**
+   * Is this vertex terminal (at the maximum radius)
+   */
+  get isTerminal(): boolean;
+
+  /**declareme point?
+   */
+  equals(other: PolygonVertex): boolean;
+
+  /**
+   * Construct a PolygonVertex instance from some other Point structure.
+   * @param point   - The point
+   * @param options - Additional options that apply to this vertex
+   * @returns The constructed vertex
+   */
+  static fromPoint(point: Point, options?: PolygonVertex.Options): PolygonVertex;
+}
+
+declare namespace PolygonVertex {
+  interface Options {
+    distance: PolygonVertex["_distance"];
+    index: PolygonVertex["_index"];
+  }
+}
+
+export default PolygonVertex;
diff --git a/src/foundry/client/pixi/core/shapes/polygon-helpers.d.mts b/src/foundry/client/pixi/core/shapes/polygon-helpers.d.mts
index 018d21141..eb7939629 100644
--- a/src/foundry/client/pixi/core/shapes/polygon-helpers.d.mts
+++ b/src/foundry/client/pixi/core/shapes/polygon-helpers.d.mts
@@ -1,118 +1,6 @@
 import type { ConfiguredObjectClassForName } from "../../../../../types/helperTypes.d.mts";
 
 declare global {
-  /**
-   * An internal data structure for polygon vertices
-   * @internal
-   */
-  class PolygonVertex {
-    constructor(x: number, y: number, { distance, index }?: PolygonVertexOptions);
-
-    x: number;
-
-    y: number;
-
-    key: number;
-
-    protected _distance: number | undefined;
-
-    protected _d2: undefined;
-
-    protected _index: number | undefined;
-
-    /** @defaultValue `false` */
-    protected _inLimitedAngle: boolean;
-
-    /**
-     * The set of edges which connect to this vertex.
-     * This set is initially empty and populated later after vertices are de-duplicated.
-     * @defaultValue `new Set()`
-     */
-    edges: EdgeSet;
-
-    /**
-     * The subset of edges which continue clockwise from this vertex.
-     * @defaultValue `new Set()`
-     */
-    cwEdges: EdgeSet;
-
-    /**
-     * The subset of edges which continue counter-clockwise from this vertex.
-     * @defaultValue `new Set()`
-     */
-    ccwEdges: EdgeSet;
-
-    /**
-     * The set of vertices collinear to this vertex
-     */
-    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?
-     */
-    isEndpoint: boolean | undefined;
-
-    /**
-     * Does this vertex have a single counterclockwise limiting edge?
-     */
-    isLimitingCCW: boolean | undefined;
-
-    /**
-     * Does this vertex have a single clockwise limiting edge?
-     */
-    isLimitingCW: boolean | undefined;
-
-    /**
-     * Does this vertex have non-limited edges or 2+ limited edges counterclockwise?
-     */
-    isBlockingCCW: boolean | undefined;
-
-    /**
-     * Does this vertex have non-limited edges or 2+ limited edges clockwise?
-     */
-    isBlockingCW: boolean | undefined;
-
-    /**
-     * Associate an edge with this vertex.
-     * @param edge        - The edge being attached
-     * @param orientation - The orientation of the edge with respect to the origin
-     */
-    attachEdge(edge: PolygonEdge, orientation: number): void;
-
-    /**
-     * Is this vertex limited in type?
-     */
-    get isLimited(): boolean;
-
-    /**
-     * Is this vertex terminal (at the maximum radius)
-     */
-    get isTerminal(): boolean;
-
-    /**declareme point?
-     */
-    equals(other: PolygonVertex): boolean;
-
-    /**
-     * Construct a PolygonVertex instance from some other Point structure.
-     * @param point   - The point
-     * @param options - Additional options that apply to this vertex
-     * @returns The constructed vertex
-     */
-    static fromPoint(point: Point, options?: PolygonVertexOptions): PolygonVertex;
-  }
-
-  interface PolygonVertexOptions {
-    distance: PolygonVertex["_distance"];
-    index: PolygonVertex["_index"];
-  }
-
   /**
    * An internal data structure for polygon edges
    * @internal
@@ -140,95 +28,4 @@ declare global {
       type: foundry.CONST.WALL_RESTRICTION_TYPES,
     ): PolygonEdge;
   }
-
-  /**
-   * An object containing the result of a collision test.
-   * @internal
-   */
-  class CollisionResult {
-    constructor(values?: {
-      target?: PolygonVertex | null;
-      collisions?: PolygonVertex[];
-      cwEdges?: EdgeSet;
-      ccwEdges?: EdgeSet;
-      isBehind?: boolean;
-      isLimited?: boolean;
-      wasLimited?: boolean;
-    });
-
-    /**
-     * The vertex that was the target of this result
-     * @defaultValue `null`
-     */
-    target: PolygonVertex | null;
-
-    /**
-     * The array of collision points which apply to this result
-     * @defaultValue `[]`
-     */
-    collisions: PolygonVertex[];
-
-    /**
-     * The set of edges connected to the target vertex that continue clockwise
-     * @defaultValue `new Set()`
-     */
-    cwEdges: EdgeSet;
-
-    /**
-     * The set of edges connected to the target vertex that continue counter-clockwise
-     * @defaultValue `new Set()`
-     */
-    ccwEdges: EdgeSet;
-
-    /**
-     * Is the target vertex for this result behind some closer active edge?
-     */
-    isBehind: boolean | undefined;
-
-    /**
-     * Does the target vertex for this result impose a limited collision?
-     */
-    isLimited: boolean | undefined;
-
-    /**
-     * Has the set of collisions for this result encountered a limited edge?
-     */
-    wasLimited: boolean | undefined;
-
-    /**
-     * Is this result limited in the clockwise direction?
-     * @defaultValue `false`
-     */
-    limitedCW: boolean;
-
-    /**
-     * Is this result limited in the counter-clockwise direction?
-     * @defaultValue `false`
-     */
-    limitedCCW: boolean;
-
-    /**
-     * Is this result blocking in the clockwise direction?
-     * @defaultValue `false`
-     */
-    blockedCW: boolean;
-
-    /**
-     * Is this result blocking in the counter-clockwise direction?
-     * @defaultValue `false`
-     */
-    blockedCCW: boolean;
-
-    /**
-     * Previously blocking in the clockwise direction?
-     * @defaultValue `false`
-     */
-    blockedCWPrev: boolean;
-
-    /**
-     * Previously blocking in the counter-clockwise direction?
-     * @defaultValue `false`
-     */
-    blockedCCWPrev: boolean;
-  }
 }
diff --git a/src/foundry/client/pixi/core/shapes/source-polygon.d.mts b/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
index 175672b5c..1af97b7c0 100644
--- a/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
+++ b/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
@@ -244,8 +244,8 @@ declare global {
 
     type CollisionTypes = {
       any: boolean;
-      closest: PolygonVertex;
-      all: PolygonVertex[] | null;
+      closest: foundry.canvas.edges.PolygonVertex;
+      all: foundry.canvas.edges.PolygonVertex[] | null;
     };
 
     type TestCollision<Mode extends CollisionModes> = CollisionTypes[Mode];
diff --git a/src/foundry/client/pixi/perception/clockwise-sweep.d.mts b/src/foundry/client/pixi/perception/clockwise-sweep.d.mts
index fe31c52e9..29c2dfed7 100644
--- a/src/foundry/client/pixi/perception/clockwise-sweep.d.mts
+++ b/src/foundry/client/pixi/perception/clockwise-sweep.d.mts
@@ -1,12 +1,12 @@
 export {};
 
 declare global {
-  type VertexMap = Map<number, PolygonVertex>;
+  type VertexMap = Map<number, foundry.canvas.edges.PolygonVertex>;
 
   type EdgeSet = Set<PolygonEdge>;
 
   interface PolygonRay extends Ray {
-    result: CollisionResult;
+    result: foundry.canvas.edges.CollisionResult;
   }
 
   /**
@@ -69,7 +69,7 @@ declare global {
      * @param activeEdges - A set of currently active edges
      * @internal
      */
-    protected _updateActiveEdges(vertex: PolygonVertex, activeEdges: EdgeSet): void;
+    protected _updateActiveEdges(vertex: foundry.canvas.edges.PolygonVertex, activeEdges: EdgeSet): void;
 
     /**
      * Determine the initial set of active edges as those which intersect with the initial ray
@@ -83,7 +83,7 @@ declare global {
      * @returns The array of sorted vertices
      * @internal
      */
-    protected _sortVertices(): PolygonVertex[];
+    protected _sortVertices(): foundry.canvas.edges.PolygonVertex[];
 
     /**
      * Test whether a target vertex is behind some closer active edge.
@@ -96,7 +96,7 @@ declare global {
      * @internal
      */
     protected _isVertexBehindActiveEdges(
-      vertex: PolygonVertex,
+      vertex: foundry.canvas.edges.PolygonVertex,
       activeEdges: EdgeSet,
     ): { isBehind: boolean; wasLimited: boolean };
 
@@ -107,7 +107,11 @@ declare global {
      * @param hasCollinear  - Are there collinear vertices behind the target vertex?
      * @internal
      */
-    protected _determineSweepResult(vertex: PolygonVertex, activeEdges: EdgeSet, hasCollinear: boolean): void;
+    protected _determineSweepResult(
+      vertex: foundry.canvas.edges.PolygonVertex,
+      activeEdges: EdgeSet,
+      hasCollinear: boolean,
+    ): void;
 
     /**
      * Switch to a new active edge.
@@ -123,7 +127,7 @@ declare global {
      * @param result      - The pending collision result
      * @param activeEdges - The set of currently active edges
      */
-    _switchEdge(result: CollisionResult, activeEdges: EdgeSet): void;
+    _switchEdge(result: foundry.canvas.edges.CollisionResult, activeEdges: EdgeSet): void;
 
     /**
      * Identify the collision points between an emitted Ray and a set of active edges.
@@ -132,7 +136,7 @@ declare global {
      * @returns A sorted array of collision points
      * @internal
      */
-    protected _getInternalEdgeCollisions(ray: PolygonRay, internalEdges: EdgeSet): PolygonVertex[];
+    protected _getInternalEdgeCollisions(ray: PolygonRay, internalEdges: EdgeSet): foundry.canvas.edges.PolygonVertex[];
 
     /**
      * @deprecated since v10, will be removed in v12
@@ -141,7 +145,7 @@ declare global {
     static getRayCollisions(
       ray: PolygonRay,
       config: PointSourcePolygonConfig,
-    ): boolean | PolygonVertex | PolygonVertex[] | null;
+    ): boolean | foundry.canvas.edges.PolygonVertex | foundry.canvas.edges.PolygonVertex[] | null;
 
     /**
      * Determine the set of collisions which occurs for a Ray.
@@ -160,6 +164,6 @@ declare global {
      * Visualize the polygon, displaying its computed area, rays, and collision points
      * @internal
      */
-    protected _visualizeCollision(ray: Ray, collisions: PolygonVertex[]): void;
+    protected _visualizeCollision(ray: Ray, collisions: foundry.canvas.edges.PolygonVertex[]): void;
   }
 }
diff --git a/src/foundry/client/pixi/placeables/wall.d.mts b/src/foundry/client/pixi/placeables/wall.d.mts
index 9581c9e82..af1bd979c 100644
--- a/src/foundry/client/pixi/placeables/wall.d.mts
+++ b/src/foundry/client/pixi/placeables/wall.d.mts
@@ -84,12 +84,12 @@ declare global {
     /**
      * A convenience reference to the coordinates Array for the Wall endpoints, [x0,y0,x1,y1].
      */
-    get coords(): [x0: number, y0: number, x1: number, y1: number]; // Wall["document"]["c"];
+    get coords(): Wall["document"]["c"];
 
     /**
-     * The endpoints of the wall expressed as {@link PolygonVertex} instances.
+     * The endpoints of the wall expressed as {@link foundry.canvas.edges.PolygonVertex} instances.
      */
-    get vertices(): { a: PolygonVertex; b: PolygonVertex };
+    get vertices(): { a: foundry.canvas.edges.PolygonVertex; b: foundry.canvas.edges.PolygonVertex };
 
     /**
      * The initial endpoint of the Wall
diff --git a/src/foundry/common/utils/logging.d.mts b/src/foundry/common/utils/logging.d.mts
index 886bb3af6..006dc27f7 100644
--- a/src/foundry/common/utils/logging.d.mts
+++ b/src/foundry/common/utils/logging.d.mts
@@ -4,7 +4,7 @@ import type { COMPATIBILITY_MODES } from "../constants.d.mts";
  * Log a compatibility warning which is filtered based on the client's defined compatibility settings.
  * @param message - The original warning or error message
  * @param options - Additional options which customize logging (default: `{}`)
- * @throws An Error if the mode is ERROR
+ * @throws        - An Error if the mode is ERROR
  */
 export declare function logCompatibilityWarning(message: string, options?: LogCompatibilityWarningOptions): void;
 export interface LogCompatibilityWarningOptions {
@@ -33,4 +33,10 @@ export interface LogCompatibilityWarningOptions {
    * @defaultValue `true`
    */
   stack?: boolean;
+
+  /**
+   * Log this message only once?
+   * @defaultValue `false`
+   */
+  once?: boolean;
 }


Test patch:
diff --git a/tests/foundry/client-esm/canvas/edges/collision-result.mjs.test-d.ts b/tests/foundry/client-esm/canvas/edges/collision-result.mjs.test-d.ts
new file mode 100644
index 000000000..35877dc6f
--- /dev/null
+++ b/tests/foundry/client-esm/canvas/edges/collision-result.mjs.test-d.ts
@@ -0,0 +1,5 @@
+import { expectTypeOf } from "vitest";
+
+const myCollisionResult = new foundry.canvas.edges.CollisionResult();
+
+expectTypeOf(myCollisionResult.cwEdges).toEqualTypeOf<Set<PolygonEdge>>();
diff --git a/tests/foundry/client-esm/canvas/edges/edges.mjs.test-d.ts b/tests/foundry/client-esm/canvas/edges/edges.mjs.test-d.ts
new file mode 100644
index 000000000..4e997474a
--- /dev/null
+++ b/tests/foundry/client-esm/canvas/edges/edges.mjs.test-d.ts
@@ -0,0 +1,12 @@
+import { expectTypeOf } from "vitest";
+
+const myCanvasEdges = new foundry.canvas.edges.CanvasEdges();
+
+// Calls inside of Canvas
+expectTypeOf(myCanvasEdges.initialize()).toEqualTypeOf<void>();
+expectTypeOf(myCanvasEdges.clear()).toEqualTypeOf<void>();
+
+for (const [key, edge] of myCanvasEdges) {
+  expectTypeOf(key).toEqualTypeOf<string>();
+  expectTypeOf(edge).toEqualTypeOf<foundry.canvas.edges.Edge>();
+}
diff --git a/tests/foundry/client-esm/canvas/edges/vertex.mjs.test-d.ts b/tests/foundry/client-esm/canvas/edges/vertex.mjs.test-d.ts
new file mode 100644
index 000000000..6808127be
--- /dev/null
+++ b/tests/foundry/client-esm/canvas/edges/vertex.mjs.test-d.ts
@@ -0,0 +1,5 @@
+import { expectTypeOf } from "vitest";
+
+const myVertex = new foundry.canvas.edges.PolygonVertex(2, 2);
+
+expectTypeOf(myVertex.equals(myVertex)).toEqualTypeOf<boolean>();
diff --git a/tests/foundry/client/pixi/core/shapes/polygon-helpers.test-d.ts b/tests/foundry/client/pixi/core/shapes/polygon-helpers.test-d.ts
deleted file mode 100644
index 66b8f4c60..000000000
--- a/tests/foundry/client/pixi/core/shapes/polygon-helpers.test-d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { expectTypeOf } from "vitest";
-
-const myVertex = new PolygonVertex(2, 2);
-
-expectTypeOf(myVertex.equals(myVertex)).toEqualTypeOf<boolean>();
-
-// Test this as part of Walls
-// const myEdge = new PolygonEdge(2,2,CONST.WALL_SENSE_TYPES.LIMITED,myWall)
-
-const myCollisionResult = new CollisionResult();
-
-expectTypeOf(myCollisionResult.cwEdges).toEqualTypeOf<Set<PolygonEdge>>();
diff --git a/tests/foundry/common/utils/logging.mjs.test-d.ts b/tests/foundry/common/utils/logging.mjs.test-d.ts
index 37e6e5bb8..94c4513c7 100644
--- a/tests/foundry/common/utils/logging.mjs.test-d.ts
+++ b/tests/foundry/common/utils/logging.mjs.test-d.ts
@@ -1,3 +1,7 @@
 import { expectTypeOf } from "vitest";
 
-expectTypeOf(logCompatibilityWarning).toEqualTypeOf(foundry.utils.logCompatibilityWarning);
+expectTypeOf(foundry.utils.logCompatibilityWarning).parameter(0).toEqualTypeOf<string>();
+expectTypeOf(foundry.utils.logCompatibilityWarning)
+  .parameter(1)
+  .toEqualTypeOf<foundry.utils.LogCompatibilityWarningOptions | undefined>();
+expectTypeOf(foundry.utils.logCompatibilityWarning).returns.toEqualTypeOf<void>();