Repository: League-of-Foundry-Developers/foundry-vtt-types
Pull request #2599 (2024-07-07 22:13:59)

Fix game.packs type, update game.data.packs properties


Patch:
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 025300645..080b60919 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -2,18 +2,72 @@ module.exports = {
   env: {
     es6: true,
   },
-  extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
+  extends: [
+    "eslint:recommended",
+    "plugin:@typescript-eslint/recommended",
+    "plugin:@typescript-eslint/stylistic",
+    "plugin:prettier/recommended",
+    "plugin:import/recommended",
+    "plugin:import/typescript",
+  ],
   parser: "@typescript-eslint/parser",
   parserOptions: {
     project: "./tsconfig.eslint.json",
     sourceType: "module",
   },
-  plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"],
+  plugins: ["@typescript-eslint", "eslint-plugin-tsdoc", "import"],
   rules: {
+    // When array types get complex enough `Array<...>` is nicer looking than `(...)[]`.
+    "@typescript-eslint/array-type": "off",
     "@typescript-eslint/ban-types": "off",
+    // `allowSingleExtends` allows the pattern of `interface X extends _X {}`.
+    // This is done as a performance optimization or simply to display a different name in intellisense.
+    "@typescript-eslint/no-empty-interface": ["error", { allowSingleExtends: true }],
     "@typescript-eslint/no-explicit-any": "off",
     "@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
     "@typescript-eslint/no-unsafe-declaration-merging": "off", // TODO: reenable in V10
+    "@typescript-eslint/no-unused-expressions": "off", // expectTypeOf seems to trip this rule.
+    "@typescript-eslint/prefer-namespace-keyword": "error",
+    "import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
+    "import/extensions": ["error", "always"],
+    "import/first": "warn",
+    "import/newline-after-import": "warn",
+    "import/no-absolute-path": "error",
+    "import/no-amd": "error",
+    "import/no-anonymous-default-export": "warn",
+    "import/no-commonjs": "error",
+    "import/no-empty-named-blocks": "warn",
+    "import/no-extraneous-dependencies": "error",
+    "import/no-import-module-exports": "error",
+    "import/no-named-default": "warn",
+    "import/no-self-import": "error",
+    "import/no-unused-modules": "warn",
+    "import/no-useless-path-segments": "warn",
+    "import/no-webpack-loader-syntax": "error",
     "tsdoc/syntax": "warn",
   },
+  settings: {
+    "import/parsers": {
+      "@typescript-eslint/parser": [".mts", ".ts"],
+    },
+    "import/resolver": {
+      typescript: {
+        alwaysTryTypes: true,
+      },
+    },
+  },
+  overrides: [
+    {
+      files: ["tests/**"],
+      rules: {
+        // Using interfaces is normally helpful so that users can declaration merge fvtt-types if necessary.
+        // However in tests it doesn't matter.
+        "@typescript-eslint/consistent-type-definitions": "off",
+
+        // There aren't even function bodies in the majority of the codebase.
+        // It can make sense to have empty functions in tests.
+        "@typescript-eslint/no-empty-function": "off",
+      },
+    },
+  ],
 };
diff --git a/README.md b/README.md
index de8621026..c7a50f7ce 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ Add foundry-vtt-types to your types section in your `tsconfig.json`:
   "compilerOptions": {
     "types": ["@league-of-foundry-developers/foundry-vtt-types"],
     "module": "ES2022",
-    "moduleResolution": "Bundler",
+    "moduleResolution": "node16",
     "esModuleInterop": true,
     "strictNullChecks": true
   }
@@ -80,8 +80,8 @@ Add foundry-vtt-types to your types section in your `tsconfig.json`:
 
 This will make the type definitions available globally in your project.
 
-Make sure you are using `"module": "ES2022"` and `"moduleResolution": "Bundler"`, too. It is required for some
-dependencies to be resolved correctly.
+Make sure you are using at least `"module": "ES2022"` and `"moduleResolution": "node16"`, too. It is required for some
+imports to be resolved correctly, such as `@league-of-foundry-developers/foundry-vtt-types/src/types/utils.mts`.
 
 Also make sure to set `"strictNullChecks": true` because otherwise, some conditional types used in the type definitions
 resolve incorrectly, and you will see a lot of errors. Alternatively, you can just set `"strict": true`, which
diff --git a/package-lock.json b/package-lock.json
index ffe515bec..3acc60bcc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,6 +41,8 @@
         "@typescript-eslint/parser": "^6.7.4",
         "eslint": "^8.4.0",
         "eslint-config-prettier": "^9.0.0",
+        "eslint-import-resolver-typescript": "^3.6.1",
+        "eslint-plugin-import": "^2.29.1",
         "eslint-plugin-prettier": "^5.0.0",
         "eslint-plugin-tsdoc": "^0.2.14",
         "husky": "^8.0.0",
@@ -1220,6 +1222,13 @@
       "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
       "dev": true
     },
+    "node_modules/@types/json5": {
+      "version": "0.0.29",
+      "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
+      "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
+      "dev": true,
+      "license": "MIT"
+    },
     "node_modules/@types/node": {
       "version": "20.11.30",
       "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
@@ -1641,6 +1650,44 @@
       "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
       "dev": true
     },
+    "node_modules/array-buffer-byte-length": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz",
+      "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.5",
+        "is-array-buffer": "^3.0.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/array-includes": {
+      "version": "3.1.8",
+      "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz",
+      "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.23.2",
+        "es-object-atoms": "^1.0.0",
+        "get-intrinsic": "^1.2.4",
+        "is-string": "^1.0.7"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/array-union": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
@@ -1650,6 +1697,88 @@
         "node": ">=8"
       }
     },
+    "node_modules/array.prototype.findlastindex": {
+      "version": "1.2.5",
+      "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz",
+      "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.23.2",
+        "es-errors": "^1.3.0",
+        "es-object-atoms": "^1.0.0",
+        "es-shim-unscopables": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/array.prototype.flat": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz",
+      "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "es-abstract": "^1.22.1",
+        "es-shim-unscopables": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/array.prototype.flatmap": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz",
+      "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "es-abstract": "^1.22.1",
+        "es-shim-unscopables": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/arraybuffer.prototype.slice": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz",
+      "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "array-buffer-byte-length": "^1.0.1",
+        "call-bind": "^1.0.5",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.22.3",
+        "es-errors": "^1.2.1",
+        "get-intrinsic": "^1.2.3",
+        "is-array-buffer": "^3.0.4",
+        "is-shared-array-buffer": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/assertion-error": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
@@ -1667,6 +1796,22 @@
         "node": ">= 4.0.0"
       }
     },
+    "node_modules/available-typed-arrays": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
+      "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "possible-typed-array-names": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/balanced-match": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -1867,6 +2012,60 @@
         "node": ">= 8"
       }
     },
+    "node_modules/data-view-buffer": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
+      "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.6",
+        "es-errors": "^1.3.0",
+        "is-data-view": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/data-view-byte-length": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz",
+      "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "es-errors": "^1.3.0",
+        "is-data-view": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/data-view-byte-offset": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz",
+      "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.6",
+        "es-errors": "^1.3.0",
+        "is-data-view": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/debug": {
       "version": "4.3.4",
       "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -1917,6 +2116,24 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/define-properties": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
+      "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "define-data-property": "^1.0.1",
+        "has-property-descriptors": "^1.0.0",
+        "object-keys": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/diff-sequences": {
       "version": "29.6.3",
       "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz",
@@ -1981,6 +2198,81 @@
         "node": ">=10.0.0"
       }
     },
+    "node_modules/enhanced-resolve": {
+      "version": "5.17.0",
+      "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
+      "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "graceful-fs": "^4.2.4",
+        "tapable": "^2.2.0"
+      },
+      "engines": {
+        "node": ">=10.13.0"
+      }
+    },
+    "node_modules/es-abstract": {
+      "version": "1.23.3",
+      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz",
+      "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "array-buffer-byte-length": "^1.0.1",
+        "arraybuffer.prototype.slice": "^1.0.3",
+        "available-typed-arrays": "^1.0.7",
+        "call-bind": "^1.0.7",
+        "data-view-buffer": "^1.0.1",
+        "data-view-byte-length": "^1.0.1",
+        "data-view-byte-offset": "^1.0.0",
+        "es-define-property": "^1.0.0",
+        "es-errors": "^1.3.0",
+        "es-object-atoms": "^1.0.0",
+        "es-set-tostringtag": "^2.0.3",
+        "es-to-primitive": "^1.2.1",
+        "function.prototype.name": "^1.1.6",
+        "get-intrinsic": "^1.2.4",
+        "get-symbol-description": "^1.0.2",
+        "globalthis": "^1.0.3",
+        "gopd": "^1.0.1",
+        "has-property-descriptors": "^1.0.2",
+        "has-proto": "^1.0.3",
+        "has-symbols": "^1.0.3",
+        "hasown": "^2.0.2",
+        "internal-slot": "^1.0.7",
+        "is-array-buffer": "^3.0.4",
+        "is-callable": "^1.2.7",
+        "is-data-view": "^1.0.1",
+        "is-negative-zero": "^2.0.3",
+        "is-regex": "^1.1.4",
+        "is-shared-array-buffer": "^1.0.3",
+        "is-string": "^1.0.7",
+        "is-typed-array": "^1.1.13",
+        "is-weakref": "^1.0.2",
+        "object-inspect": "^1.13.1",
+        "object-keys": "^1.1.1",
+        "object.assign": "^4.1.5",
+        "regexp.prototype.flags": "^1.5.2",
+        "safe-array-concat": "^1.1.2",
+        "safe-regex-test": "^1.0.3",
+        "string.prototype.trim": "^1.2.9",
+        "string.prototype.trimend": "^1.0.8",
+        "string.prototype.trimstart": "^1.0.8",
+        "typed-array-buffer": "^1.0.2",
+        "typed-array-byte-length": "^1.0.1",
+        "typed-array-byte-offset": "^1.0.2",
+        "typed-array-length": "^1.0.6",
+        "unbox-primitive": "^1.0.2",
+        "which-typed-array": "^1.1.15"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/es-define-property": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
@@ -2000,6 +2292,62 @@
         "node": ">= 0.4"
       }
     },
+    "node_modules/es-object-atoms": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz",
+      "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/es-set-tostringtag": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz",
+      "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "get-intrinsic": "^1.2.4",
+        "has-tostringtag": "^1.0.2",
+        "hasown": "^2.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/es-shim-unscopables": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz",
+      "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "hasown": "^2.0.0"
+      }
+    },
+    "node_modules/es-to-primitive": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
+      "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-callable": "^1.1.4",
+        "is-date-object": "^1.0.1",
+        "is-symbol": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/esbuild": {
       "version": "0.20.2",
       "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
@@ -2117,40 +2465,223 @@
         "eslint": ">=7.0.0"
       }
     },
-    "node_modules/eslint-plugin-prettier": {
-      "version": "5.1.3",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz",
-      "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==",
+    "node_modules/eslint-import-resolver-node": {
+      "version": "0.3.9",
+      "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
+      "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "prettier-linter-helpers": "^1.0.0",
-        "synckit": "^0.8.6"
+        "debug": "^3.2.7",
+        "is-core-module": "^2.13.0",
+        "resolve": "^1.22.4"
+      }
+    },
+    "node_modules/eslint-import-resolver-node/node_modules/debug": {
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+      "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ms": "^2.1.1"
+      }
+    },
+    "node_modules/eslint-import-resolver-node/node_modules/resolve": {
+      "version": "1.22.8",
+      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
+      "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-core-module": "^2.13.0",
+        "path-parse": "^1.0.7",
+        "supports-preserve-symlinks-flag": "^1.0.0"
+      },
+      "bin": {
+        "resolve": "bin/resolve"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/eslint-import-resolver-typescript": {
+      "version": "3.6.1",
+      "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz",
+      "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "debug": "^4.3.4",
+        "enhanced-resolve": "^5.12.0",
+        "eslint-module-utils": "^2.7.4",
+        "fast-glob": "^3.3.1",
+        "get-tsconfig": "^4.5.0",
+        "is-core-module": "^2.11.0",
+        "is-glob": "^4.0.3"
       },
       "engines": {
         "node": "^14.18.0 || >=16.0.0"
       },
       "funding": {
-        "url": "https://opencollective.com/eslint-plugin-prettier"
+        "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts"
       },
       "peerDependencies": {
-        "@types/eslint": ">=8.0.0",
-        "eslint": ">=8.0.0",
-        "eslint-config-prettier": "*",
-        "prettier": ">=3.0.0"
+        "eslint": "*",
+        "eslint-plugin-import": "*"
+      }
+    },
+    "node_modules/eslint-module-utils": {
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz",
+      "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "debug": "^3.2.7"
+      },
+      "engines": {
+        "node": ">=4"
       },
       "peerDependenciesMeta": {
-        "@types/eslint": {
-          "optional": true
-        },
-        "eslint-config-prettier": {
+        "eslint": {
           "optional": true
         }
       }
     },
-    "node_modules/eslint-plugin-tsdoc": {
-      "version": "0.2.17",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz",
-      "integrity": "sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==",
+    "node_modules/eslint-module-utils/node_modules/debug": {
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+      "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ms": "^2.1.1"
+      }
+    },
+    "node_modules/eslint-plugin-import": {
+      "version": "2.29.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz",
+      "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "array-includes": "^3.1.7",
+        "array.prototype.findlastindex": "^1.2.3",
+        "array.prototype.flat": "^1.3.2",
+        "array.prototype.flatmap": "^1.3.2",
+        "debug": "^3.2.7",
+        "doctrine": "^2.1.0",
+        "eslint-import-resolver-node": "^0.3.9",
+        "eslint-module-utils": "^2.8.0",
+        "hasown": "^2.0.0",
+        "is-core-module": "^2.13.1",
+        "is-glob": "^4.0.3",
+        "minimatch": "^3.1.2",
+        "object.fromentries": "^2.0.7",
+        "object.groupby": "^1.0.1",
+        "object.values": "^1.1.7",
+        "semver": "^6.3.1",
+        "tsconfig-paths": "^3.15.0"
+      },
+      "engines": {
+        "node": ">=4"
+      },
+      "peerDependencies": {
+        "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8"
+      }
+    },
+    "node_modules/eslint-plugin-import/node_modules/brace-expansion": {
+      "version": "1.1.11",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "balanced-match": "^1.0.0",
+        "concat-map": "0.0.1"
+      }
+    },
+    "node_modules/eslint-plugin-import/node_modules/debug": {
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+      "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ms": "^2.1.1"
+      }
+    },
+    "node_modules/eslint-plugin-import/node_modules/doctrine": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+      "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "esutils": "^2.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/eslint-plugin-import/node_modules/minimatch": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "brace-expansion": "^1.1.7"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/eslint-plugin-import/node_modules/semver": {
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+      "dev": true,
+      "license": "ISC",
+      "bin": {
+        "semver": "bin/semver.js"
+      }
+    },
+    "node_modules/eslint-plugin-prettier": {
+      "version": "5.1.3",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz",
+      "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==",
+      "dev": true,
+      "dependencies": {
+        "prettier-linter-helpers": "^1.0.0",
+        "synckit": "^0.8.6"
+      },
+      "engines": {
+        "node": "^14.18.0 || >=16.0.0"
+      },
+      "funding": {
+        "url": "https://opencollective.com/eslint-plugin-prettier"
+      },
+      "peerDependencies": {
+        "@types/eslint": ">=8.0.0",
+        "eslint": ">=8.0.0",
+        "eslint-config-prettier": "*",
+        "prettier": ">=3.0.0"
+      },
+      "peerDependenciesMeta": {
+        "@types/eslint": {
+          "optional": true
+        },
+        "eslint-config-prettier": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/eslint-plugin-tsdoc": {
+      "version": "0.2.17",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz",
+      "integrity": "sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==",
       "dev": true,
       "dependencies": {
         "@microsoft/tsdoc": "0.14.2",
@@ -2431,6 +2962,16 @@
       "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
       "dev": true
     },
+    "node_modules/for-each": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
+      "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-callable": "^1.1.3"
+      }
+    },
     "node_modules/fs-extra": {
       "version": "9.1.0",
       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
@@ -2472,6 +3013,35 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/function.prototype.name": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz",
+      "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "es-abstract": "^1.22.1",
+        "functions-have-names": "^1.2.3"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/functions-have-names": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+      "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/get-east-asian-width": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz",
@@ -2523,6 +3093,37 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/get-symbol-description": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz",
+      "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.5",
+        "es-errors": "^1.3.0",
+        "get-intrinsic": "^1.2.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-tsconfig": {
+      "version": "4.7.5",
+      "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz",
+      "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "resolve-pkg-maps": "^1.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
+      }
+    },
     "node_modules/glob": {
       "version": "7.2.3",
       "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -2589,6 +3190,23 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/globalthis": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
+      "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "define-properties": "^1.2.1",
+        "gopd": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/globby": {
       "version": "11.1.0",
       "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
@@ -2651,6 +3269,16 @@
         "uglify-js": "^3.1.4"
       }
     },
+    "node_modules/has-bigints": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
+      "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/has-flag": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -2692,6 +3320,22 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/has-tostringtag": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+      "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-symbols": "^1.0.3"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/hasown": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
@@ -2775,6 +3419,81 @@
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
       "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
     },
+    "node_modules/internal-slot": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz",
+      "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "hasown": "^2.0.0",
+        "side-channel": "^1.0.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/is-array-buffer": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz",
+      "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.2.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-bigint": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+      "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-bigints": "^1.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-boolean-object": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+      "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-callable": {
+      "version": "1.2.7",
+      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
+      "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-ci": {
       "version": "3.0.1",
       "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz",
@@ -2799,6 +3518,38 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/is-data-view": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz",
+      "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-typed-array": "^1.1.13"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-date-object": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+      "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-docker": {
       "version": "2.2.1",
       "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
@@ -2846,6 +3597,19 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/is-negative-zero": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
+      "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-number": {
       "version": "7.0.0",
       "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -2854,6 +3618,22 @@
         "node": ">=0.12.0"
       }
     },
+    "node_modules/is-number-object": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz",
+      "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-path-inside": {
       "version": "3.0.3",
       "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
@@ -2863,6 +3643,39 @@
         "node": ">=8"
       }
     },
+    "node_modules/is-regex": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+      "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-shared-array-buffer": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz",
+      "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-stream": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
@@ -2875,6 +3688,67 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/is-string": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+      "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-symbol": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
+      "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-symbols": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-typed-array": {
+      "version": "1.1.13",
+      "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz",
+      "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "which-typed-array": "^1.1.14"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-weakref": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
+      "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/is-wsl": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
@@ -2960,6 +3834,19 @@
       "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
       "dev": true
     },
+    "node_modules/json5": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
+      "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "minimist": "^1.2.0"
+      },
+      "bin": {
+        "json5": "lib/cli.js"
+      }
+    },
     "node_modules/jsonc-parser": {
       "version": "3.2.1",
       "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz",
@@ -3361,38 +4248,109 @@
         "path-key": "^4.0.0"
       },
       "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/npm-run-path/node_modules/path-key": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+      "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/object-inspect": {
+      "version": "1.13.1",
+      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
+      "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==",
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/object-keys": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/object.assign": {
+      "version": "4.1.5",
+      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
+      "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.5",
+        "define-properties": "^1.2.1",
+        "has-symbols": "^1.0.3",
+        "object-keys": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/npm-run-path/node_modules/path-key": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
-      "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+    "node_modules/object.fromentries": {
+      "version": "2.0.8",
+      "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz",
+      "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==",
       "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.23.2",
+        "es-object-atoms": "^1.0.0"
+      },
       "engines": {
-        "node": ">=12"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/object-inspect": {
-      "version": "1.13.1",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
-      "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==",
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+    "node_modules/object.groupby": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz",
+      "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.23.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
       }
     },
-    "node_modules/object-keys": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
-      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+    "node_modules/object.values": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz",
+      "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-object-atoms": "^1.0.0"
+      },
       "engines": {
         "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
     "node_modules/once": {
@@ -3690,6 +4648,16 @@
         "pathe": "^1.1.0"
       }
     },
+    "node_modules/possible-typed-array-names": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
+      "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
     "node_modules/postcss": {
       "version": "8.4.38",
       "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
@@ -3961,6 +4929,25 @@
       "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==",
       "dev": true
     },
+    "node_modules/regexp.prototype.flags": {
+      "version": "1.5.2",
+      "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz",
+      "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.6",
+        "define-properties": "^1.2.1",
+        "es-errors": "^1.3.0",
+        "set-function-name": "^2.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/resolve": {
       "version": "1.19.0",
       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
@@ -3983,6 +4970,16 @@
         "node": ">=4"
       }
     },
+    "node_modules/resolve-pkg-maps": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
+      "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
+      }
+    },
     "node_modules/restore-cursor": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz",
@@ -4120,6 +5117,43 @@
         "queue-microtask": "^1.2.2"
       }
     },
+    "node_modules/safe-array-concat": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz",
+      "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "get-intrinsic": "^1.2.4",
+        "has-symbols": "^1.0.3",
+        "isarray": "^2.0.5"
+      },
+      "engines": {
+        "node": ">=0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/safe-regex-test": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz",
+      "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.6",
+        "es-errors": "^1.3.0",
+        "is-regex": "^1.1.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/semver": {
       "version": "7.6.0",
       "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
@@ -4150,6 +5184,22 @@
         "node": ">= 0.4"
       }
     },
+    "node_modules/set-function-name": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
+      "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "define-data-property": "^1.1.4",
+        "es-errors": "^1.3.0",
+        "functions-have-names": "^1.2.3",
+        "has-property-descriptors": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
     "node_modules/shebang-command": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -4349,6 +5399,58 @@
         "url": "https://github.com/chalk/strip-ansi?sponsor=1"
       }
     },
+    "node_modules/string.prototype.trim": {
+      "version": "1.2.9",
+      "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz",
+      "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-abstract": "^1.23.0",
+        "es-object-atoms": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/string.prototype.trimend": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz",
+      "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-object-atoms": "^1.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/string.prototype.trimstart": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz",
+      "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-object-atoms": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/strip-ansi": {
       "version": "6.0.1",
       "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -4361,6 +5463,16 @@
         "node": ">=8"
       }
     },
+    "node_modules/strip-bom": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+      "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
     "node_modules/strip-final-newline": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
@@ -4408,6 +5520,19 @@
         "node": ">=8"
       }
     },
+    "node_modules/supports-preserve-symlinks-flag": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+      "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/synckit": {
       "version": "0.8.8",
       "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz",
@@ -4424,6 +5549,16 @@
         "url": "https://opencollective.com/unts"
       }
     },
+    "node_modules/tapable": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+      "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/text-table": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -4493,6 +5628,19 @@
         "typescript": ">=4.2.0"
       }
     },
+    "node_modules/tsconfig-paths": {
+      "version": "3.15.0",
+      "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
+      "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@types/json5": "^0.0.29",
+        "json5": "^1.0.2",
+        "minimist": "^1.2.6",
+        "strip-bom": "^3.0.0"
+      }
+    },
     "node_modules/tslib": {
       "version": "2.6.2",
       "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
@@ -4532,6 +5680,83 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/typed-array-buffer": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz",
+      "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "es-errors": "^1.3.0",
+        "is-typed-array": "^1.1.13"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/typed-array-byte-length": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz",
+      "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "for-each": "^0.3.3",
+        "gopd": "^1.0.1",
+        "has-proto": "^1.0.3",
+        "is-typed-array": "^1.1.13"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/typed-array-byte-offset": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz",
+      "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "available-typed-arrays": "^1.0.7",
+        "call-bind": "^1.0.7",
+        "for-each": "^0.3.3",
+        "gopd": "^1.0.1",
+        "has-proto": "^1.0.3",
+        "is-typed-array": "^1.1.13"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/typed-array-length": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz",
+      "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "for-each": "^0.3.3",
+        "gopd": "^1.0.1",
+        "has-proto": "^1.0.3",
+        "is-typed-array": "^1.1.13",
+        "possible-typed-array-names": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/typescript": {
       "version": "5.4.5",
       "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
@@ -4563,6 +5788,22 @@
         "node": ">=0.8.0"
       }
     },
+    "node_modules/unbox-primitive": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
+      "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-bigints": "^1.0.2",
+        "has-symbols": "^1.0.3",
+        "which-boxed-primitive": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/undici-types": {
       "version": "5.26.5",
       "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
@@ -4760,6 +6001,43 @@
         "node": ">= 8"
       }
     },
+    "node_modules/which-boxed-primitive": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
+      "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-bigint": "^1.0.1",
+        "is-boolean-object": "^1.1.0",
+        "is-number-object": "^1.0.4",
+        "is-string": "^1.0.5",
+        "is-symbol": "^1.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/which-typed-array": {
+      "version": "1.1.15",
+      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz",
+      "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "available-typed-arrays": "^1.0.7",
+        "call-bind": "^1.0.7",
+        "for-each": "^0.3.3",
+        "gopd": "^1.0.1",
+        "has-tostringtag": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
     "node_modules/why-is-node-running": {
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
diff --git a/package.json b/package.json
index 11f34c604..76ec6a297 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
     "test": "vitest --typecheck",
     "typecheck": "./node_modules/typescript/bin/tsc",
     "prepare": "is-ci || husky install",
-    "postinstall": "patch-package"
+    "postinstall": "patch-package && node ./setupSymlink.js"
   },
   "repository": {
     "type": "git",
@@ -93,6 +93,8 @@
     "@typescript-eslint/parser": "^6.7.4",
     "eslint": "^8.4.0",
     "eslint-config-prettier": "^9.0.0",
+    "eslint-import-resolver-typescript": "^3.6.1",
+    "eslint-plugin-import": "^2.29.1",
     "eslint-plugin-prettier": "^5.0.0",
     "eslint-plugin-tsdoc": "^0.2.14",
     "husky": "^8.0.0",
diff --git a/setupSymlink.js b/setupSymlink.js
new file mode 100644
index 000000000..81f47bb6c
--- /dev/null
+++ b/setupSymlink.js
@@ -0,0 +1,17 @@
+// @ts-check
+
+import fs from "fs/promises";
+
+// Will not throw an error if the folder already exists because `recursive: true`.
+await fs.mkdir("tests/node_modules/@types/fvtt-types", { recursive: true });
+
+try {
+  await fs.symlink("tests/node_modules/@types/fvtt-types", "../../../", "dir");
+} catch (e) {
+  if (e.code === "EEXIST") {
+    // @types/node aren't installed and so `console` is not defined.
+    // Installing such a large package just for lightweight install script seems silly though.
+    // eslint-disable-next-line no-undef
+    console.error(e);
+  }
+}
diff --git a/src/foundry/client/apps/forms/default-sheets-config.d.mts b/src/foundry/client/apps/forms/default-sheets-config.d.mts
index fc77b2fdc..b29950113 100644
--- a/src/foundry/client/apps/forms/default-sheets-config.d.mts
+++ b/src/foundry/client/apps/forms/default-sheets-config.d.mts
@@ -27,12 +27,12 @@ declare global {
   namespace DefaultSheetsConfig {
     interface Options extends PackageConfiguration.Options {}
 
-    type CategorySubType = {
+    interface CategorySubType {
       type: string;
       name: string;
       defaultClasses: Record<string, string>;
       defaultClass: string;
-    };
+    }
 
     interface Category extends PackageConfiguration.Category {
       count: number;
diff --git a/src/foundry/client/apps/forms/grid-config.d.mts b/src/foundry/client/apps/forms/grid-config.d.mts
index 2e0c84384..a5699a86e 100644
--- a/src/foundry/client/apps/forms/grid-config.d.mts
+++ b/src/foundry/client/apps/forms/grid-config.d.mts
@@ -125,12 +125,12 @@ declare global {
   }
 
   namespace GridConfig {
-    type FormData = {
+    interface FormData {
       "grid.type": Scene["grid"]["type"];
       "grid.size": Scene["grid"]["size"];
       scale: Scene["width"];
       "background.offsetX": Scene["background"]["offsetX"];
       "background.offsetY": Scene["background"]["offsetY"];
-    };
+    }
   }
 }
diff --git a/src/foundry/client/apps/forms/index.d.mts b/src/foundry/client/apps/forms/index.d.mts
index eba312499..81032079f 100644
--- a/src/foundry/client/apps/forms/index.d.mts
+++ b/src/foundry/client/apps/forms/index.d.mts
@@ -1,19 +1,19 @@
 import "./actor.d.mts";
-import "./adventure-exporter.mjs";
-import "./adventure-importer.mjs";
-import "./base-sheet.mjs";
+import "./adventure-exporter.d.mts";
+import "./adventure-importer.d.mts";
+import "./base-sheet.d.mts";
 import "./card-config.d.mts";
 import "./cards-config.d.mts";
 import "./combat-config.d.mts";
 import "./combatant-config.d.mts";
-import "./default-sheets-config.mjs";
+import "./default-sheets-config.d.mts";
 import "./effect-config.d.mts";
 import "./folder-config.d.mts";
-import "./fonts.mjs";
+import "./fonts.d.mts";
 import "./grid-config.d.mts";
 import "./image-popout.d.mts";
 import "./item.d.mts";
-import "./journal-page-sheet.mjs";
+import "./journal-page-sheet.d.mts";
 import "./journal-sheet.d.mts";
 import "./macro-config.d.mts";
 import "./measure-template.d.mts";
diff --git a/src/foundry/client/apps/forms/journal-page-sheet.d.mts b/src/foundry/client/apps/forms/journal-page-sheet.d.mts
index 4128883e4..8b01863e2 100644
--- a/src/foundry/client/apps/forms/journal-page-sheet.d.mts
+++ b/src/foundry/client/apps/forms/journal-page-sheet.d.mts
@@ -204,11 +204,11 @@ declare global {
       };
     }
 
-    type TimeComponents = {
+    interface TimeComponents {
       h: number;
       m: number;
       s: number;
-    };
+    }
   }
 
   /**
diff --git a/src/foundry/client/apps/forms/macro-config.d.mts b/src/foundry/client/apps/forms/macro-config.d.mts
index 2f6a1591a..461b94fcd 100644
--- a/src/foundry/client/apps/forms/macro-config.d.mts
+++ b/src/foundry/client/apps/forms/macro-config.d.mts
@@ -42,12 +42,12 @@ declare global {
   }
 
   namespace MacroConfig {
-    type FormData = {
+    interface FormData {
       command: string;
       img: string;
       name: string;
       type: ValueOf<typeof CONST.MACRO_TYPES>;
-    };
+    }
 
     interface MacroConfigData<Options extends DocumentSheetOptions<Macro> = DocumentSheetOptions<Macro>>
       extends DocumentSheet.DocumentSheetData<Options, InstanceType<ConfiguredDocumentClass<typeof Macro>>> {
diff --git a/src/foundry/client/apps/forms/measure-template.d.mts b/src/foundry/client/apps/forms/measure-template.d.mts
index e41f088b5..9a37c7224 100644
--- a/src/foundry/client/apps/forms/measure-template.d.mts
+++ b/src/foundry/client/apps/forms/measure-template.d.mts
@@ -29,7 +29,7 @@ declare global {
   }
 
   namespace MeasuredTemplateConfig {
-    type FormData = {
+    interface FormData {
       angle: number | null;
       borderColor: string;
       direction: number | null;
@@ -41,7 +41,7 @@ declare global {
       width: number | null;
       x: number | null;
       y: number | null;
-    };
+    }
 
     interface MeasuredTemplateConfigData<
       Options extends DocumentSheetOptions<MeasuredTemplateDocument> = DocumentSheetOptions<MeasuredTemplateDocument>,
diff --git a/src/foundry/client/apps/forms/scene-config.d.mts b/src/foundry/client/apps/forms/scene-config.d.mts
index 2685365a4..fbb6364d1 100644
--- a/src/foundry/client/apps/forms/scene-config.d.mts
+++ b/src/foundry/client/apps/forms/scene-config.d.mts
@@ -112,7 +112,7 @@ declare global {
   }
 
   namespace SceneConfig {
-    type FormData = {
+    interface FormData {
       backgroundColor: Scene["backgroundColor"];
       "background.src": Scene["background"]["src"];
       "background.offsetX": Scene["background"]["offsetX"];
@@ -148,6 +148,6 @@ declare global {
       tokenVision: Scene["tokenVision"];
       weather: Scene["weather"];
       width: Scene["width"];
-    };
+    }
   }
 }
diff --git a/src/foundry/client/apps/forms/sheet-config.d.mts b/src/foundry/client/apps/forms/sheet-config.d.mts
index 938e701dd..9853f2b4d 100644
--- a/src/foundry/client/apps/forms/sheet-config.d.mts
+++ b/src/foundry/client/apps/forms/sheet-config.d.mts
@@ -115,7 +115,7 @@ declare global {
   }
 
   namespace DocumentSheetConfig {
-    type SheetRegistration = {
+    interface SheetRegistration {
       action: "register";
 
       /** The Document class being registered */
@@ -135,9 +135,9 @@ declare global {
 
       /** Make this sheet the default for provided types? */
       makeDefault: boolean;
-    };
+    }
 
-    type SheetUnregistration = {
+    interface SheetUnregistration {
       action: "unregister";
 
       /** The Document class being unregistered */
@@ -148,7 +148,7 @@ declare global {
 
       /** An array of types for which this sheet is removed */
       types: string[];
-    };
+    }
 
     type SheetAssignment = SheetRegistration | SheetUnregistration;
 
diff --git a/src/foundry/client/apps/hud/menu.d.mts b/src/foundry/client/apps/hud/menu.d.mts
index e802b4855..eb7c0119f 100644
--- a/src/foundry/client/apps/hud/menu.d.mts
+++ b/src/foundry/client/apps/hud/menu.d.mts
@@ -72,6 +72,6 @@ declare global {
       onClick: () => void;
     }
 
-    type MenuStructure = { [name: string]: MenuItem };
+    type MenuStructure = Record<string, MenuItem>;
   }
 }
diff --git a/src/foundry/client/apps/hud/navigation.d.mts b/src/foundry/client/apps/hud/navigation.d.mts
index c078f8128..36c59c9d0 100644
--- a/src/foundry/client/apps/hud/navigation.d.mts
+++ b/src/foundry/client/apps/hud/navigation.d.mts
@@ -84,7 +84,7 @@ declare global {
   }
 
   namespace SceneNavigation {
-    type SceneData = {
+    interface SceneData {
       id: string;
       active: boolean;
       name: string;
@@ -92,7 +92,7 @@ declare global {
       users: { letter: string; color: User["color"] }[];
       visible: boolean;
       css: string;
-    };
+    }
 
     interface SceneNavigationData {
       collapsed: boolean;
diff --git a/src/foundry/client/apps/hud/players.d.mts b/src/foundry/client/apps/hud/players.d.mts
index 406802ace..09cff64f9 100644
--- a/src/foundry/client/apps/hud/players.d.mts
+++ b/src/foundry/client/apps/hud/players.d.mts
@@ -61,7 +61,7 @@ declare global {
   }
 
   namespace PlayerList {
-    type UserData = {
+    interface UserData {
       active: User["active"];
       isGM: User["isGM"];
       isSelf: User["isSelf"];
@@ -69,7 +69,7 @@ declare global {
       color: string;
       border: string;
       displayName: string;
-    };
+    }
 
     interface Data {
       users: UserData[];
diff --git a/src/foundry/client/apps/i18n.d.mts b/src/foundry/client/apps/i18n.d.mts
index 305a4cb04..f1556f9eb 100644
--- a/src/foundry/client/apps/i18n.d.mts
+++ b/src/foundry/client/apps/i18n.d.mts
@@ -157,8 +157,8 @@ declare global {
   }
 
   namespace Localization {
-    type Translations = {
+    interface Translations {
       [K: string]: string | Translations;
-    };
+    }
   }
 }
diff --git a/src/foundry/client/apps/placeables/light-config.d.mts b/src/foundry/client/apps/placeables/light-config.d.mts
index 438b0b49b..29da05bab 100644
--- a/src/foundry/client/apps/placeables/light-config.d.mts
+++ b/src/foundry/client/apps/placeables/light-config.d.mts
@@ -69,7 +69,7 @@ declare global {
   }
 
   namespace AmbientLightConfig {
-    type FormData = {
+    interface FormData {
       x: AmbientLightDocument["x"];
       y: AmbientLightDocument["y"];
       rotation: AmbientLightDocument["rotation"];
@@ -92,6 +92,6 @@ declare global {
       "config.saturation": AmbientLightDocument["config"]["saturation"];
       "config.contrast": AmbientLightDocument["config"]["contrast"];
       "config.shadows": AmbientLightDocument["config"]["shadows"];
-    };
+    }
   }
 }
diff --git a/src/foundry/client/apps/placeables/token-config.d.mts b/src/foundry/client/apps/placeables/token-config.d.mts
index 0a0c0c0e0..33f1a06a2 100644
--- a/src/foundry/client/apps/placeables/token-config.d.mts
+++ b/src/foundry/client/apps/placeables/token-config.d.mts
@@ -137,7 +137,7 @@ declare global {
   }
 
   namespace TokenConfig {
-    type FormData = {
+    interface FormData {
       // TODO: Update
       actorId: string;
       actorLink: boolean;
@@ -173,7 +173,7 @@ declare global {
       width: number | null;
       x: number | null;
       y: number | null;
-    };
+    }
   }
 
   /**
diff --git a/src/foundry/client/audio/index.d.mts b/src/foundry/client/audio/index.d.mts
index 10a74b45f..0d8d39a06 100644
--- a/src/foundry/client/audio/index.d.mts
+++ b/src/foundry/client/audio/index.d.mts
@@ -1,3 +1,3 @@
 import "./audio.d.mts";
 import "./container.d.mts";
-import "./sound.mts";
+import "./sound.d.mts";
diff --git a/src/foundry/client/av/settings.d.mts b/src/foundry/client/av/settings.d.mts
index a6dc7c2b8..d625489a7 100644
--- a/src/foundry/client/av/settings.d.mts
+++ b/src/foundry/client/av/settings.d.mts
@@ -275,7 +275,10 @@ declare global {
     type WorldSettings = typeof AVSettings.DEFAULT_WORLD_SETTINGS;
     type StoredUserSettings = typeof AVSettings.DEFAULT_USER_SETTINGS;
     type UserSettings = StoredUserSettings & { canBroadcastAudio: boolean; canBroadcastVideo: boolean };
-    type Settings = { client: ClientSettings; world: WorldSettings };
+    interface Settings {
+      client: ClientSettings;
+      world: WorldSettings;
+    }
     // eslint-disable-next-line @typescript-eslint/no-empty-interface
     interface Overrides {}
     interface DefaultVoiceModes {
diff --git a/src/foundry/client/config.d.mts b/src/foundry/client/config.d.mts
index e441edc14..8e3f0399e 100644
--- a/src/foundry/client/config.d.mts
+++ b/src/foundry/client/config.d.mts
@@ -2730,12 +2730,15 @@ declare global {
       config: Record<string, unknown>;
     }
 
+    // The point of this interface is to be declaration merged into so you can override `DefaultSpecialStatusEffects` and remove existing keys. It's never used when empty.
+    // eslint-disable-next-line @typescript-eslint/no-empty-interface
     interface SpecialStatusEffects {}
-    type DefaultSpecialStatusEffects = {
+
+    interface DefaultSpecialStatusEffects {
       DEFEATED: string;
       INVISIBLE: string;
       BLIND: string;
-    };
+    }
 
     namespace Cards {
       interface Preset {
diff --git a/src/foundry/client/core/index.d.mts b/src/foundry/client/core/index.d.mts
index 5b35da091..eee8f97e4 100644
--- a/src/foundry/client/core/index.d.mts
+++ b/src/foundry/client/core/index.d.mts
@@ -7,7 +7,7 @@ import "./keybindings.d.mts";
 import "./keyboard.d.mts";
 import "./mouse.d.mts";
 import "./nue.d.mts";
-import "./packages.mjs";
+import "./packages.d.mts";
 import "./settings.d.mts";
 import "./socket.d.mts";
 import "./sorting.d.mts";
diff --git a/src/foundry/client/core/keybindings.d.mts b/src/foundry/client/core/keybindings.d.mts
index 798f91954..f3eb47963 100644
--- a/src/foundry/client/core/keybindings.d.mts
+++ b/src/foundry/client/core/keybindings.d.mts
@@ -295,18 +295,18 @@ declare global {
   }
 
   namespace ClientKeybindings {
-    type MovementDirections = {
+    interface MovementDirections {
       UP: "up";
       LEFT: "left";
       DOWN: "down";
       RIGHT: "right";
-    };
+    }
     type MovementDirection = ValueOf<MovementDirections>;
 
-    type ZoomDirections = {
+    interface ZoomDirections {
       IN: "in";
       OUT: "out";
-    };
+    }
     type ZoomDirection = ValueOf<ZoomDirections>;
   }
 }
diff --git a/src/foundry/client/core/packages.d.mts b/src/foundry/client/core/packages.d.mts
index 6222dc0d7..358b95f82 100644
--- a/src/foundry/client/core/packages.d.mts
+++ b/src/foundry/client/core/packages.d.mts
@@ -112,14 +112,16 @@ declare class ClientPackage {
 
 declare global {
   namespace ClientPackage {
-    type PackageCompatibilityBadge = {
+    interface PackageCompatibilityBadge {
       type: "safe" | "unsafe" | "warning" | "neutral" | "error";
       tooltip: string;
       label?: string;
       icon?: string;
-    };
+    }
 
-    type ModuleConstructorData = { active: boolean };
+    interface ModuleConstructorData {
+      active: boolean;
+    }
   }
 
   /**
diff --git a/src/foundry/client/data/abstract/directory-collection-mixin.d.mts b/src/foundry/client/data/abstract/directory-collection-mixin.d.mts
index e510a9d7b..31766ecf5 100644
--- a/src/foundry/client/data/abstract/directory-collection-mixin.d.mts
+++ b/src/foundry/client/data/abstract/directory-collection-mixin.d.mts
@@ -120,14 +120,14 @@ declare global {
     // TODO: Refine type based on CONST.FOLDER_DOCUMENT_TYPES
     type DirectoryTypes = object;
 
-    type TreeNode<T> = {
+    interface TreeNode<T> {
       children: TreeNode<T>[];
       depth: number;
       entries: T[];
       folder: Folder;
       root: boolean;
       visible: boolean;
-    };
+    }
 
     type AlphabeticalSortEntry = { name: string } & object;
     type StandardSortEntry = { sort: number } & object;
diff --git a/src/foundry/client/data/abstract/index.d.mts b/src/foundry/client/data/abstract/index.d.mts
index 239ba8bbb..eaed00fc4 100644
--- a/src/foundry/client/data/abstract/index.d.mts
+++ b/src/foundry/client/data/abstract/index.d.mts
@@ -1,6 +1,6 @@
 import "./canvas-document.d.mts";
 import "./client-backend.d.mts";
 import "./client-document.d.mts";
-import "./directory-collection-mixin.mjs";
+import "./directory-collection-mixin.d.mts";
 import "./document-collection.d.mts";
 import "./world-collection.d.mts";
diff --git a/src/foundry/client/data/documents/adventure.d.mts b/src/foundry/client/data/documents/adventure.d.mts
index 777739ab7..6283a0693 100644
--- a/src/foundry/client/data/documents/adventure.d.mts
+++ b/src/foundry/client/data/documents/adventure.d.mts
@@ -48,16 +48,16 @@ declare global {
     importContent(data?: InexactPartial<AdventureImportData>): Promise<AdventureImportResult>;
   }
 
-  type AdventureImportData = {
+  interface AdventureImportData {
     toCreate?: DocumentDataRecord;
     toUpdate?: DocumentDataRecord;
     documentCount: number;
-  };
+  }
 
-  type AdventureImportResult = {
+  interface AdventureImportResult {
     created: DocumentResult;
     updated: DocumentResult;
-  };
+  }
 }
 
 type DocumentDataRecord = {
diff --git a/src/foundry/client/data/documents/combat.d.mts b/src/foundry/client/data/documents/combat.d.mts
index 36d96ab1c..19c1eacdc 100644
--- a/src/foundry/client/data/documents/combat.d.mts
+++ b/src/foundry/client/data/documents/combat.d.mts
@@ -28,12 +28,12 @@ declare global {
     }
   }
 
-  type CombatHistoryData = {
+  interface CombatHistoryData {
     round: number | null;
     turn: number | null;
     tokenId: string | null;
     combatantId: string | null;
-  };
+  }
 
   /**
    * The client-side Combat document which extends the common BaseCombat model.
diff --git a/src/foundry/client/data/documents/index.d.mts b/src/foundry/client/data/documents/index.d.mts
index caa9a2a63..9c15a1a75 100644
--- a/src/foundry/client/data/documents/index.d.mts
+++ b/src/foundry/client/data/documents/index.d.mts
@@ -4,7 +4,7 @@ import "./actor.d.mts";
 import "./adventure.d.mts";
 import "./ambient-light.d.mts";
 import "./ambient-sound.d.mts";
-import "./card.mts";
+import "./card.d.mts";
 import "./cards.d.mts";
 import "./chat-message.d.mts";
 import "./combat.d.mts";
@@ -18,7 +18,7 @@ import "./journal-entry-page.d.mts";
 import "./macro.d.mts";
 import "./measured-template.d.mts";
 import "./note.d.mts";
-import "./playlist-sound.mts";
+import "./playlist-sound.d.mts";
 import "./playlist.d.mts";
 import "./scene.d.mts";
 import "./setting.d.mts";
diff --git a/src/foundry/client/data/documents/macro.d.mts b/src/foundry/client/data/documents/macro.d.mts
index e6e593e56..d797e6c61 100644
--- a/src/foundry/client/data/documents/macro.d.mts
+++ b/src/foundry/client/data/documents/macro.d.mts
@@ -33,11 +33,10 @@ declare global {
     /**
      * Execute the Macro command.
      * @param scope - Macro execution scope which is passed to script macros
-     * @returns A created ChatMessage from chat macros or returned value from script macros
+     * @remarks `type === "chat"` returns void, `type === "script"` returns the promise
+     * @privateRemarks Foundry's stated return value is incorrect, #executeChat only returns `void`
      */
-
-    // TODO: Test if additional scope can be passed
-    execute(scope?: Scope): this["type"] extends "chat" ? ChatMessage.ConfiguredInstance : any;
+    execute(scope?: Scope): void | Promise<unknown>;
 
     _onClickDocumentLink(event: MouseEvent): ReturnType<this["execute"]>;
   }
@@ -53,4 +52,9 @@ interface Scope {
    * A Token which is the protagonist of the executed action
    */
   token?: Token;
+
+  /**
+   * @remarks Additional arguments passed as part of the scope
+   */
+  [arg: string]: unknown;
 }
diff --git a/src/foundry/client/data/documents/token.d.mts b/src/foundry/client/data/documents/token.d.mts
index a9f6a270c..51305cf33 100644
--- a/src/foundry/client/data/documents/token.d.mts
+++ b/src/foundry/client/data/documents/token.d.mts
@@ -272,12 +272,12 @@ declare global {
 
   // The getBarAttribute monkeypatch is simply inside the data model definition at `src\foundry\common\data\data.d.mts`
 
-  type TrackedAttributesDescription = {
+  interface TrackedAttributesDescription {
     /** A list of property path arrays to attributes with both a value and a max property. */
     bar: string[][];
     /** A list of property path arrays to attributes that have only a value property. */
     value: string[][];
-  };
+  }
 }
 
 interface SingleAttributeBar {
diff --git a/src/foundry/client/game.d.mts b/src/foundry/client/game.d.mts
index 0a0111b47..8bedb3cfb 100644
--- a/src/foundry/client/game.d.mts
+++ b/src/foundry/client/game.d.mts
@@ -6,14 +6,15 @@ import type {
   ModuleRequiredOrOptional,
 } from "../../types/helperTypes.d.mts";
 import type { StoredDocument, ValueOf } from "../../types/utils.d.mts";
+import type { BasePackage } from "../common/packages/module.d.ts";
 
-type EarlierEvents = {
+interface EarlierEvents {
   none: never;
   init: "none";
   i18nInit: "none" | "init";
   setup: "none" | "init" | "i18nInit";
   ready: "none" | "init" | "i18nInit" | "setup";
-};
+}
 
 type InitializationEvent = keyof EarlierEvents;
 
@@ -91,11 +92,7 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
    * A mapping of CompendiumCollection instances, one per Compendium pack.
    * @remarks Initialized just before the `"setup"` hook event is called.
    */
-  readonly packs: GameInitialized<
-    foundry.utils.Collection<CompendiumCollection<CompendiumCollection.Metadata>>,
-    "setup",
-    RunEvents
-  >;
+  readonly packs: GameInitialized<CompendiumPacks, "setup", RunEvents>;
 
   /**
    * A singleton web Worker manager.
@@ -645,8 +642,11 @@ declare global {
         PackageCompendiumData & {
           /** @deprecated since v11 */
           private?: boolean;
-          system?: string;
+          system?: string | undefined;
           type: foundry.CONST.COMPENDIUM_DOCUMENT_TYPES;
+          packageName: BasePackage["_source"]["id"];
+          packageType: BasePackage["type"];
+          id: string;
         }
       >;
       paused: boolean;
@@ -696,7 +696,7 @@ type ConfiguredCollectionClassForName<Name extends foundry.CONST.DOCUMENT_TYPES>
   CONFIG[Name]["collection"]
 >;
 
-type DocumentTemplate = {
+interface DocumentTemplate {
   htmlFields: string[];
   types: string[];
-};
+}
diff --git a/src/foundry/client/head.d.mts b/src/foundry/client/head.d.mts
index d7ed139ce..76345728e 100644
--- a/src/foundry/client/head.d.mts
+++ b/src/foundry/client/head.d.mts
@@ -6,13 +6,13 @@ type _UninitializedGame = { [K in keyof Game]?: never };
 interface UninitializedGame extends _UninitializedGame {}
 
 // These type aliases are used for intellisense reasons so that the type displays `UninitializedGame | InitGame | ...` instead of a too complex looking type.
-type Games = {
+interface Games {
   none: UninitializedGame;
   init: InitGame;
   i18nInit: I18nInitGame;
   setup: SetupGame;
   ready: ReadyGame;
-};
+}
 
 // Needs to include the current hook as well as all hooks that can run after it.
 type GameHooks = Exclude<InitializationEvent, EarlierEvents[keyof AssumeHookRan]>;
diff --git a/src/foundry/client/hooks.d.mts b/src/foundry/client/hooks.d.mts
index e25b9c10b..e9458b764 100644
--- a/src/foundry/client/hooks.d.mts
+++ b/src/foundry/client/hooks.d.mts
@@ -8,6 +8,7 @@ import type {
 import type { DeepPartial, ValueOf } from "../../types/utils.d.mts";
 import type { DropData } from "./data/abstract/client-document.d.mts";
 import type { DocumentModificationOptions } from "../common/abstract/document.d.mts";
+// eslint-disable-next-line import/no-named-as-default
 import type ProseMirrorMenu from "../prosemirror/menu.d.mts";
 import type { ProseMirrorDropDown } from "../prosemirror/menu.d.mts";
 import type { OccludableObject } from "./pixi/placeables/primary-canvas-objects/occludable-object.d.mts";
diff --git a/src/foundry/client/pixi/board.d.mts b/src/foundry/client/pixi/board.d.mts
index 6c8e5883a..f19ad96d5 100644
--- a/src/foundry/client/pixi/board.d.mts
+++ b/src/foundry/client/pixi/board.d.mts
@@ -915,7 +915,7 @@ interface CollectionNameToLayerMap {
 }
 
 // TODO: Find a way to make this more dynamic
-type CanvasGroups = {
+interface CanvasGroups {
   // readonly [GroupName in keyof CONFIG.Canvas.Groups]?: CONFIG.Canvas.Groups[GroupName]["groupClass"];
 
   readonly hidden?: HiddenCanvasGroup;
@@ -923,4 +923,4 @@ type CanvasGroups = {
   readonly rendered?: RenderedCanvasGroup;
 
   readonly environment?: EnvironmentCanvasGroup;
-};
+}
diff --git a/src/foundry/client/pixi/core/containers/cached-container.d.mts b/src/foundry/client/pixi/core/containers/cached-container.d.mts
index e124d8631..476407e74 100644
--- a/src/foundry/client/pixi/core/containers/cached-container.d.mts
+++ b/src/foundry/client/pixi/core/containers/cached-container.d.mts
@@ -92,11 +92,11 @@ declare global {
   }
 
   namespace CachedContainer {
-    type RenderOptions = {
+    interface RenderOptions {
       /** Render function that will be called to render into the RT. */
       renderFunction?: (renderer: PIXI.Renderer) => void;
       /** An optional clear color to clear the RT before rendering into it. */
       clearColor?: number[];
-    };
+    }
   }
 }
diff --git a/src/foundry/client/pixi/core/index.d.mts b/src/foundry/client/pixi/core/index.d.mts
index 3a9c18d67..e4936d6d6 100644
--- a/src/foundry/client/pixi/core/index.d.mts
+++ b/src/foundry/client/pixi/core/index.d.mts
@@ -1,5 +1,4 @@
 import "./containers/index.d.mts";
-import "./culling.d.mts";
 import "./interaction/index.d.mts";
 import "./loader.d.mts";
 import "./shapes/index.d.mts";
diff --git a/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts b/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts
index 3dfb1c709..01b4c780c 100644
--- a/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts
+++ b/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts
@@ -225,7 +225,7 @@ declare global {
     /**
      * Enumerate the states of handle outcome.
      */
-    type HANDLER_OUTCOME = {
+    interface HANDLER_OUTCOME {
       /** -2: SKIPPED - the handler has been skipped by previous logic */
       SKIPPED: -2;
 
@@ -237,7 +237,7 @@ declare global {
 
       /** 2: ACCEPTED - the handler callback has been processed and is accepting further process */
       ACCEPTED: 2;
-    };
+    }
 
     type PermissionAction =
       | "clickLeft"
diff --git a/src/foundry/client/pixi/core/interaction/render-flags.d.mts b/src/foundry/client/pixi/core/interaction/render-flags.d.mts
index f95104286..fda1c8146 100644
--- a/src/foundry/client/pixi/core/interaction/render-flags.d.mts
+++ b/src/foundry/client/pixi/core/interaction/render-flags.d.mts
@@ -34,12 +34,12 @@ declare class RenderFlagObject {
 
 declare global {
   /** @privateRemarks Values are marked as optional here based on use, foundry docs incomplete */
-  type RenderFlag<Flags> = {
+  interface RenderFlag<Flags> {
     /** Activating this flag also sets these flags to true */
     propagate?: Array<Partial<keyof Flags>>;
     /** Activating this flag resets these flags to false */
     reset?: Array<Partial<keyof Flags>>;
-  };
+  }
 
   /**
    * A data structure for tracking a set of boolean status flags.
diff --git a/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts b/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts
index 0ef6e19f8..d508d6269 100644
--- a/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts
+++ b/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts
@@ -85,7 +85,7 @@ declare global {
   }
 
   namespace LimitedAnglePolygon {
-    type ConstructorOptions = {
+    interface ConstructorOptions {
       /**
        * The radius of the emitted cone.
        */
@@ -114,6 +114,6 @@ declare global {
        * @defaultValue `0`
        */
       externalRadius?: number;
-    };
+    }
   }
 }
diff --git a/src/foundry/client/pixi/core/shapes/polygon-mesher.mts b/src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts
similarity index 100%
rename from src/foundry/client/pixi/core/shapes/polygon-mesher.mts
rename to src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts
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..6d0f9227c 100644
--- a/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
+++ b/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
@@ -242,11 +242,11 @@ declare global {
   namespace PointSourcePolygon {
     type CollisionModes = "any" | "all" | "closest";
 
-    type CollisionTypes = {
+    interface CollisionTypes {
       any: boolean;
       closest: PolygonVertex;
       all: PolygonVertex[] | null;
-    };
+    }
 
     type TestCollision<Mode extends CollisionModes> = CollisionTypes[Mode];
   }
diff --git a/src/foundry/client/pixi/extensions/circle.d.mts b/src/foundry/client/pixi/extensions/circle.d.mts
index 75a9d2305..7c960e70e 100644
--- a/src/foundry/client/pixi/extensions/circle.d.mts
+++ b/src/foundry/client/pixi/extensions/circle.d.mts
@@ -119,12 +119,12 @@ declare module "pixi.js" {
   }
 
   namespace Circle {
-    type PointsForArcOptions = {
+    interface PointsForArcOptions {
       /** The number of points which defines the density of approximation */
       density: number;
 
       /** Whether to include points at the circle where the arc starts and ends */
       includeEndpoints: boolean;
-    };
+    }
   }
 }
diff --git a/src/foundry/client/pixi/extensions/polygon.d.mts b/src/foundry/client/pixi/extensions/polygon.d.mts
index 93efb5b0a..e375b2a79 100644
--- a/src/foundry/client/pixi/extensions/polygon.d.mts
+++ b/src/foundry/client/pixi/extensions/polygon.d.mts
@@ -2,10 +2,10 @@ export {};
 
 declare module "pixi.js" {
   namespace Polygon {
-    type ClipperPoint = {
+    interface ClipperPoint {
       X: number;
       Y: number;
-    };
+    }
   }
 
   interface Polygon {
diff --git a/src/foundry/client/pixi/layers/controls/index.d.mts b/src/foundry/client/pixi/layers/controls/index.d.mts
index fb1a47e32..cc3efa0d0 100644
--- a/src/foundry/client/pixi/layers/controls/index.d.mts
+++ b/src/foundry/client/pixi/layers/controls/index.d.mts
@@ -1,5 +1,5 @@
 import "./cursor.d.mts";
 import "./door.d.mts";
-import "./hud.mts";
+import "./hud.d.mts";
 import "./layer.d.mts";
 import "./ruler.d.mts";
diff --git a/src/foundry/client/pixi/layers/controls/ruler.d.mts b/src/foundry/client/pixi/layers/controls/ruler.d.mts
index baf54d94d..673c5ddd1 100644
--- a/src/foundry/client/pixi/layers/controls/ruler.d.mts
+++ b/src/foundry/client/pixi/layers/controls/ruler.d.mts
@@ -1,7 +1,7 @@
 import type { InexactPartial, ValueOf } from "../../../../../types/utils.d.mts";
 
 declare global {
-  type RulerMeasurementSegment = {
+  interface RulerMeasurementSegment {
     /** The Ray which represents the point-to-point line segment */
     ray: Ray;
 
@@ -16,7 +16,7 @@ declare global {
 
     /** Is this segment the last one? */
     last: boolean;
-  };
+  }
 
   interface RulerData {
     /** The ruler measurement state. */
@@ -155,11 +155,6 @@ declare global {
       }>,
     ): Ruler.Segment[];
 
-    /**
-     * Get the text label for a segment of the measured path
-     */
-    protected _getSegmentLabel(segmentDistance: number, totalDistance: number, isTotal: boolean): string;
-
     /**
      * While measurement is in progress, update the destination to be the central point of the target grid space.
      * @param destination - The current pixel coordinates of the mouse movement
diff --git a/src/foundry/client/pixi/layers/effects/visibility.d.mts b/src/foundry/client/pixi/layers/effects/visibility.d.mts
index 0644110cd..690c3c416 100644
--- a/src/foundry/client/pixi/layers/effects/visibility.d.mts
+++ b/src/foundry/client/pixi/layers/effects/visibility.d.mts
@@ -149,13 +149,13 @@ declare global {
     format: PIXI.FORMATS;
   }
 
-  type CanvasVisibilityTest = {
+  interface CanvasVisibilityTest {
     point: PIXI.Point;
     los: Map<VisionSource, boolean>;
-  };
+  }
 
-  type CanvasVisibilityTestConfig = {
+  interface CanvasVisibilityTestConfig {
     object: PlaceableObject | null;
     tests: CanvasVisibilityTest[];
-  };
+  }
 }
diff --git a/src/foundry/client/pixi/layers/grid/hex.d.mts b/src/foundry/client/pixi/layers/grid/hex.d.mts
index dacdb1990..e6e82d76c 100644
--- a/src/foundry/client/pixi/layers/grid/hex.d.mts
+++ b/src/foundry/client/pixi/layers/grid/hex.d.mts
@@ -2,7 +2,7 @@ import type { InexactPartial } from "../../../../../types/utils.d.mts";
 import type { CONST } from "../../../../common/module.d.mts";
 
 declare global {
-  type HexGridConfiguration = {
+  interface HexGridConfiguration {
     /**
      * Columnar orientation?
      * @defaultValue `true`
@@ -35,9 +35,9 @@ declare global {
      * Legacy hex grid computation (not recommended)
      */
     legacy?: boolean | undefined;
-  };
+  }
 
-  type HexCubeCoordinate = {
+  interface HexCubeCoordinate {
     /**
      * Coordinate along the SW - NE axis
      */
@@ -52,9 +52,9 @@ declare global {
      * Coordinate along the NW - SE axis
      */
     s: number;
-  };
+  }
 
-  type HexOffsetCoordinate = {
+  interface HexOffsetCoordinate {
     /**
      * The row coordinate
      */
@@ -64,7 +64,7 @@ declare global {
      * The column coordinate
      */
     col: number;
-  };
+  }
 
   /**
    * A helper class which represents a single hexagon as part of a HexagonalGrid.
diff --git a/src/foundry/client/pixi/perception/detection-mode.d.mts b/src/foundry/client/pixi/perception/detection-mode.d.mts
index 4e74cb7ee..4950fc5bc 100644
--- a/src/foundry/client/pixi/perception/detection-mode.d.mts
+++ b/src/foundry/client/pixi/perception/detection-mode.d.mts
@@ -16,8 +16,6 @@ declare global {
     }
   }
 
-  interface DetectionMode extends fields.SchemaField.InnerInitializedType<DetectionMode.Schema> {}
-
   /**
    * A Detection Mode which can be associated with any kind of sense/vision/perception.
    * A token could have multiple detection modes.
diff --git a/src/foundry/client/pixi/perception/vision-mode.d.mts b/src/foundry/client/pixi/perception/vision-mode.d.mts
index b0fc51b63..b9a20d48f 100644
--- a/src/foundry/client/pixi/perception/vision-mode.d.mts
+++ b/src/foundry/client/pixi/perception/vision-mode.d.mts
@@ -36,7 +36,7 @@ declare global {
      * @param data    - Data which fulfills the model defined by the VisionMode schema.
      * @param options - Additional options passed to the DataModel constructor.
      */
-    constructor(data: Partial<any>, options?: object);
+    constructor(data: InexactPartial<any>, options?: AnyObject);
 
     static defineSchema(): VisionMode.Schema;
 
diff --git a/src/foundry/client/pixi/placeables/primary-canvas-objects/token-mesh.d.mts b/src/foundry/client/pixi/placeables/primary-canvas-objects/token-mesh.d.mts
index b76b654ce..f8fe821f5 100644
--- a/src/foundry/client/pixi/placeables/primary-canvas-objects/token-mesh.d.mts
+++ b/src/foundry/client/pixi/placeables/primary-canvas-objects/token-mesh.d.mts
@@ -40,7 +40,7 @@ declare global {
     } & ReturnType<typeof OccludableObjectMixin<typeof SpriteMesh>>["defaultData"];
   }
 
-  type TokenMeshDisplayAttributes = {
+  interface TokenMeshDisplayAttributes {
     x: number;
 
     y: number;
@@ -58,5 +58,5 @@ declare global {
     scaleY: number;
 
     tint: Color;
-  };
+  }
 }
diff --git a/src/foundry/client/pixi/placeables/template.d.mts b/src/foundry/client/pixi/placeables/template.d.mts
index bb2f42969..533c25da1 100644
--- a/src/foundry/client/pixi/placeables/template.d.mts
+++ b/src/foundry/client/pixi/placeables/template.d.mts
@@ -194,11 +194,11 @@ declare global {
 
     override rotate(angle: number, snap: number): Promise<this>;
 
-    protected override _canControl(user: User.ConfiguredInstance, event?: any): boolean;
+    protected override _canControl(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
 
-    protected override _canConfigure(user: User.ConfiguredInstance, event?: any): boolean;
+    protected override _canConfigure(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
 
-    protected override _canView(user: User.ConfiguredInstance, event?: any): boolean;
+    protected override _canView(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
 
     protected override _onUpdate(
       data: foundry.documents.BaseMeasuredTemplate.UpdateData,
@@ -206,14 +206,8 @@ declare global {
       userId: string,
     ): void;
 
-    protected override _canControl(user: User.ConfiguredInstance, event: PIXI.FederatedEvent): boolean;
-
     protected override _canHUD(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
 
-    protected override _canConfigure(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
-
-    protected override _canView(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
-
     protected override _onClickRight(event: PIXI.FederatedEvent): void;
   }
 }
diff --git a/src/foundry/client/pixi/placeables/tile.d.mts b/src/foundry/client/pixi/placeables/tile.d.mts
index 7f5a8d2fe..2fce85eba 100644
--- a/src/foundry/client/pixi/placeables/tile.d.mts
+++ b/src/foundry/client/pixi/placeables/tile.d.mts
@@ -175,7 +175,7 @@ declare global {
      * Create a preview tile with a background texture instead of an image
      * @param data - Initial data with which to create the preview Tile
      */
-    static createPreview(data: unknown): Tile;
+    static createPreview(data: foundry.documents.BaseTile.ConstructorData): Tile.ConfiguredInstance;
 
     protected override _draw(options?: Record<string, unknown>): Promise<void>;
 
@@ -256,12 +256,6 @@ declare global {
      */
     protected _onHandleDragCancel(event: PIXI.FederatedEvent): void;
 
-    /**
-     * Create a preview tile with a background texture instead of an image
-     * @param data - Initial data with which to create the preview Tile
-     */
-    static createPreview(data: foundry.documents.BaseTile.ConstructorData): Tile.ConfiguredInstance;
-
     /**
      * @deprecated since v11, will be removed in v13
      * @remarks "Tile#testOcclusion has been deprecated in favor of PrimaryCanvasObject#testOcclusion"
diff --git a/src/foundry/client/pixi/placeables/wall.d.mts b/src/foundry/client/pixi/placeables/wall.d.mts
index 9581c9e82..2e2ca5fe5 100644
--- a/src/foundry/client/pixi/placeables/wall.d.mts
+++ b/src/foundry/client/pixi/placeables/wall.d.mts
@@ -179,12 +179,6 @@ declare global {
 
     protected override _destroy(options?: PIXI.IDestroyOptions | boolean): void;
 
-    /**
-     * Given the properties of the wall - decide upon a color to render the wall for display on the WallsLayer
-     * @internal
-     */
-    protected _getWallColor(): number;
-
     /**
      * Test whether the Wall direction lies between two provided angles
      * This test is used for collision and vision checks against one-directional walls
diff --git a/src/foundry/client/pixi/sources/base-source.d.mts b/src/foundry/client/pixi/sources/base-source.d.mts
index ba2cb8ab0..8bad14504 100644
--- a/src/foundry/client/pixi/sources/base-source.d.mts
+++ b/src/foundry/client/pixi/sources/base-source.d.mts
@@ -96,6 +96,13 @@ declare global {
      */
     get radius(): number;
 
+    /**
+     * @deprecated since v11, will be removed in v13
+     * @remarks The setter PointSource#radius is deprecated.
+     * @remarks The radius should not be set anywhere except in PointSource#_initialize.
+     */
+    set radius(radius);
+
     /**
      * Initialize and configure the PointSource using provided data.
      * @param data - Provided data for configuration
@@ -161,13 +168,6 @@ declare global {
      */
     get sourceType(): (typeof PointSource)["sourceType"];
 
-    /**
-     * @deprecated since v11, will be removed in v13
-     * @remarks The setter PointSource#radius is deprecated.
-     * @remarks The radius should not be set anywhere except in PointSource#_initialize.
-     */
-    set radius(radius);
-
     /**
      * @deprecated since v11, will be removed in v13
      * @remarks PointSource#los is deprecated in favor of PointSource#shape.
diff --git a/src/foundry/client/pixi/sources/rendered-source.d.mts b/src/foundry/client/pixi/sources/rendered-source.d.mts
index 861f7c876..7e72a1917 100644
--- a/src/foundry/client/pixi/sources/rendered-source.d.mts
+++ b/src/foundry/client/pixi/sources/rendered-source.d.mts
@@ -36,7 +36,7 @@ declare global {
       time: number;
     }>;
 
-    type RenderedPointSourceLayer = {
+    interface RenderedPointSourceLayer {
       /** Is this layer actively rendered? */
       active?: boolean;
       /** Do uniforms need to be reset? */
@@ -47,7 +47,7 @@ declare global {
       mesh?: PointSourceMesh;
       /** The shader instance used for the layer */
       shader?: AdaptiveLightingShader;
-    };
+    }
   }
 
   class RenderedPointSource extends PointSource {
diff --git a/src/foundry/client/pixi/webgl/shaders/filters/fxaa.d.mts b/src/foundry/client/pixi/webgl/shaders/filters/fxaa.d.mts
index 469f49ad0..2ab9e1826 100644
--- a/src/foundry/client/pixi/webgl/shaders/filters/fxaa.d.mts
+++ b/src/foundry/client/pixi/webgl/shaders/filters/fxaa.d.mts
@@ -68,5 +68,7 @@ declare global {
     ): AdaptiveFXAAFilter;
   }
 
+  // TODO: This needs to be filled in.
+  // eslint-disable-next-line @typescript-eslint/no-empty-interface
   interface AdaptiveFXAAFilterOptions {}
 }
diff --git a/src/foundry/common/abstract/data.d.mts b/src/foundry/common/abstract/data.d.mts
index cbe8dc322..393329587 100644
--- a/src/foundry/common/abstract/data.d.mts
+++ b/src/foundry/common/abstract/data.d.mts
@@ -1,11 +1,9 @@
 import type { DataField, SchemaField } from "../data/fields.mts";
 import type { fields } from "../data/module.mts";
-import { DataModelValidationFailure } from "../data/validation-failure.mts";
+import type { DataModelValidationFailure } from "../data/validation-failure.d.mts";
 
 declare global {
-  interface DataSchema {
-    [name: string]: DataField.Unknown;
-  }
+  type DataSchema = Record<string, DataField.Any>;
 
   interface DataValidationOptions {
     /**
@@ -45,10 +43,11 @@ declare class _InternalDataModel<
   _Computed extends object = SchemaField.InnerInitializedType<Schema>,
 > extends DynamicClass<_Computed> {}
 
+export default DataModel;
 /**
  * The abstract base class which defines the data schema contained within a Document.
  */
-export default abstract class DataModel<
+declare abstract class DataModel<
   Schema extends DataSchema,
   Parent extends DataModel.Any | null = null,
 > extends _InternalDataModel<Schema> {
@@ -389,9 +388,7 @@ export default abstract class DataModel<
   update(changes: any, options: any): unknown;
 }
 
-export { DataModel };
-
-export declare namespace DataModel {
+declare namespace DataModel {
   interface ConstructorOptions<Parent extends Any | null = null> {
     /**
      * A parent DataModel instance to which this DataModel belongs
@@ -432,3 +429,6 @@ export declare namespace DataModel {
     _backup: Record<string, unknown>;
   }
 }
+
+// Matches foundry exporting class as both default and non-default
+export { DataModel };
diff --git a/src/foundry/common/abstract/embedded-collection-delta.d.mts b/src/foundry/common/abstract/embedded-collection-delta.d.mts
index f67581493..2caa38c4e 100644
--- a/src/foundry/common/abstract/embedded-collection-delta.d.mts
+++ b/src/foundry/common/abstract/embedded-collection-delta.d.mts
@@ -1,5 +1,5 @@
 import type { InexactPartial } from "../../../types/utils.d.mts";
-import EmbeddedCollection from "./embedded-collection.mjs";
+import type EmbeddedCollection from "./embedded-collection.d.mts";
 
 /**
  * An embedded collection delta contains delta source objects that can be compared against other objects inside a base
diff --git a/src/foundry/common/abstract/module.d.mts b/src/foundry/common/abstract/module.d.mts
index 0e33e1c3a..3b90d800a 100644
--- a/src/foundry/common/abstract/module.d.mts
+++ b/src/foundry/common/abstract/module.d.mts
@@ -1,7 +1,12 @@
-export { default as DataModel } from "./data.mts";
-export { default as TypeDataModel } from "./type-data.mts";
-export { default as Document } from "./document.mts";
-export { default as DatabaseBackend } from "./backend.mts";
-export { default as EmbeddedCollection } from "./embedded-collection.mts";
-export { default as EmbeddedCollectionDelta } from "./embedded-collection-delta.mts";
-export { default as SingletonEmbeddedCollection } from "./singleton-collection.mts";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved` from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+export { default as DataModel } from "./data.mjs";
+export { default as TypeDataModel } from "./type-data.mjs";
+export { default as Document } from "./document.mjs";
+export { default as DatabaseBackend } from "./backend.mjs";
+export { default as EmbeddedCollection } from "./embedded-collection.mjs";
+export { default as EmbeddedCollectionDelta } from "./embedded-collection-delta.mjs";
+export { default as SingletonEmbeddedCollection } from "./singleton-collection.mjs";
diff --git a/src/foundry/common/abstract/singleton-collection.d.mts b/src/foundry/common/abstract/singleton-collection.d.mts
index 846edc9ea..73e1265d9 100644
--- a/src/foundry/common/abstract/singleton-collection.d.mts
+++ b/src/foundry/common/abstract/singleton-collection.d.mts
@@ -1,4 +1,4 @@
-import EmbeddedCollection from "./embedded-collection.mjs";
+import type EmbeddedCollection from "./embedded-collection.d.mts";
 
 /**
  * This class provides a {@link Collection} wrapper around a singleton embedded Document so that it can be interacted
diff --git a/src/foundry/common/abstract/type-data.d.mts b/src/foundry/common/abstract/type-data.d.mts
index c77eb943b..ee13b7893 100644
--- a/src/foundry/common/abstract/type-data.d.mts
+++ b/src/foundry/common/abstract/type-data.d.mts
@@ -1,5 +1,6 @@
-import type { Merge, RemoveIndexSignatures } from "../../../types/utils.d.mts";
-import type DataModel from "./data.d.mts";
+import type { IsObject, Merge, RemoveIndexSignatures, SimpleMerge } from "../../../types/utils.d.mts";
+import type { SchemaField } from "../data/fields.d.mts";
+import type { DataModel } from "./data.d.mts";
 import type Document from "./document.d.mts";
 
 type StaticDataModel = typeof DataModel<DataSchema, Document<DataSchema, any, any>>;
@@ -22,6 +23,99 @@ declare class _InternalTypeDataModel<
   _ComputedInstance extends object = Merge<RemoveIndexSignatures<BaseData>, RemoveIndexSignatures<DerivedData>>,
 > extends _InternalTypeDataModelConst<Schema, Parent, _ComputedInstance> {}
 
+// These properties are used to give a performant way of inferring types like `BaseData` and `DerivedData` types.
+// This avoids checking the entire constraint `T extends TypeDataModel.Any` to infer out the types.
+// To prevent adding properties that could appear at runtime they are unique symbols.
+// This makes them uniterable and means that the only way to access them is to have a reference to the variables which will be impossible outside of this file.
+declare const __Schema: unique symbol;
+declare const __Parent: unique symbol;
+declare const __BaseModel: unique symbol;
+declare const __BaseData: unique symbol;
+declare const __DerivedData: unique symbol;
+
+declare namespace TypeDataModel {
+  export type Any = TypeDataModel<any, any, any, any>;
+
+  // This still is only allows classes descended from `TypeDataField` because these unique symbols aren't used elsewhere.
+  // These generic parameters seem to be required. This is likely because of a TypeScript soundness holes in which concrete types like `any` or `unknown`
+  // will get treated bivariantly whereas type parameters get treated more safely.
+  interface Internal<Schema extends DataSchema, Parent extends Document.Any, BaseModel, BaseData, DerivedData> {
+    [__Schema]: Schema;
+    [__Parent]: Parent;
+    [__BaseModel]: BaseModel;
+    [__BaseData]: BaseData;
+    [__DerivedData]: DerivedData;
+  }
+
+  // Removes the base and derived data from the type.
+  // Has no extends bounds to simplify any checking logic.
+  type RemoveDerived<BaseThis, BaseModel, BaseData, DerivedData> = SimpleMerge<
+    Omit<BaseThis, keyof BaseData | keyof DerivedData>,
+    BaseModel
+  >;
+
+  export type PrepareBaseDataThis<BaseThis extends Internal<any, any, any, any, any>> =
+    BaseThis extends Internal<any, any, infer BaseModel, infer BaseData, infer DerivedData>
+      ? MergePartial<Omit<RemoveDerived<BaseThis, BaseModel, BaseData, DerivedData>, "prepareBaseData">, BaseData>
+      : never;
+
+  export type PrepareDerivedDataThis<BaseThis extends Internal<any, any, any, any, any>> =
+    BaseThis extends Internal<any, any, infer BaseModel, infer BaseData, infer DerivedData>
+      ? MergePartial<
+          SimpleMerge<Omit<RemoveDerived<BaseThis, BaseModel, BaseData, DerivedData>, "prepareDerivedData">, BaseData>,
+          DerivedData
+        >
+      : never;
+
+  // Merges U into T but makes the appropriate keys partial.
+  // This is similar to `Merge<T, DeepPartial<U>>` but only makes the deepest keys in `U` optional.
+  type MergePartial<T, U> = Omit<T, keyof U> & {
+    [K in keyof U as K extends PartialMergeKeys<T, U> ? K : never]?: InnerMerge<U, K, T>;
+  } & {
+    [K in keyof U as K extends PartialMergeKeys<T, U> ? never : K]: InnerMerge<U, K, T>;
+  };
+
+  type RequiredKeys<T> = {
+    [K in keyof T]-?: T extends { readonly [_ in K]: any } ? K : never;
+  }[keyof T];
+
+  // Returns all the keys of U that should be partial when merged into T.
+  // Only if both `T[K]` and `U[K]` are required and both are objects should a key be required.
+  // This is because essentially only the most deep keys that are merged in need to be optional.
+  type PartialMergeKeys<T, U> = {
+    [K in keyof U]-?: K extends RequiredKeys<U>
+      ? K extends RequiredKeys<T>
+        ? IsObject<T[K]> extends true
+          ? IsObject<U[K]> extends true
+            ? never
+            : K
+          : K
+        : K
+      : K;
+  }[keyof U];
+
+  // Merges `U[K]` into `T[K]` if they're both objects, returns `U[K]` otherwise.
+  type InnerMerge<U, K extends keyof U, T> = T extends { readonly [_ in K]?: infer V }
+    ? IsObject<U[K]> extends true
+      ? IsObject<V> extends true
+        ? MergePartial<V, U[K]>
+        : Partial<U[K]>
+      : Partial<U[K]>
+    : U[K];
+
+  export type ParentAssignmentType<BaseThis extends Internal<any, any, any, any, any>> =
+    BaseThis extends Internal<infer Schema, infer Parent, any, any, any>
+      ? SimpleMerge<
+          SchemaField.InitializedType<Document.SchemaFor<Parent>>,
+          {
+            // FIXME(LukeAbby): Callers handle making this partial when obvious.
+            // However also should make system partial using the regular rules: if `initial` is assignable to the field or if `required` is false etc.
+            system: SchemaField.InitializedType<Schema>;
+          }
+        >
+      : never;
+}
+
 /**
  * A specialized subclass of DataModel, intended to represent a Document's type-specific data.
  * Systems or Modules that provide DataModel implementations for sub-types of Documents (such as Actors or Items)
@@ -81,15 +175,21 @@ declare class _InternalTypeDataModel<
 export default abstract class TypeDataModel<
   Schema extends DataSchema,
   Parent extends Document<DataSchema, any, any>,
-  BaseData extends Record<string, any> = Record<string, never>,
-  DerivedData extends Record<string, any> = Record<string, never>,
+  BaseData extends Record<string, unknown> = Record<string, never>,
+  DerivedData extends Record<string, unknown> = Record<string, never>,
 > extends _InternalTypeDataModel<Schema, Parent, BaseData, DerivedData> {
+  [__Schema]: Schema;
+  [__Parent]: Parent;
+  [__BaseModel]: DataModel<Schema, Parent>;
+  [__BaseData]: RemoveIndexSignatures<BaseData>;
+  [__DerivedData]: RemoveIndexSignatures<DerivedData>;
+
   modelProvider: System | Module | null;
 
   /**
    * Prepare data related to this DataModel itself, before any derived data is computed.
    */
-  prepareBaseData(this: Merge<DataModel<Schema, Parent>, Partial<DerivedData>>): void;
+  prepareBaseData(this: TypeDataModel.PrepareBaseDataThis<this>): void;
 
   /* -------------------------------------------- */
 
@@ -97,5 +197,5 @@ export default abstract class TypeDataModel<
    * Apply transformations of derivations to the values of the source data object.
    * Compute data fields whose values are not stored to the database.
    */
-  prepareDerivedData(this: Merge<Merge<DataModel<Schema, Parent>, BaseData>, Partial<DerivedData>>): void;
+  prepareDerivedData(this: TypeDataModel.PrepareDerivedDataThis<this>): void;
 }
diff --git a/src/foundry/common/config.d.mts b/src/foundry/common/config.d.mts
index 6001e9557..c3a0b61a1 100644
--- a/src/foundry/common/config.d.mts
+++ b/src/foundry/common/config.d.mts
@@ -1,5 +1,5 @@
-import type { DataModel } from "./abstract/data.mjs";
-import type * as fields from "./data/fields.mjs";
+import type { DataModel } from "./abstract/data.d.mts";
+import type * as fields from "./data/fields.d.mts";
 import type { SOFTWARE_UPDATE_CHANNELS } from "./constants.d.mts";
 
 declare namespace ApplicationConfiguration {
@@ -181,8 +181,6 @@ declare namespace ApplicationConfiguration {
   }
 }
 
-interface ApplicationConfiguration extends fields.SchemaField.InnerInitializedType<ApplicationConfiguration.Schema> {}
-
 /**
  * A data model definition which describes the application configuration options.
  * These options are persisted in the user data Config folder in the options.json file.
@@ -192,7 +190,7 @@ interface ApplicationConfiguration extends fields.SchemaField.InnerInitializedTy
 declare class ApplicationConfiguration extends DataModel<ApplicationConfiguration.Schema> {
   static defineSchema(): ApplicationConfiguration.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   /**
    * Validate a port assignment.
@@ -270,8 +268,6 @@ declare namespace ReleaseData {
   }
 }
 
-interface ReleaseData extends fields.SchemaField.InnerInitializedType<ReleaseData.Schema> {}
-
 /** A data object which represents the details of this Release of Foundry VTT */
 declare class ReleaseData extends DataModel<ReleaseData.Schema> {
   static defineSchema(): ReleaseData.Schema;
diff --git a/src/foundry/common/constants.d.mts b/src/foundry/common/constants.d.mts
index 5998f0ae9..989f65514 100644
--- a/src/foundry/common/constants.d.mts
+++ b/src/foundry/common/constants.d.mts
@@ -1597,7 +1597,7 @@ export declare const SETUP_PACKAGE_PROGRESS: Readonly<{
     SNAPSHOT_WORLDS: "snapshotWorlds";
   };
 }>;
-export namespace SETUP_PACKAGE_PROGRESS {
+declare namespace SETUP_PACKAGE_PROGRESS {
   export type ACTIONS = ValueOf<typeof SETUP_PACKAGE_PROGRESS.ACTIONS>;
   export type STEPS = ValueOf<typeof SETUP_PACKAGE_PROGRESS.STEPS>;
 }
diff --git a/src/foundry/common/data/data.d.mts b/src/foundry/common/data/data.d.mts
index 117b1c9ad..e24bbf18d 100644
--- a/src/foundry/common/data/data.d.mts
+++ b/src/foundry/common/data/data.d.mts
@@ -1,7 +1,7 @@
 import type { DatabaseBackend } from "../abstract/module.d.mts";
 import type { DataModel } from "../abstract/data.d.mts";
 import type { fields } from "./module.d.mts";
-import type * as documents from "../documents/module.mjs";
+import type * as documents from "../documents/module.d.mts";
 import type { ValueOf } from "../../../types/utils.d.mts";
 
 // TODO: Implement all of the necessary options
@@ -11,7 +11,7 @@ declare global {
 }
 
 declare namespace LightData {
-  type LightAnimationDataSchema = {
+  export interface LightAnimationDataSchema extends DataSchema {
     /**
      * The animation type which is applied
      */
@@ -47,12 +47,12 @@ declare namespace LightData {
      * Reverse the direction of animation.
      */
     reverse: fields.BooleanField<{ label: "LIGHT.AnimationReverse" }>;
-  };
+  }
 
-  type DarknessSchema = {
+  export interface DarknessSchema extends DataSchema {
     min: fields.NumberField<{ initial: 0 }>;
     max: fields.NumberField<{ initial: 1 }>;
-  };
+  }
 
   interface Schema extends DataSchema {
     /**
@@ -168,12 +168,10 @@ declare namespace LightData {
   }
 }
 
-interface LightData extends fields.SchemaField.InnerInitializedType<LightData.Schema> {}
-
 declare class LightData extends DataModel<LightData.Schema> {
   static defineSchema(): LightData.Schema;
 
-  static migrateData(source: object): object;
+  static migrateData(source: AnyObject): AnyObject;
 }
 
 declare namespace ShapeData {
@@ -207,16 +205,14 @@ declare namespace ShapeData {
     points: fields.ArrayField<fields.NumberField<{ nullable: false }>>;
   }
 
-  type TYPES = {
+  interface TYPES {
     RECTANGLE: "r";
     CIRCLE: "c";
     ELLIPSE: "e";
     POLYGON: "p";
-  };
+  }
 }
 
-interface ShapeData extends fields.SchemaField.InnerInitializedType<ShapeData.Schema> {}
-
 declare class ShapeData extends DataModel<ShapeData.Schema> {
   static defineSchema(): ShapeData.Schema;
 
@@ -224,14 +220,14 @@ declare class ShapeData extends DataModel<ShapeData.Schema> {
 }
 
 declare namespace TextureData {
-  type DefaultOptions = {
+  interface DefaultOptions {
     categories: ["IMAGE", "VIDEO"];
     // initial: null;
     wildcard: false;
     label: "";
-  };
+  }
 
-  type Schema<SrcOptions extends FilePathFieldOptions> = {
+  interface Schema<SrcOptions extends FilePathFieldOptions> extends DataSchema {
     /**
      * The URL of the texture source.
      */
@@ -266,15 +262,12 @@ declare namespace TextureData {
      * An optional color string used to tint the texture.
      */
     tint: fields.ColorField;
-  };
+  }
 }
 
-interface TextureData<SrcOptions extends FilePathFieldOptions = TextureData.DefaultOptions>
-  extends fields.SchemaField.InnerInitializedType<TextureData.Schema<SrcOptions>> {}
-
 declare class TextureData<
   SrcOptions extends FilePathFieldOptions = TextureData.DefaultOptions,
-  SchemaOptions extends fields.SchemaField.Options<TextureData.Schema<SrcOptions>> = {},
+  SchemaOptions extends fields.SchemaField.Options<TextureData.Schema<SrcOptions>> = EmptyObject,
 > extends fields.SchemaField<TextureData.Schema<SrcOptions>, SchemaOptions> {
   constructor(options?: SchemaOptions, srcOptions?: SrcOptions);
 }
@@ -305,8 +298,6 @@ declare namespace PrototypeToken {
   type ConstructorData = fields.SchemaField.InnerAssignmentType<Schema>;
 }
 
-interface PrototypeToken extends fields.SchemaField.InnerInitializedType<PrototypeToken.Schema> {}
-
 declare class PrototypeToken extends DataModel<PrototypeToken.Schema, documents.BaseActor> {
   constructor(data?: PrototypeToken.ConstructorData, options?: DataModel.ConstructorOptions);
 
@@ -323,10 +314,10 @@ declare class PrototypeToken extends DataModel<PrototypeToken.Schema, documents.
 
   static get database(): DatabaseBackend;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -334,7 +325,7 @@ declare class PrototypeToken extends DataModel<PrototypeToken.Schema, documents.
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 
   /**
    * @see foundry.abstract.Document#update
@@ -396,8 +387,6 @@ declare namespace TombstoneData {
   }
 }
 
-interface TombstoneData extends fields.SchemaField.InnerInitializedType<TombstoneData.Schema> {}
-
 declare class TombstoneData extends DataModel<TombstoneData.Schema> {
   static defineSchema(): TombstoneData.Schema;
 }
diff --git a/src/foundry/common/data/fields.d.mts b/src/foundry/common/data/fields.d.mts
index c69da8f2b..de946c0f6 100644
--- a/src/foundry/common/data/fields.d.mts
+++ b/src/foundry/common/data/fields.d.mts
@@ -85,7 +85,7 @@ declare global {
     fallback?: boolean;
 
     /** The full source object being evaluated. */
-    source?: object;
+    source?: AnyObject;
 
     /**
      * If true, invalid embedded documents will emit a warning and be placed in
@@ -289,7 +289,10 @@ declare abstract class DataField<
    *          otherwise void.
    * @throws May throw a specific error if the value is not valid
    */
-  protected _validateType(value: InitializedType, options?: DataField.ValidationOptions<DataField.Any>): boolean | void;
+  protected _validateType(
+    value: InitializedType,
+    options?: DataField.ValidationOptions<DataField.Any>,
+  ): boolean | DataModelValidationFailure | void;
 
   /**
    * Certain fields may declare joint data validation criteria.
@@ -299,7 +302,7 @@ declare abstract class DataField<
    * @throws  An error if joint model validation fails
    * @internal
    */
-  protected _validateModel(data: object, options?: object): void; // TODO: Type further.
+  protected _validateModel(data: AnyObject, options?: AnyObject): void; // TODO: Type further.
 
   /**
    * Initialize the original source data into a mutable copy for the DataModel instance.
@@ -311,7 +314,7 @@ declare abstract class DataField<
   initialize(
     value: PersistedType,
     model: DataModel.Any,
-    options: object, // TODO: Type further.
+    options?: AnyObject, // TODO: Type further.
   ): (() => InitializedType | null) | InitializedType;
 
   /**
@@ -330,7 +333,7 @@ declare abstract class DataField<
 
 declare namespace DataField {
   /** The type of the default options for the {@link DataField} class. */
-  type DefaultOptions = {
+  interface DefaultOptions {
     required: false;
     nullable: false;
     initial: undefined;
@@ -338,7 +341,7 @@ declare namespace DataField {
     label: "";
     hint: "";
     validationError: "is not a valid value";
-  };
+  }
 
   /**
    * A helper type for the given options type merged into the default options of the DataField class.
@@ -405,7 +408,7 @@ declare namespace DataField {
   type InitializedType<Options extends DataFieldOptions.Any> = DerivedInitializedType<any, MergedOptions<Options>>;
 
   /** An interface for the options of the {@link DataField} clean functions. */
-  interface CleanOptions {
+  export interface CleanOptions {
     /** Whether to perform partial cleaning? */
     partial?: boolean;
 
@@ -419,8 +422,8 @@ declare namespace DataField {
    * An interface for the options of the {@link DataField} validation functions.
    * @typeParam DataField - the type of the DataField, which is the receiver of the validate function
    */
-  interface ValidationOptions<DataField extends DataField.Any> extends DataValidationOptions {
-    source?: object;
+  export interface ValidationOptions<DataField extends DataField.Any> extends DataValidationOptions {
+    source?: AnyObject;
     validate?: (this: DataField, value: unknown, options: ValidationOptions<DataField>) => boolean;
   }
 }
@@ -444,7 +447,7 @@ declare class SchemaField<
   Options extends SchemaField.Options<Fields> = SchemaField.DefaultOptions,
   AssignmentType = SchemaField.AssignmentType<Fields, SimpleMerge<Options, SchemaField.DefaultOptions>>,
   InitializedType = SchemaField.InitializedType<Fields, SimpleMerge<Options, SchemaField.DefaultOptions>>,
-  PersistedType extends object | null | undefined = SchemaField.PersistedType<
+  PersistedType extends AnyObject | null | undefined = SchemaField.PersistedType<
     Fields,
     SimpleMerge<Options, SchemaField.DefaultOptions>
   >,
@@ -529,14 +532,18 @@ declare class SchemaField<
 
   protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
-  protected override _validateModel(data: object, options?: object): void;
+  protected override _validateModel(data: AnyObject, options?: AnyObject): void;
 
   override toObject(value: InitializedType): PersistedType;
 
@@ -551,7 +558,7 @@ declare class SchemaField<
    * @param sourceData - Candidate source data of the root model
    * @param fieldData  - The value of this field within the source data
    */
-  migrateSource(sourceData: object, fieldData: unknown): unknown;
+  migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
 }
 
 declare namespace SchemaField {
@@ -579,7 +586,7 @@ declare namespace SchemaField {
       ? Fields[Key] extends SchemaField<infer SubSchema, any, any, any, any>
         ? // FIXME(LukeAbby): This is a quick hack into InnerAssignmentType that assumes that the `initial` of `SchemaField` is not changed from the default of `{}`
           // This will be fixed with the refactoring of the types
-          {} extends InnerAssignmentType<SubSchema>
+          EmptyObject extends InnerAssignmentType<SubSchema>
           ? InnerAssignmentType<SubSchema> | undefined | null
           : InnerAssignmentType<SubSchema>
         : AssignType
@@ -698,7 +705,7 @@ declare class BooleanField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace BooleanField {
@@ -853,7 +860,7 @@ declare class NumberField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
   /**
    * Test whether a provided value is a valid choice from the allowed choice set
@@ -1003,7 +1010,7 @@ declare class StringField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
   /**
    * Test whether a provided value is a valid choice from the allowed choice set
@@ -1098,10 +1105,10 @@ declare namespace StringField {
  * InitialValue: `{}`
  */
 declare class ObjectField<
-  const Options extends DataFieldOptions<object> = ObjectField.DefaultOptions,
+  const Options extends DataFieldOptions<AnyObject> = ObjectField.DefaultOptions,
   const AssignmentType = ObjectField.AssignmentType<Options>,
   const InitializedType = ObjectField.InitializedType<Options>,
-  const PersistedType extends object | null | undefined = ObjectField.InitializedType<Options>,
+  const PersistedType extends AnyObject | null | undefined = ObjectField.InitializedType<Options>,
 > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
   /** @defaultValue `true` */
   override required: boolean;
@@ -1112,18 +1119,22 @@ declare class ObjectField<
   /** @defaultValue `() => ({})` */
   override initial: DataFieldOptions.InitialType<InitializedType>;
 
-  protected static override get _defaults(): DataFieldOptions<object>;
+  protected static override get _defaults(): DataFieldOptions<AnyObject>;
 
   protected override _cast(value: AssignmentType): InitializedType;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace ObjectField {
@@ -1133,7 +1144,7 @@ declare namespace ObjectField {
     {
       required: true;
       nullable: false;
-      initial: () => object;
+      initial: () => AnyObject;
     }
   >;
 
@@ -1141,14 +1152,14 @@ declare namespace ObjectField {
    * A helper type for the given options type merged into the default options of the ObjectField class.
    * @typeParam Options - the options that override the default options
    */
-  type MergedOptions<Options extends DataFieldOptions<object>> = SimpleMerge<DefaultOptions, Options>;
+  type MergedOptions<Options extends DataFieldOptions<AnyObject>> = SimpleMerge<DefaultOptions, Options>;
 
   /**
    * A shorthand for the assignment type of a ObjectField class.
    * @typeParam Options - the options that override the default options
    */
-  type AssignmentType<Options extends DataFieldOptions<object>> = DataField.DerivedAssignmentType<
-    object,
+  type AssignmentType<Options extends DataFieldOptions<AnyObject>> = DataField.DerivedAssignmentType<
+    AnyObject,
     MergedOptions<Options>
   >;
 
@@ -1156,8 +1167,8 @@ declare namespace ObjectField {
    * A shorthand for the initialized type of a ObjectField class.
    * @typeParam Options - the options that override the default options
    */
-  type InitializedType<Options extends DataFieldOptions<object>> = DataField.DerivedInitializedType<
-    object,
+  type InitializedType<Options extends DataFieldOptions<AnyObject>> = DataField.DerivedInitializedType<
+    AnyObject,
     MergedOptions<Options>
   >;
 
@@ -1169,8 +1180,8 @@ declare namespace ObjectField {
    */
   type FlagsField<
     Key extends string,
-    ExtensionFlags extends object = {},
-    Options extends DataFieldOptions.Any = {},
+    ExtensionFlags extends AnyObject = EmptyObject,
+    Options extends DataFieldOptions.Any = EmptyObject,
   > = ObjectField<
     Options,
     DataField.DerivedAssignmentType<ConfiguredFlags<Key> & ExtensionFlags, MergedOptions<Options>>,
@@ -1245,7 +1256,7 @@ declare class ArrayField<
    */
   protected static _validateElementType<T extends DataField.Any>(element: T): T;
 
-  protected override _validateModel(data: object, options?: object): void;
+  protected override _validateModel(data: AnyObject, options?: AnyObject): void;
 
   protected override _cast(value: AssignmentType): InitializedType;
 
@@ -1254,7 +1265,7 @@ declare class ArrayField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
   /**
    * Validate every element of the ArrayField
@@ -1278,7 +1289,11 @@ declare class ArrayField<
     options: DataField.ValidationOptions<DataField.Any>,
   ): DataModelValidationFailure | void;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 
@@ -1296,7 +1311,7 @@ declare class ArrayField<
    * @param sourceData - Candidate source data of the root model
    * @param fieldData  - The value of this field within the source data
    */
-  migrateSource(sourceData: object, fieldData: unknown): unknown;
+  migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
 }
 
 declare namespace ArrayField {
@@ -1456,7 +1471,11 @@ declare class SetField<
     options?: DataField.ValidationOptions<DataField.Any>,
   ): void | DataModelValidationFailure;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 }
@@ -1550,7 +1569,7 @@ declare class EmbeddedDataField<
   const Options extends EmbeddedDataField.Options<ModelType> = EmbeddedDataField.DefaultOptions,
   const AssignmentType = EmbeddedDataField.AssignmentType<ModelType, Options>,
   const InitializedType = EmbeddedDataField.InitializedType<ModelType, Options>,
-  const PersistedType extends object | null | undefined = EmbeddedDataField.PersistedType<ModelType, Options>,
+  const PersistedType extends AnyObject | null | undefined = EmbeddedDataField.PersistedType<ModelType, Options>,
 > extends SchemaField<DataModel.SchemaFor<ModelType>, Options, AssignmentType, InitializedType, PersistedType> {
   /**
    * @param model   - The class of DataModel which should be embedded in this field
@@ -1565,7 +1584,11 @@ declare class EmbeddedDataField<
 
   protected override _initialize(fields: DataSchema): DataSchema;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 
@@ -1574,9 +1597,9 @@ declare class EmbeddedDataField<
    * @param sourceData - Candidate source data of the root model
    * @param fieldData  - The value of this field within the source data
    */
-  migrateSource(sourceData: object, fieldData: unknown): unknown;
+  migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
 
-  protected override _validateModel(data: object, options?: object): void;
+  protected override _validateModel(data: AnyObject, options?: AnyObject): void;
 }
 
 declare namespace EmbeddedDataField {
@@ -1726,7 +1749,11 @@ declare class EmbeddedCollectionField<
     options?: DataField.ValidationOptions<DataField.Any>,
   ): DataModelValidationFailure | void;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 
@@ -1741,7 +1768,7 @@ declare class EmbeddedCollectionField<
    * @param sourceData - Candidate source data of the root model
    * @param fieldData  - The value of this field within the source data
    */
-  migrateSource(sourceData: object, fieldData: unknown): unknown;
+  migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
 
   /**
    * Return the embedded document(s) as a Collection.
@@ -2014,7 +2041,7 @@ declare class EmbeddedDocumentField<
   const Options extends EmbeddedDocumentField.Options<DocumentType> = EmbeddedDocumentField.DefaultOptions,
   const AssignmentType = EmbeddedDocumentField.AssignmentType<DocumentType, Options>,
   const InitializedType = EmbeddedDocumentField.InitializedType<DocumentType, Options>,
-  const PersistedType extends object | null | undefined = EmbeddedDocumentField.PersistedType<DocumentType, Options>,
+  const PersistedType extends AnyObject | null | undefined = EmbeddedDocumentField.PersistedType<DocumentType, Options>,
 > extends EmbeddedDataField<DocumentType, Options, AssignmentType, InitializedType, PersistedType> {
   /**
    * @param model   - The type of Document which is embedded.
@@ -2030,7 +2057,11 @@ declare class EmbeddedDocumentField<
   /** @defaultValue `true` */
   static override hierarchical: boolean;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   /**
    * Return the embedded document(s) as a Collection.
@@ -2151,7 +2182,7 @@ declare class DocumentIdField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace DocumentIdField {
@@ -2239,7 +2270,11 @@ declare class ForeignDocumentField<
 
   protected override _cast(value: AssignmentType): InitializedType;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 }
@@ -2331,7 +2366,7 @@ declare class ColorField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace ColorField {
@@ -2454,7 +2489,7 @@ declare class FilePathField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace FilePathField {
@@ -2692,8 +2727,8 @@ declare class DocumentOwnershipField<
 
   protected override _validateType(
     value: InitializedType,
-    options?: DataField.ValidationOptions<DataField.Any> | undefined,
-  ): boolean | void;
+    options?: DataField.ValidationOptions<DataField.Any>,
+  ): boolean | DataModelValidationFailure | void;
 }
 
 declare namespace DocumentOwnershipField {
@@ -2769,9 +2804,13 @@ declare class JSONField<
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   override toObject(value: InitializedType): PersistedType;
 }
@@ -2807,7 +2846,7 @@ declare namespace JSONField {
    * @typeParam Options - the options that override the default options
    */
   type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
-    object,
+    AnyObject,
     MergedOptions<Options>
   >;
 
@@ -2994,7 +3033,7 @@ declare class DocumentStatsField<
   Options extends DocumentStatsField.Options = DocumentStatsField.DefaultOptions,
   AssignmentType = DocumentStatsField.AssignmentType<Options>,
   InitializedType = DocumentStatsField.InitializedType<Options>,
-  PersistedType extends object | null | undefined = DocumentStatsField.PersistedType<Options>,
+  PersistedType extends AnyObject | null | undefined = DocumentStatsField.PersistedType<Options>,
 > extends SchemaField<DocumentStatsField.Schema, Options, AssignmentType, InitializedType, PersistedType> {
   constructor(options?: Options);
 }
@@ -3101,7 +3140,7 @@ declare class TypeDataField<
   const Options extends TypeDataField.Options<InstanceType<SystemDocument>> = TypeDataField.DefaultOptions,
   const AssignmentType = TypeDataField.AssignmentType<SystemDocument, Options>,
   const InitializedType = TypeDataField.InitializedType<SystemDocument, Options>,
-  const PersistedType extends object | null | undefined = TypeDataField.PersistedType<SystemDocument, Options>,
+  const PersistedType extends AnyObject | null | undefined = TypeDataField.PersistedType<SystemDocument, Options>,
 > extends ObjectField<Options, AssignmentType, InitializedType, PersistedType> {
   /**
    * @param document - The base document class which belongs in this field
@@ -3144,14 +3183,18 @@ declare class TypeDataField<
 
   protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
 
-  override initialize(value: PersistedType, model: DataModel.Any): InitializedType | (() => InitializedType | null);
+  override initialize(
+    value: PersistedType,
+    model: DataModel.Any,
+    options?: AnyObject,
+  ): InitializedType | (() => InitializedType | null);
 
   protected override _validateType(
     value: InitializedType,
     options?: DataField.ValidationOptions<DataField.Any>,
-  ): boolean | void;
+  ): boolean | DataModelValidationFailure | void;
 
-  protected override _validateModel(data: object, options?: object): void;
+  protected override _validateModel(data: AnyObject, options?: AnyObject): void;
 
   override toObject(value: InitializedType): PersistedType;
 
@@ -3160,7 +3203,7 @@ declare class TypeDataField<
    * @param sourceData - Candidate source data of the root model
    * @param fieldData  - The value of this field within the source data
    */
-  migrateSource(sourceData: object, fieldData: unknown): unknown;
+  migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
 }
 
 declare namespace TypeDataField {
@@ -3197,7 +3240,7 @@ declare namespace TypeDataField {
   type Config<DocumentType extends Document.SystemConstructor> =
     DocumentType["metadata"]["name"] extends keyof DataModelConfig
       ? DataModelConfig[DocumentType["metadata"]["name"]]
-      : {};
+      : EmptyObject;
 
   /**
    * Get the configured core and system type names for a specific document type.
@@ -3230,7 +3273,7 @@ declare namespace TypeDataField {
   type AssignmentType<
     SystemDocumentConstructor extends Document.SystemConstructor,
     Opts extends Options<InstanceType<SystemDocumentConstructor>>,
-  > = DataField.DerivedAssignmentType<object, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
+  > = DataField.DerivedAssignmentType<AnyObject, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
 
   /**
    * A shorthand for the initialized type of a TypeDataField class.
@@ -3241,7 +3284,7 @@ declare namespace TypeDataField {
     SystemDocumentConstructor extends Document.SystemConstructor,
     Opts extends Options<InstanceType<SystemDocumentConstructor>>,
   > = DataField.DerivedInitializedType<
-    ValueOf<Config<SystemDocumentConstructor>> | object,
+    ValueOf<Config<SystemDocumentConstructor>> | AnyObject,
     MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>
   >;
 
@@ -3253,7 +3296,7 @@ declare namespace TypeDataField {
   type PersistedType<
     SystemDocumentConstructor extends Document.SystemConstructor,
     Opts extends Options<InstanceType<SystemDocumentConstructor>>,
-  > = DataField.DerivedInitializedType<object, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
+  > = DataField.DerivedInitializedType<AnyObject, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
 }
 
 /**
diff --git a/src/foundry/common/data/module.d.mts b/src/foundry/common/data/module.d.mts
index dc42ea93e..6d9e67cba 100644
--- a/src/foundry/common/data/module.d.mts
+++ b/src/foundry/common/data/module.d.mts
@@ -1,4 +1,9 @@
-export * as validators from "./validators.mts";
-export * as validation from "./validation-failure.mts";
-export * as fields from "./fields.mts";
-export * from "./data.mts";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+export * as validators from "./validators.mjs";
+export * as validation from "./validation-failure.mjs";
+export * as fields from "./fields.mjs";
+export * from "./data.mjs";
diff --git a/src/foundry/common/data/validation-failure.d.mts b/src/foundry/common/data/validation-failure.d.mts
index 4c2770523..529cd7cbf 100644
--- a/src/foundry/common/data/validation-failure.d.mts
+++ b/src/foundry/common/data/validation-failure.d.mts
@@ -1,8 +1,10 @@
+import type { InexactPartial } from "../../../types/utils.d.mts";
+
 /**
  * A class responsible for recording information about a validation failure.
  */
 export class DataModelValidationFailure {
-  constructor(options: DataModelValidationFailure.ConstructorArgs);
+  constructor(options?: InexactPartial<DataModelValidationFailure.ConstructorArgs>);
   /**
    * The value that failed validation for this field.
    */
@@ -73,7 +75,7 @@ export class DataModelValidationError extends Error {
    * @param failure - The failure that triggered this error or an error message
    * @param params  - Additional Error constructor parameters
    */
-  constructor(failure: DataModelValidationFailure | string, ...params: ConstructorParameters<ErrorConstructor>);
+  constructor(failure: DataModelValidationFailure | string, options?: { cause?: Error | string });
 
   /**
    * Retrieve the root failure that caused this error, or a specific sub-failure via a path.
@@ -129,38 +131,38 @@ export class DataModelValidationError extends Error {
 }
 
 declare namespace DataModelValidationFailure {
-  type ConstructorArgs = {
+  interface ConstructorArgs {
     /** The value that failed validation for this field. */
-    invalidValue?: any;
+    invalidValue: unknown;
     /**  The value it was replaced by, if any. */
-    fallback?: any;
+    fallback: unknown;
     /**
      * Whether the value was dropped from some parent collection.
      * @defaultValue `false`
      */
-    dropped?: boolean;
+    dropped: boolean;
     /** The validation error message. */
-    message?: string;
+    message: string;
     /**
      * Whether this failure was unresolved
      * @defaultValue `false`
      */
-    unresolved?: boolean;
-  };
+    unresolved: boolean;
+  }
 
-  type ElementValidationFailure = {
+  interface ElementValidationFailure {
     /** Either the element's index or some other identifier for it. */
     id: string | number;
     /** Optionally a user-friendly name for the element. */
     name?: string;
     /** The element's validation failure. */
     failure: DataModelValidationFailure;
-  };
+  }
 
-  type ObjectProperties = {
+  interface ObjectProperties {
     invalidValue?: any;
     fallback?: any;
     dropped?: boolean;
     message?: string;
-  };
+  }
 }
diff --git a/src/foundry/common/documents/active-effect.d.mts b/src/foundry/common/documents/active-effect.d.mts
index fc35311f3..ed693d4fd 100644
--- a/src/foundry/common/documents/active-effect.d.mts
+++ b/src/foundry/common/documents/active-effect.d.mts
@@ -28,7 +28,7 @@ declare class BaseActiveEffect extends Document<
    */
   constructor(data?: BaseActiveEffect.ConstructorData, context?: DocumentConstructionContext);
 
-  override canUserModify(user: documents.BaseUser, action: "create" | "update" | "delete", data?: object): boolean;
+  override canUserModify(user: documents.BaseUser, action: "create" | "update" | "delete", data?: AnyObject): boolean;
 
   static override metadata: Readonly<BaseActiveEffect.Metadata>;
 
@@ -47,14 +47,14 @@ declare class BaseActiveEffect extends Document<
   ): boolean;
 
   protected override _preCreate(
-    data: fields.SchemaField.AssignmentType<BaseActiveEffect.Schema, {}>,
+    data: fields.SchemaField.AssignmentType<BaseActiveEffect.Schema, EmptyObject>,
     options: DocumentModificationOptions,
     user: documents.BaseUser,
   ): Promise<void>;
 
   protected override _initialize(options?: any): void;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   /**
    * @deprecated since v11, will be removed in v13
diff --git a/src/foundry/common/documents/actor-delta.d.mts b/src/foundry/common/documents/actor-delta.d.mts
index f35c52864..677580be5 100644
--- a/src/foundry/common/documents/actor-delta.d.mts
+++ b/src/foundry/common/documents/actor-delta.d.mts
@@ -27,7 +27,7 @@ declare class BaseActorDelta extends Document<
 
   static override defineSchema(): BaseActorDelta.Schema;
 
-  override canUserModify(user: documents.BaseUser, action: "create" | "update" | "delete", data?: object): boolean;
+  override canUserModify(user: documents.BaseUser, action: "create" | "update" | "delete", data?: AnyObject): boolean;
 
   override testUserPermission(
     user: documents.BaseUser,
diff --git a/src/foundry/common/documents/actor.d.mts b/src/foundry/common/documents/actor.d.mts
index 6bfbd3fe7..6364c35aa 100644
--- a/src/foundry/common/documents/actor.d.mts
+++ b/src/foundry/common/documents/actor.d.mts
@@ -184,21 +184,21 @@ declare class BaseActor extends Document<BaseActor.Schema, BaseActor.Metadata> {
   static #canUpdate(user: documents.BaseUser, doc: BaseActor, data: BaseActor.UpdateData): boolean;
 
   protected override _preCreate(
-    data: fields.SchemaField.AssignmentType<documents.BaseActor.Schema, {}>,
+    data: fields.SchemaField.AssignmentType<documents.BaseActor.Schema, EmptyObject>,
     options: DocumentModificationOptions,
     user: documents.BaseUser,
   ): Promise<void>;
 
   protected override _preUpdate(
-    changed: fields.SchemaField.AssignmentType<documents.BaseActor.Schema, {}>,
+    changed: fields.SchemaField.AssignmentType<documents.BaseActor.Schema, EmptyObject>,
     options: DocumentModificationOptions,
     user: documents.BaseUser,
   ): Promise<void>;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -206,7 +206,7 @@ declare class BaseActor extends Document<BaseActor.Schema, BaseActor.Metadata> {
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 
 export default BaseActor;
diff --git a/src/foundry/common/documents/adventure.d.mts b/src/foundry/common/documents/adventure.d.mts
index 0ea1621c0..c033519ce 100644
--- a/src/foundry/common/documents/adventure.d.mts
+++ b/src/foundry/common/documents/adventure.d.mts
@@ -47,7 +47,7 @@ declare class BaseAdventure extends Document<BaseAdventure.Schema, BaseAdventure
     },
   ): foundry.abstract.DataModel<Schema, DataModel.Any | null>;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 }
 export default BaseAdventure;
 
diff --git a/src/foundry/common/documents/ambient-light.d.mts b/src/foundry/common/documents/ambient-light.d.mts
index a37b0d706..d428a7e0f 100644
--- a/src/foundry/common/documents/ambient-light.d.mts
+++ b/src/foundry/common/documents/ambient-light.d.mts
@@ -27,7 +27,7 @@ declare class BaseAmbientLight extends Document<
 
   static override defineSchema(): BaseAmbientLight.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 }
 export default BaseAmbientLight;
 
diff --git a/src/foundry/common/documents/ambient-sound.d.mts b/src/foundry/common/documents/ambient-sound.d.mts
index 518cd429b..3c4885980 100644
--- a/src/foundry/common/documents/ambient-sound.d.mts
+++ b/src/foundry/common/documents/ambient-sound.d.mts
@@ -26,7 +26,7 @@ declare class BaseAmbientSound extends Document<
 
   static override defineSchema(): BaseAmbientSound.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 }
 export default BaseAmbientSound;
 
diff --git a/src/foundry/common/documents/card.d.mts b/src/foundry/common/documents/card.d.mts
index 5151986af..dd077ab1b 100644
--- a/src/foundry/common/documents/card.d.mts
+++ b/src/foundry/common/documents/card.d.mts
@@ -61,10 +61,10 @@ declare class BaseCard extends Document<BaseCard.Schema, BaseCard.Metadata, Card
     }>,
   ): boolean;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -72,7 +72,7 @@ declare class BaseCard extends Document<BaseCard.Schema, BaseCard.Metadata, Card
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseCard;
 
diff --git a/src/foundry/common/documents/cards.d.mts b/src/foundry/common/documents/cards.d.mts
index f0a854de7..d6d8377ef 100644
--- a/src/foundry/common/documents/cards.d.mts
+++ b/src/foundry/common/documents/cards.d.mts
@@ -36,10 +36,10 @@ declare class BaseCards extends Document<BaseCards.Schema, BaseCards.Metadata> {
    */
   static get TYPES(): BaseCards.TypeNames[];
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -47,7 +47,7 @@ declare class BaseCards extends Document<BaseCards.Schema, BaseCards.Metadata> {
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseCards;
 
diff --git a/src/foundry/common/documents/chat-message.d.mts b/src/foundry/common/documents/chat-message.d.mts
index a27b59523..b75578627 100644
--- a/src/foundry/common/documents/chat-message.d.mts
+++ b/src/foundry/common/documents/chat-message.d.mts
@@ -50,10 +50,10 @@ declare class BaseChatMessage extends Document<BaseChatMessage.Schema, BaseChatM
    */
   static #validateRoll(rollJSON: string): void;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -61,7 +61,7 @@ declare class BaseChatMessage extends Document<BaseChatMessage.Schema, BaseChatM
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseChatMessage;
 
diff --git a/src/foundry/common/documents/drawing.d.mts b/src/foundry/common/documents/drawing.d.mts
index ed84508f5..6913dd501 100644
--- a/src/foundry/common/documents/drawing.d.mts
+++ b/src/foundry/common/documents/drawing.d.mts
@@ -50,12 +50,12 @@ declare class BaseDrawing extends Document<BaseDrawing.Schema, BaseDrawing.Metad
     }>,
   ): boolean;
 
-  static override cleanData(source?: object, options?: fields.DataField.CleanOptions): object;
+  static override cleanData(source?: AnyObject, options?: fields.DataField.CleanOptions): AnyObject;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -63,7 +63,7 @@ declare class BaseDrawing extends Document<BaseDrawing.Schema, BaseDrawing.Metad
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseDrawing;
 
diff --git a/src/foundry/common/documents/fog-exploration.d.mts b/src/foundry/common/documents/fog-exploration.d.mts
index 7b5e1d5aa..080dc7b77 100644
--- a/src/foundry/common/documents/fog-exploration.d.mts
+++ b/src/foundry/common/documents/fog-exploration.d.mts
@@ -26,7 +26,7 @@ declare class BaseFogExploration extends Document<BaseFogExploration.Schema, Bas
   static #canModify(user: documents.BaseUser, doc: BaseFogExploration);
 
   protected override _preUpdate(
-    changed: fields.SchemaField.AssignmentType<documents.BaseFogExploration.Schema, {}>,
+    changed: fields.SchemaField.AssignmentType<documents.BaseFogExploration.Schema, EmptyObject>,
     options: DocumentModificationOptions,
     user: documents.BaseUser,
   ): Promise<void>;
diff --git a/src/foundry/common/documents/folder.d.mts b/src/foundry/common/documents/folder.d.mts
index c33f91dab..e2757624f 100644
--- a/src/foundry/common/documents/folder.d.mts
+++ b/src/foundry/common/documents/folder.d.mts
@@ -31,10 +31,10 @@ declare class BaseFolder extends Document<BaseFolder.Schema, BaseFolder.Metadata
    */
   static SORTING_MODES: ("a" | "m")[];
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -42,7 +42,7 @@ declare class BaseFolder extends Document<BaseFolder.Schema, BaseFolder.Metadata
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 
   // TODO: `Return type annotation circularly references itself.`
   // static override get(documentId: string, options: InexactPartial<{ pack: string }>): Folder.ConfiguredInstance | null;
diff --git a/src/foundry/common/documents/item.d.mts b/src/foundry/common/documents/item.d.mts
index 42dfea2e1..44f8f1899 100644
--- a/src/foundry/common/documents/item.d.mts
+++ b/src/foundry/common/documents/item.d.mts
@@ -44,7 +44,7 @@ declare class BaseItem extends Document<BaseItem.Schema, BaseItem.Metadata, Acto
    */
   static get TYPES(): BaseItem.TypeNames[];
 
-  override canUserModify(user: documents.BaseUser, action: "create" | "delete" | "update", data?: object): boolean;
+  override canUserModify(user: documents.BaseUser, action: "create" | "delete" | "update", data?: AnyObject): boolean;
 
   override testUserPermission(
     user: documents.BaseUser,
@@ -58,10 +58,10 @@ declare class BaseItem extends Document<BaseItem.Schema, BaseItem.Metadata, Acto
     }>,
   ): boolean;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options: {
       /**
        * Apply shims to embedded models?
@@ -69,7 +69,7 @@ declare class BaseItem extends Document<BaseItem.Schema, BaseItem.Metadata, Acto
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseItem;
 
diff --git a/src/foundry/common/documents/journal-entry.d.mts b/src/foundry/common/documents/journal-entry.d.mts
index f6f3d4f8b..ed902e89f 100644
--- a/src/foundry/common/documents/journal-entry.d.mts
+++ b/src/foundry/common/documents/journal-entry.d.mts
@@ -23,10 +23,10 @@ declare class BaseJournalEntry extends Document<BaseJournalEntry.Schema, BaseJou
 
   static override defineSchema(): BaseJournalEntry.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -34,7 +34,7 @@ declare class BaseJournalEntry extends Document<BaseJournalEntry.Schema, BaseJou
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 
   protected override _initializeSource(
     data: this | BaseJournalEntry.UpdateData,
diff --git a/src/foundry/common/documents/macro.d.mts b/src/foundry/common/documents/macro.d.mts
index 83e92a0ee..dfa9b5169 100644
--- a/src/foundry/common/documents/macro.d.mts
+++ b/src/foundry/common/documents/macro.d.mts
@@ -1,9 +1,9 @@
 import type { InexactPartial, Merge } from "../../../types/utils.mts";
 import type Document from "../abstract/document.mts";
 import type { DocumentMetadata, DocumentModificationOptions } from "../abstract/document.mts";
-import * as CONST from "../constants.mts";
-import * as fields from "../data/fields.mts";
-import * as documents from "./module.mts";
+import type * as CONST from "../constants.d.mts";
+import type * as fields from "../data/fields.d.mts";
+import type * as documents from "./module.d.mts";
 
 declare global {
   type MacroData = BaseMacro.Properties;
@@ -42,15 +42,15 @@ declare class BaseMacro extends Document<BaseMacro.Schema, BaseMacro.Metadata> {
   ): boolean;
 
   protected override _preCreate(
-    data: fields.SchemaField.AssignmentType<documents.BaseMacro.Schema, {}>,
+    data: fields.SchemaField.AssignmentType<documents.BaseMacro.Schema, EmptyObject>,
     options: DocumentModificationOptions,
     user: foundry.documents.BaseUser,
   ): Promise<void>;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -58,7 +58,7 @@ declare class BaseMacro extends Document<BaseMacro.Schema, BaseMacro.Metadata> {
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseMacro;
 
diff --git a/src/foundry/common/documents/module.d.mts b/src/foundry/common/documents/module.d.mts
index 0cefd8584..e5bf17ffc 100644
--- a/src/foundry/common/documents/module.d.mts
+++ b/src/foundry/common/documents/module.d.mts
@@ -1,30 +1,35 @@
-export { default as BaseActiveEffect } from "./active-effect.mts";
-export { default as BaseActorDelta } from "./actor-delta.mts";
-export { default as BaseActor } from "./actor.mts";
-export { default as BaseAdventure } from "./adventure.mts";
-export { default as BaseAmbientLight } from "./ambient-light.mts";
-export { default as BaseAmbientSound } from "./ambient-sound.mts";
-export { default as BaseCard } from "./card.mts";
-export { default as BaseCards } from "./cards.mts";
-export { default as BaseChatMessage } from "./chat-message.mts";
-export { default as BaseCombat } from "./combat.mts";
-export { default as BaseCombatant } from "./combatant.mts";
-export { default as BaseDrawing } from "./drawing.mts";
-export { default as BaseFogExploration } from "./fog-exploration.mts";
-export { default as BaseFolder } from "./folder.mts";
-export { default as BaseItem } from "./item.mts";
-export { default as BaseJournalEntry } from "./journal-entry.mts";
-export { default as BaseJournalEntryPage } from "./journal-entry-page.mts";
-export { default as BaseMacro } from "./macro.mts";
-export { default as BaseMeasuredTemplate } from "./measured-template.mts";
-export { default as BaseNote } from "./note.mts";
-export { default as BasePlaylist } from "./playlist.mts";
-export { default as BasePlaylistSound } from "./playlist-sound.mts";
-export { default as BaseRollTable } from "./roll-table.mts";
-export { default as BaseScene } from "./scene.mts";
-export { default as BaseSetting } from "./setting.mts";
-export { default as BaseTableResult } from "./table-result.mts";
-export { default as BaseTile } from "./tile.mts";
-export { default as BaseToken } from "./token.mts";
-export { default as BaseUser } from "./user.mts";
-export { default as BaseWall } from "./wall.mts";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+export { default as BaseActiveEffect } from "./active-effect.mjs";
+export { default as BaseActorDelta } from "./actor-delta.mjs";
+export { default as BaseActor } from "./actor.mjs";
+export { default as BaseAdventure } from "./adventure.mjs";
+export { default as BaseAmbientLight } from "./ambient-light.mjs";
+export { default as BaseAmbientSound } from "./ambient-sound.mjs";
+export { default as BaseCard } from "./card.mjs";
+export { default as BaseCards } from "./cards.mjs";
+export { default as BaseChatMessage } from "./chat-message.mjs";
+export { default as BaseCombat } from "./combat.mjs";
+export { default as BaseCombatant } from "./combatant.mjs";
+export { default as BaseDrawing } from "./drawing.mjs";
+export { default as BaseFogExploration } from "./fog-exploration.mjs";
+export { default as BaseFolder } from "./folder.mjs";
+export { default as BaseItem } from "./item.mjs";
+export { default as BaseJournalEntry } from "./journal-entry.mjs";
+export { default as BaseJournalEntryPage } from "./journal-entry-page.mjs";
+export { default as BaseMacro } from "./macro.mjs";
+export { default as BaseMeasuredTemplate } from "./measured-template.mjs";
+export { default as BaseNote } from "./note.mjs";
+export { default as BasePlaylist } from "./playlist.mjs";
+export { default as BasePlaylistSound } from "./playlist-sound.mjs";
+export { default as BaseRollTable } from "./roll-table.mjs";
+export { default as BaseScene } from "./scene.mjs";
+export { default as BaseSetting } from "./setting.mjs";
+export { default as BaseTableResult } from "./table-result.mjs";
+export { default as BaseTile } from "./tile.mjs";
+export { default as BaseToken } from "./token.mjs";
+export { default as BaseUser } from "./user.mjs";
+export { default as BaseWall } from "./wall.mjs";
diff --git a/src/foundry/common/documents/note.d.mts b/src/foundry/common/documents/note.d.mts
index 6aa144c78..9da40bbe4 100644
--- a/src/foundry/common/documents/note.d.mts
+++ b/src/foundry/common/documents/note.d.mts
@@ -43,10 +43,10 @@ declare class BaseNote extends Document<BaseNote.Schema, BaseNote.Metadata, Scen
     }>,
   ): boolean;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -54,7 +54,7 @@ declare class BaseNote extends Document<BaseNote.Schema, BaseNote.Metadata, Scen
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseNote;
 
diff --git a/src/foundry/common/documents/playlist.d.mts b/src/foundry/common/documents/playlist.d.mts
index ad85577d8..376107dca 100644
--- a/src/foundry/common/documents/playlist.d.mts
+++ b/src/foundry/common/documents/playlist.d.mts
@@ -24,10 +24,10 @@ declare class BasePlaylist extends Document<BasePlaylist.Schema, BasePlaylist.Me
 
   static override defineSchema(): BasePlaylist.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -35,7 +35,7 @@ declare class BasePlaylist extends Document<BasePlaylist.Schema, BasePlaylist.Me
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BasePlaylist;
 
diff --git a/src/foundry/common/documents/roll-table.d.mts b/src/foundry/common/documents/roll-table.d.mts
index c26c9e178..76e2f545d 100644
--- a/src/foundry/common/documents/roll-table.d.mts
+++ b/src/foundry/common/documents/roll-table.d.mts
@@ -28,10 +28,10 @@ declare class BaseRollTable extends Document<BaseRollTable.Schema, BaseRollTable
    */
   static DEFAULT_ICON: "icons/svg/d20-grey.svg";
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -39,7 +39,7 @@ declare class BaseRollTable extends Document<BaseRollTable.Schema, BaseRollTable
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseRollTable;
 
diff --git a/src/foundry/common/documents/scene.d.mts b/src/foundry/common/documents/scene.d.mts
index bf4d6db6d..66f0ab6e0 100644
--- a/src/foundry/common/documents/scene.d.mts
+++ b/src/foundry/common/documents/scene.d.mts
@@ -25,10 +25,10 @@ declare class BaseScene extends Document<BaseScene.Schema, BaseScene.Metadata> {
 
   static override defineSchema(): BaseScene.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -36,7 +36,7 @@ declare class BaseScene extends Document<BaseScene.Schema, BaseScene.Metadata> {
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseScene;
 
diff --git a/src/foundry/common/documents/table-result.d.mts b/src/foundry/common/documents/table-result.d.mts
index bea6c7ca0..48470eaa3 100644
--- a/src/foundry/common/documents/table-result.d.mts
+++ b/src/foundry/common/documents/table-result.d.mts
@@ -40,10 +40,10 @@ declare class BaseTableResult extends Document<
     }>,
   ): boolean;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -51,7 +51,7 @@ declare class BaseTableResult extends Document<
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseTableResult;
 
diff --git a/src/foundry/common/documents/tile.d.mts b/src/foundry/common/documents/tile.d.mts
index f7caf8de9..2f04c188d 100644
--- a/src/foundry/common/documents/tile.d.mts
+++ b/src/foundry/common/documents/tile.d.mts
@@ -28,10 +28,10 @@ declare class BaseTile extends Document<BaseTile.Schema, BaseTile.Metadata, Scen
 
   static override defineSchema(): BaseTile.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -39,7 +39,7 @@ declare class BaseTile extends Document<BaseTile.Schema, BaseTile.Metadata, Scen
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 }
 export default BaseTile;
 
diff --git a/src/foundry/common/documents/token.d.mts b/src/foundry/common/documents/token.d.mts
index 9a71345c7..26890d983 100644
--- a/src/foundry/common/documents/token.d.mts
+++ b/src/foundry/common/documents/token.d.mts
@@ -61,12 +61,12 @@ declare class BaseToken extends Document<BaseToken.Schema, BaseToken.Metadata, S
   updateSource(
     changes?: BaseToken.ConstructorData | undefined,
     options?: { dryRun?: boolean; fallback?: boolean; recursive?: boolean } | undefined,
-  ): object;
+  ): AnyObject;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 
   static override shimData(
-    data: object,
+    data: AnyObject,
     options?: {
       /**
        * Apply shims to embedded models?
@@ -74,7 +74,7 @@ declare class BaseToken extends Document<BaseToken.Schema, BaseToken.Metadata, S
        */
       embedded?: boolean;
     },
-  ): object;
+  ): AnyObject;
 
   //TODO: Update with the Delta conditionality
   toObject(source: true): this["_source"];
@@ -126,7 +126,7 @@ declare namespace BaseToken {
   type Source = fields.SchemaField.InnerPersistedType<Schema>;
 
   // Needed because Omit wasn't working with schemas
-  interface SharedProtoSchema extends DataSchema {
+  export interface SharedProtoSchema extends DataSchema {
     /**
      * The name used to describe the Token
      * @defaultValue `""`
diff --git a/src/foundry/common/documents/user.d.mts b/src/foundry/common/documents/user.d.mts
index a7317f2dd..a779fb4fd 100644
--- a/src/foundry/common/documents/user.d.mts
+++ b/src/foundry/common/documents/user.d.mts
@@ -29,14 +29,14 @@ declare class BaseUser extends Document<BaseUser.Schema, BaseUser.Metadata> {
    * @param bar - The attempted hotbar data
    * @internal
    */
-  static #validateHotbar(bar: object): boolean;
+  static #validateHotbar(bar: AnyObject): boolean;
 
   /**
    * Validate the structure of the User permissions object
    * @param perms - The attempted permissions data
    * @internal
    */
-  static #validatePermissions(perms: object): boolean;
+  static #validatePermissions(perms: AnyObject): boolean;
 
   /**
    * Test whether the User has a GAMEMASTER or ASSISTANT role in this World?
@@ -204,7 +204,7 @@ declare namespace BaseUser {
     hotbar: fields.ObjectField<
       {
         required: true;
-        validate: (bar: object) => boolean;
+        validate: (bar: AnyObject) => boolean;
         validationError: "must be a mapping of slots to macro identifiers";
       },
       Hotbar | null | undefined,
@@ -219,12 +219,12 @@ declare namespace BaseUser {
     permissions: fields.ObjectField<
       {
         required: true;
-        validate: (perms: object) => boolean;
+        validate: (perms: AnyObject) => boolean;
         validationError: "must be a mapping of permission names to booleans";
       },
-      Partial<Permissions> | null | undefined,
-      Partial<Permissions>,
-      Partial<Permissions>
+      InexactPartial<Permissions> | null | undefined,
+      InexactPartial<Permissions>,
+      InexactPartial<Permissions>
     >;
 
     /**
diff --git a/src/foundry/common/documents/wall.d.mts b/src/foundry/common/documents/wall.d.mts
index 5fe371e31..713d38a14 100644
--- a/src/foundry/common/documents/wall.d.mts
+++ b/src/foundry/common/documents/wall.d.mts
@@ -25,7 +25,7 @@ declare class BaseWall extends Document<BaseWall.Schema, BaseWall.Metadata, Scen
 
   static override defineSchema(): BaseWall.Schema;
 
-  static override migrateData(source: object): object;
+  static override migrateData(source: AnyObject): AnyObject;
 }
 export default BaseWall;
 
@@ -49,7 +49,7 @@ declare namespace BaseWall {
   type Properties = fields.SchemaField.InnerInitializedType<Schema>;
   type Source = fields.SchemaField.InnerPersistedType<Schema>;
 
-  interface ThresholdSchema extends DataSchema {
+  export interface ThresholdSchema extends DataSchema {
     /**
      * Minimum distance from a light source for which this wall blocks light
      */
@@ -71,13 +71,13 @@ declare namespace BaseWall {
     attenuation: fields.BooleanField;
   }
 
-  type CoordinateOptions = {
+  interface CoordinateOptions {
     required: true;
     integer: true;
     nullable: false;
     validate: (c: [x0: number, y0: number, x1: number, y1: number]) => boolean;
     validationError: "must be a length-4 array of integer coordinates";
-  };
+  }
 
   interface Schema extends DataSchema {
     /**
diff --git a/src/foundry/common/module.d.mts b/src/foundry/common/module.d.mts
index 03146d95d..173d9f061 100644
--- a/src/foundry/common/module.d.mts
+++ b/src/foundry/common/module.d.mts
@@ -1,42 +1,47 @@
-import * as _abstract from "./abstract/module.mts";
-import * as _config from "./config.mts";
-import * as _CONST from "./constants.mts";
-import * as _data from "./data/module.mts";
-import * as _documents from "./documents/module.mts";
-import * as _packages from "./packages/module";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved` from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+import * as _abstract from "./abstract/module.mjs";
+import * as _config from "./config.mjs";
+import * as _CONST from "./constants.mjs";
+import * as _data from "./data/module.mjs";
+import * as _documents from "./documents/module.mjs";
+import * as _packages from "./packages/module.mjs";
 import "./primitives/module.d.mts";
 import "./types.d.mts";
-import * as _utils from "./utils/module.mts";
+import * as _utils from "./utils/module.mjs";
 
 /**
  * Constant definitions used throughout the Foundry Virtual Tabletop framework.
  */
-export type * as CONST from "./constants.d.mts";
+export * as CONST from "./constants.mjs";
 
 /**
  * Abstract class definitions providing fundamental interfaces used throughout the Foundry Virtual Tabletop framework.
  */
-export type * as abstract from "./abstract/module.d.mts";
+export * as abstract from "./abstract/module.mjs";
 
 /**
  * Data schema definitions providing structure for Documents used throughout the Foundry Virtual Tabletop framework.
  */
-export type * as data from "./data/module.d.mts";
+export * as data from "./data/module.mjs";
 
 /**
  * Document definitions used throughout the Foundry Virtual Tabletop framework.
  */
-export type * as documents from "./documents/module.d.mts";
+export * as documents from "./documents/module.mjs";
 
 /**
  * Package data definitions, validations, and schema
  */
-export type * as packages from "./packages/module";
+export * as packages from "./packages/module.mjs";
 
 /**
  * Utility functions providing helpful functionality.
  */
-export type * as utils from "./utils/module.d.mts";
+export * as utils from "./utils/module.mjs";
 
 declare global {
   namespace foundry {
diff --git a/src/foundry/common/packages/base-module.d.mts b/src/foundry/common/packages/base-module.d.mts
index 15ee08bc5..3b99ccd75 100644
--- a/src/foundry/common/packages/base-module.d.mts
+++ b/src/foundry/common/packages/base-module.d.mts
@@ -1,6 +1,6 @@
 import type BasePackage from "./base-package.d.mts";
-import * as fields from "../data/fields.mjs";
-import type AdditionalTypesField from "./sub-types.mjs";
+import type * as fields from "../data/fields.d.mts";
+import type AdditionalTypesField from "./sub-types.d.mts";
 
 declare namespace BaseModule {
   interface Schema extends ReturnType<typeof BasePackage.defineSchema> {
@@ -27,8 +27,6 @@ declare namespace BaseModule {
   }
 }
 
-interface BaseModule extends fields.SchemaField.InnerInitializedType<BaseModule.Schema> {}
-
 /**
  * The data schema used to define Module manifest files.
  * Extends the basic PackageData schema with some additional module-specific fields.
diff --git a/src/foundry/common/packages/base-package.d.mts b/src/foundry/common/packages/base-package.d.mts
index 166bd6d28..35b76acec 100644
--- a/src/foundry/common/packages/base-package.d.mts
+++ b/src/foundry/common/packages/base-package.d.mts
@@ -1,20 +1,21 @@
 import type { InexactPartial } from "../../../types/utils.d.mts";
-import type DataModel from "../abstract/data.mjs";
+// eslint-disable-next-line import/no-named-as-default
+import type DataModel from "../abstract/data.d.mts";
 import type { ReleaseData } from "../config.d.mts";
-import * as fields from "../data/fields.mjs";
+import type * as fields from "../data/fields.d.mts";
 import type { DataModelValidationFailure } from "../data/validation-failure.d.mts";
 import type { BaseFolder } from "../documents/module.d.mts";
 import type { CONST } from "../module.d.mts";
 import type { LogCompatibilityWarningOptions } from "../utils/logging.d.mts";
 
 declare namespace BasePackage {
-  type optionalString = {
+  interface optionalString {
     required: false;
     blank: false;
     initial: undefined;
-  };
+  }
 
-  type PackageAuthorSchema = {
+  export interface PackageAuthorSchema extends DataSchema {
     /**
      * The author name
      */
@@ -36,9 +37,9 @@ declare namespace BasePackage {
     discord: fields.StringField<optionalString>;
 
     flags: fields.ObjectField;
-  };
+  }
 
-  type PackageMediaSchema = {
+  export interface PackageMediaSchema extends DataSchema {
     type: fields.StringField<optionalString>;
 
     url: fields.StringField<optionalString>;
@@ -50,14 +51,14 @@ declare namespace BasePackage {
     thumbnail: fields.StringField<optionalString>;
 
     flags: fields.ObjectField;
-  };
+  }
 
   type OwnershipRecord = Record<
     keyof typeof foundry.CONST.USER_ROLES,
     keyof typeof foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS | undefined
   >;
 
-  type PackageCompendiumSchema = {
+  export interface PackageCompendiumSchema extends DataSchema {
     /**
      * The canonical compendium name. This should contain no spaces or special characters
      */
@@ -98,9 +99,9 @@ declare namespace BasePackage {
     ownership: CompendiumOwnershipField;
 
     flags: fields.ObjectField;
-  };
+  }
 
-  type PackageLanguageSchema = {
+  export interface PackageLanguageSchema extends DataSchema {
     /**
      * A string language code which is validated by Intl.getCanonicalLocales
      */
@@ -133,9 +134,9 @@ declare namespace BasePackage {
     module: fields.StringField<optionalString>;
 
     flags: fields.ObjectField;
-  };
+  }
 
-  type PackageCompatibilitySchema = {
+  export interface PackageCompatibilitySchema extends DataSchema {
     /**
      * The Package will not function before this version
      */
@@ -150,9 +151,9 @@ declare namespace BasePackage {
      * The Package will not function after this version
      */
     maximum: fields.StringField<{ required: false; blank: false; initial: undefined }>;
-  };
+  }
 
-  type PackageRelationshipsSchema = {
+  export interface PackageRelationshipsSchema extends DataSchema {
     /**
      * Systems that this Package supports
      */
@@ -171,9 +172,10 @@ declare namespace BasePackage {
     conflicts: fields.SetField<RelatedPackage>;
 
     flags: fields.ObjectField;
-  };
+  }
 
-  type RelatedPackageSchema<PackageType extends CONST.PACKAGE_TYPES = CONST.PACKAGE_TYPES> = {
+  export interface RelatedPackageSchema<PackageType extends CONST.PACKAGE_TYPES = CONST.PACKAGE_TYPES>
+    extends DataSchema {
     /**
      * The id of the related package
      */
@@ -198,9 +200,9 @@ declare namespace BasePackage {
      * The reason for this relationship
      */
     reason: fields.StringField<{ required: false; blank: false; initial: undefined }>;
-  };
+  }
 
-  type PackageCompendiumFolderSchemaHelper = {
+  interface PackageCompendiumFolderSchemaHelper {
     name: fields.StringField<{ required: true; blank: false }>;
     sorting: fields.StringField<{
       required: false;
@@ -210,7 +212,7 @@ declare namespace BasePackage {
     }>;
     color: fields.ColorField;
     packs: fields.SetField<fields.StringField<{ required: true; blank: false }>>;
-  };
+  }
 
   // Foundry starts Depth at 1 and increments from there
   type FolderRecursion = [never, 2, 3];
@@ -345,14 +347,14 @@ declare namespace BasePackage {
     persistentStorage: fields.BooleanField;
   }
 
-  type PackageManifestData = {
+  interface PackageManifestData {
     availability: CONST.PACKAGE_AVAILABILITY_CODES;
     locked: boolean;
     exclusive: boolean;
     owned: boolean;
     tags: string[];
     hasStorage: boolean;
-  };
+  }
 }
 
 /**
@@ -455,8 +457,6 @@ export class PackageCompendiumPacks<
   ): void | DataModelValidationFailure;
 }
 
-interface BasePackage extends fields.SchemaField.InnerInitializedType<BasePackage.Schema> {}
-
 /**
  * The data schema used to define a Package manifest.
  * Specific types of packages extend this schema with additional fields.
@@ -532,7 +532,7 @@ declare class BasePackage<
   static defineSchema(): BasePackage.Schema;
 
   static testAvailability(
-    data: Partial<BasePackage.PackageManifestData>,
+    data: InexactPartial<BasePackage.PackageManifestData>,
     options: InexactPartial<{
       /**
        * A specific software release for which to test availability.
@@ -567,7 +567,7 @@ declare class BasePackage<
    */
   static testDependencyCompatibility(compatibility: PackageCompatibility, dependency: BasePackage): boolean;
 
-  static cleanData(source?: object, options?: fields.DataField.CleanOptions): object;
+  static cleanData(source?: AnyObject, options?: fields.DataField.CleanOptions): AnyObject;
 
   /**
    * Validate that a Package ID is allowed.
@@ -594,29 +594,32 @@ declare class BasePackage<
   ): void;
 
   static migrateData(
-    data: object,
+    data: AnyObject,
     logOptions?: InexactPartial<{
       installed: boolean;
     }>,
-  ): object;
+  ): AnyObject;
 
-  protected static _migrateNameToId(data: object, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
+  protected static _migrateNameToId(data: AnyObject, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
 
   protected static _migrateDependenciesNameToId(
-    data: object,
+    data: AnyObject,
     logOptions: Parameters<typeof BasePackage._logWarning>[2],
   ): void;
 
   protected static _migrateToRelationships(
-    data: object,
+    data: AnyObject,
     logOptions: Parameters<typeof BasePackage._logWarning>[2],
   ): void;
 
-  protected static _migrateCompatibility(data: object, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
+  protected static _migrateCompatibility(
+    data: AnyObject,
+    logOptions: Parameters<typeof BasePackage._logWarning>[2],
+  ): void;
 
-  protected static _migrateMediaURL(data: object, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
+  protected static _migrateMediaURL(data: AnyObject, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
 
-  protected static _migrateOwnership(data: object, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
+  protected static _migrateOwnership(data: AnyObject, logOptions: Parameters<typeof BasePackage._logWarning>[2]): void;
 
   /**
    * Retrieve the latest Package manifest from a provided remote location.
diff --git a/src/foundry/common/packages/base-system.d.mts b/src/foundry/common/packages/base-system.d.mts
index b93d387f8..5e31c6df0 100644
--- a/src/foundry/common/packages/base-system.d.mts
+++ b/src/foundry/common/packages/base-system.d.mts
@@ -1,5 +1,5 @@
 import type BasePackage from "./base-package.d.mts";
-import * as fields from "../data/fields.mjs";
+import type * as fields from "../data/fields.d.mts";
 
 declare namespace BaseSystem {
   interface Schema extends ReturnType<typeof BasePackage.defineSchema> {
@@ -41,8 +41,6 @@ declare namespace BaseSystem {
   }
 }
 
-interface BaseSystem extends fields.SchemaField.InnerInitializedType<BaseSystem.Schema> {}
-
 /**
  * The data schema used to define System manifest files.
  * Extends the basic PackageData schema with some additional system-specific fields.
diff --git a/src/foundry/common/packages/base-world.d.mts b/src/foundry/common/packages/base-world.d.mts
index 697eba3ae..aebd1e309 100644
--- a/src/foundry/common/packages/base-world.d.mts
+++ b/src/foundry/common/packages/base-world.d.mts
@@ -1,5 +1,5 @@
 import type BasePackage from "./base-package.d.mts";
-import * as fields from "../data/fields.mjs";
+import type * as fields from "../data/fields.d.mts";
 import type { InexactPartial, Merge } from "../../../types/utils.d.mts";
 import type { ReleaseData } from "../config.d.mts";
 import type { CONST } from "../module.d.mts";
@@ -65,8 +65,6 @@ declare namespace BaseWorld {
   interface Schema extends BaseWorldSchema {}
 }
 
-interface BaseWorld extends fields.SchemaField.InnerInitializedType<BaseWorld.Schema> {}
-
 /**
  * The data schema used to define World manifest files.
  * Extends the basic PackageData schema with some additional world-specific fields.
@@ -82,10 +80,10 @@ declare class BaseWorld extends BasePackage<BaseWorld.Schema> {
    */
   static icon: string;
 
-  static migrateData(data: object): object;
+  static migrateData(data: AnyObject): AnyObject;
 
   static testAvailability(
-    data: Partial<PackageManifestData>,
+    data: InexactPartial<PackageManifestData>,
     options: InexactPartial<{
       /**
        * A specific software release for which to test availability.
diff --git a/src/foundry/common/packages/module.d.ts b/src/foundry/common/packages/module.d.mts
similarity index 63%
rename from src/foundry/common/packages/module.d.ts
rename to src/foundry/common/packages/module.d.mts
index 37b0f3714..8ebb344b0 100644
--- a/src/foundry/common/packages/module.d.ts
+++ b/src/foundry/common/packages/module.d.mts
@@ -1,8 +1,13 @@
-export { default as BasePackage } from "./base-package.mts";
-export { default as BaseWorld } from "./base-world.mts";
-export { default as BaseSystem } from "./base-system.mts";
-export { default as BaseModule } from "./base-module.mts";
-export { PackageCompatibility, RelatedPackage } from "./base-package.mts";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+export { default as BasePackage } from "./base-package.mjs";
+export { default as BaseWorld } from "./base-world.mjs";
+export { default as BaseSystem } from "./base-system.mjs";
+export { default as BaseModule } from "./base-module.mjs";
+export { PackageCompatibility, RelatedPackage } from "./base-package.mjs";
 
 declare global {
   type PackageAuthorData =
diff --git a/src/foundry/common/utils/helpers.d.mts b/src/foundry/common/utils/helpers.d.mts
index 0169c67b1..eb7e62c5c 100644
--- a/src/foundry/common/utils/helpers.d.mts
+++ b/src/foundry/common/utils/helpers.d.mts
@@ -1,6 +1,6 @@
 import type { DocumentType } from "../../../types/helperTypes.d.mts";
 import type { AnyClass, ConstructorOf, DeepPartial, InexactPartial } from "../../../types/utils.d.mts";
-import Document from "../abstract/document.mjs";
+import type Document from "../abstract/document.d.mts";
 
 /**
  * Benchmark the performance of a function, calling it a requested number of iterations.
diff --git a/src/foundry/common/utils/module.d.mts b/src/foundry/common/utils/module.d.mts
index ac10fc337..789c2e473 100644
--- a/src/foundry/common/utils/module.d.mts
+++ b/src/foundry/common/utils/module.d.mts
@@ -1,9 +1,14 @@
-export * from "./geometry.mts";
-export * from "./helpers.mts";
-export * from "./http.mts";
-export * from "./logging.mts";
-export { default as Collection } from "./collection.mts";
-export { default as IterableWeakSet } from "./iterable-weak-set.mts";
-export { default as IterableWeakMap } from "./iterable-weak-map.mts";
-export { default as Color } from "./color.mts";
-export { default as Semaphore } from "./semaphore.mts";
+// In Foundry itself this file contains re-exports of these other modules.
+// Therefore it has a runtime effect and uses `.mjs` instead of `.d.mts`.
+// While `.mts` could work, to avoid `import/no-unresolved` from erroring `.mjs` is used.
+/* eslint-disable import/extensions */
+
+export * from "./geometry.mjs";
+export * from "./helpers.mjs";
+export * from "./http.mjs";
+export * from "./logging.mjs";
+export { default as Collection } from "./collection.mjs";
+export { default as IterableWeakSet } from "./iterable-weak-set.mjs";
+export { default as IterableWeakMap } from "./iterable-weak-map.mjs";
+export { default as Color } from "./color.mjs";
+export { default as Semaphore } from "./semaphore.mjs";
diff --git a/src/foundry/prosemirror/index.d.mts b/src/foundry/prosemirror/index.d.mts
index e47c84155..495d1c415 100644
--- a/src/foundry/prosemirror/index.d.mts
+++ b/src/foundry/prosemirror/index.d.mts
@@ -1,7 +1,7 @@
 import "./click-handler.d.mts";
 import "./content-link-plugin.d.mts";
 import "./dirty-plugin.d.mts";
-import "./dom-parser.mjs";
+import "./dom-parser.d.mts";
 import "./dropdown.d.mts";
 import "./extensions.d.mts";
 import "./highlight-matches-plugin.d.mts";
@@ -12,6 +12,7 @@ import "./menu.d.mts";
 import "./paste-transformer.d.mts";
 import "./plugin.d.mts";
 import type * as ProseMirrorObject from "./prosemirror.d.mts";
+import "./schema/index.d.mts";
 import "./schema.d.mts";
 import "./string-serializer.d.mts";
 import "./util.d.mts";
diff --git a/src/foundry/prosemirror/prosemirror.d.mts b/src/foundry/prosemirror/prosemirror.d.mts
index 79b6ea796..3fda11e1e 100644
--- a/src/foundry/prosemirror/prosemirror.d.mts
+++ b/src/foundry/prosemirror/prosemirror.d.mts
@@ -5,14 +5,17 @@ import type { Plugin, PluginKey } from "prosemirror-state";
 import { AllSelection, TextSelection, EditorState } from "prosemirror-state";
 import { Step } from "prosemirror-transform";
 import { EditorView } from "prosemirror-view";
-import ProseMirrorContentLinkPlugin from "./content-link-plugin.mts";
-import ProseMirrorDirtyPlugin from "./dirty-plugin.mts";
+import type ProseMirrorContentLinkPlugin from "./content-link-plugin.d.mts";
+import type ProseMirrorDirtyPlugin from "./dirty-plugin.d.mts";
 import "./extensions.d.mts";
-import ProseMirrorImagePlugin from "./image-plugin.mts";
-import ProseMirrorInputRules from "./input-rules.mts";
-import ProseMirrorKeyMaps from "./keymaps.mts";
-import ProseMirrorMenu from "./menu.mts";
-import { schema as defaultSchema } from "./schema.mts";
+import type ProseMirrorImagePlugin from "./image-plugin.d.mts";
+// eslint-disable-next-line import/no-named-as-default
+import type ProseMirrorInputRules from "./input-rules.d.mts";
+// eslint-disable-next-line import/no-named-as-default
+import type ProseMirrorKeyMaps from "./keymaps.d.mts";
+// eslint-disable-next-line import/no-named-as-default
+import type ProseMirrorMenu from "./menu.d.mts";
+import type { schema as defaultSchema } from "./schema.d.mts";
 import type { parseHTMLString, serializeHTMLString } from "./util.d.mts";
 import type ProseMirrorPlugin from "./plugin.d.mts";
 import type ProseMirrorHighlightMatchesPlugin from "./highlight-matches-plugin.d.mts";
diff --git a/src/foundry/prosemirror/schema.d.mts b/src/foundry/prosemirror/schema.d.mts
index 70dbc693c..fc8711ac3 100644
--- a/src/foundry/prosemirror/schema.d.mts
+++ b/src/foundry/prosemirror/schema.d.mts
@@ -1,3 +1,138 @@
-import type { Schema } from "prosemirror-model";
+import type { MarkSpec, NodeSpec, Schema } from "prosemirror-model";
+import type {
+  paragraph,
+  blockquote,
+  hr as horizontal_rule,
+  heading,
+  pre as code_block,
+  br as hard_break,
+} from "./schema/core.d.mts";
+import type {
+  ol as ordered_list,
+  ul as bullet_list,
+  li as list_item,
+  liText as list_item_text,
+} from "./schema/lists.d.mts";
+import type {
+  tableComplex as table_complex,
+  colgroup,
+  col,
+  thead,
+  tbody,
+  tfoot,
+  caption,
+  captionBlock as caption_block,
+  tableRowComplex as table_row_complex,
+  tableCellComplex as table_cell_complex,
+  tableCellComplexBlock as table_cell_complex_block,
+  tableHeaderComplex as table_header_complex,
+  tableHeaderComplexBlock as table_header_complex_block,
+} from "./schema/tables.d.mts";
+import type {
+  details,
+  summary,
+  summaryBlock as summary_block,
+  dl,
+  dt,
+  dd,
+  fieldset,
+  legend,
+  picture,
+  audio,
+  video,
+  track,
+  source,
+  object,
+  figure,
+  figcaption,
+  small,
+  ruby,
+  rp,
+  rt,
+  iframe,
+} from "./schema/other.d.mts";
+import type {
+  superscript,
+  subscript,
+  span,
+  font,
+  em,
+  strong,
+  underline,
+  strikethrough,
+  code,
+} from "./schema/marks.d.mts";
+
+export declare const nodes: {
+  doc: { content: string };
+  text: { content: string };
+  paragraph: typeof paragraph;
+  blockquote: typeof blockquote;
+  secret: NodeSpec | MarkSpec;
+  horizontal_rule: typeof horizontal_rule;
+  heading: typeof heading;
+  code_block: typeof code_block;
+  image_link: NodeSpec | MarkSpec;
+  image: NodeSpec | MarkSpec;
+  hard_break: typeof hard_break;
+
+  ordered_list: typeof ordered_list;
+  bullet_list: typeof bullet_list;
+  list_item: typeof list_item;
+  list_item_text: typeof list_item_text;
+
+  table_complex: typeof table_complex;
+  tbody: typeof tbody;
+  thead: typeof thead;
+  tfoot: typeof tfoot;
+  caption: typeof caption;
+  caption_block: typeof caption_block;
+  colgroup: typeof colgroup;
+  col: typeof col;
+  table_row_complex: typeof table_row_complex;
+  table_cell_complex: typeof table_cell_complex;
+  table_header_complex: typeof table_header_complex;
+  table_cell_complex_block: typeof table_cell_complex_block;
+  table_header_complex_block: typeof table_header_complex_block;
+  table: Record<string, unknown>;
+  table_cell: Record<string, unknown>;
+  table_header: Record<string, unknown>;
+  table_row: Record<string, unknown>;
+
+  details: typeof details;
+  summary: typeof summary;
+  summary_block: typeof summary_block;
+  dl: typeof dl;
+  dt: typeof dt;
+  dd: typeof dd;
+  fieldset: typeof fieldset;
+  legend: typeof legend;
+  picture: typeof picture;
+  audio: typeof audio;
+  video: typeof video;
+  track: typeof track;
+  source: typeof source;
+  object: typeof object;
+  figure: typeof figure;
+  figcaption: typeof figcaption;
+  small: typeof small;
+  ruby: typeof ruby;
+  rp: typeof rp;
+  rt: typeof rt;
+  iframe: typeof iframe;
+};
+
+export declare const marks: {
+  superscript: typeof superscript;
+  subscript: typeof subscript;
+  span: typeof span;
+  font: typeof font;
+  link: NodeSpec | MarkSpec;
+  em: typeof em;
+  strong: typeof strong;
+  underline: typeof underline;
+  strikethrough: typeof strikethrough;
+  code: typeof code;
+};
 
 export declare const schema: Schema;
diff --git a/src/foundry/prosemirror/schema/attribute-capture.d.mts b/src/foundry/prosemirror/schema/attribute-capture.d.mts
new file mode 100644
index 000000000..1bb35dca3
--- /dev/null
+++ b/src/foundry/prosemirror/schema/attribute-capture.d.mts
@@ -0,0 +1,16 @@
+import type { DOMOutputSpec, MarkSpec, NodeSpec } from "prosemirror-model";
+
+export default AttributeCapture;
+/**
+ * A class responsible for injecting attribute capture logic into the ProseMirror schema.
+ */
+declare class AttributeCapture {
+  constructor();
+
+  /**
+   * Augments the schema definition to allow each node or mark to capture all the attributes
+   * on an element and preserve them when re-serialized back into the DOM.
+   * @param spec - The schema specification
+   */
+  attributeCapture(spec: NodeSpec | MarkSpec): DOMOutputSpec;
+}
diff --git a/src/foundry/prosemirror/schema/core.d.mts b/src/foundry/prosemirror/schema/core.d.mts
new file mode 100644
index 000000000..762e023cb
--- /dev/null
+++ b/src/foundry/prosemirror/schema/core.d.mts
@@ -0,0 +1,51 @@
+import { Node } from "prosemirror-model";
+
+export declare const paragraph: {
+  attrs: Record<string, unknown>;
+  managed: Record<string, unknown>;
+  content: string;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: (node: Node) => [string, Record<string, string>, number] | [string, number];
+};
+
+export declare const blockquote: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const hr: {
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
+
+export declare const heading: {
+  attrs: Record<string, unknown>;
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: (node: Node) => [string, number];
+};
+
+export declare const pre: {
+  content: string;
+  marks: string;
+  group: string;
+  code: boolean;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, [string, number]];
+};
+
+export declare const br: {
+  inline: boolean;
+  group: string;
+  selectable: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
diff --git a/src/foundry/prosemirror/schema/image-link-node.d.mts b/src/foundry/prosemirror/schema/image-link-node.d.mts
new file mode 100644
index 000000000..1dab29a3f
--- /dev/null
+++ b/src/foundry/prosemirror/schema/image-link-node.d.mts
@@ -0,0 +1,29 @@
+import { MarkSpec, Node, NodeSpec } from "prosemirror-model";
+import type SchemaDefinition from "./schema-definition.d.mts";
+import { EditorView } from "prosemirror-view";
+
+export default ImageLinkNode;
+
+/**
+ * A class responsible for encapsulating logic around image-link nodes in the ProseMirror schema.
+ */
+declare class ImageLinkNode extends SchemaDefinition {
+  static override tag: "a";
+
+  static override get attrs(): Record<string, unknown>;
+
+  static override getAttrs(el: HTMLLinkElement): boolean | Record<string, unknown>;
+
+  static override toDOM(node: Node): [string, unknown];
+
+  static override make(): NodeSpec | MarkSpec;
+
+  /**
+   * Handle clicking on image links while editing.
+   * @param view  - The ProseMirror editor view.
+   * @param pos   - The position in the ProseMirror document that the click occurred at.
+   * @param event - The click event.
+   * @param node  - The Node instance.
+   */
+  static onClick(view: EditorView, pos: number, event: JQuery.ClickEvent, node: Node): boolean;
+}
diff --git a/src/foundry/prosemirror/schema/image-node.d.mts b/src/foundry/prosemirror/schema/image-node.d.mts
new file mode 100644
index 000000000..100c94c88
--- /dev/null
+++ b/src/foundry/prosemirror/schema/image-node.d.mts
@@ -0,0 +1,19 @@
+import { MarkSpec, Node, NodeSpec } from "prosemirror-model";
+import type SchemaDefinition from "./schema-definition.d.mts";
+
+export default ImageNode;
+
+/**
+ * A class responsible for encapsulating logic around image nodes in the ProseMirror schema.
+ */
+declare class ImageNode extends SchemaDefinition {
+  static override tag: "img[src]";
+
+  static override get attrs(): Record<string, unknown>;
+
+  static override getAttrs(el: HTMLImageElement): boolean | Record<string, unknown>;
+
+  static override toDOM(node: Node): [string, unknown];
+
+  static override make(): NodeSpec | MarkSpec;
+}
diff --git a/src/foundry/prosemirror/schema/index.d.mts b/src/foundry/prosemirror/schema/index.d.mts
new file mode 100644
index 000000000..6537dda25
--- /dev/null
+++ b/src/foundry/prosemirror/schema/index.d.mts
@@ -0,0 +1,12 @@
+import "./attribute-capture.d.mts";
+import "./core.d.mts";
+import "./image-link-node.d.mts";
+import "./image-node.d.mts";
+import "./link-mark.d.mts";
+import "./lists.d.mts";
+import "./marks.d.mts";
+import "./other.d.mts";
+import "./schema-definition.d.mts";
+import "./secret-node.d.mts";
+import "./tables.d.mts";
+import "./utils.d.mts";
diff --git a/src/foundry/prosemirror/schema/link-mark.d.mts b/src/foundry/prosemirror/schema/link-mark.d.mts
new file mode 100644
index 000000000..a5916f9c2
--- /dev/null
+++ b/src/foundry/prosemirror/schema/link-mark.d.mts
@@ -0,0 +1,30 @@
+import { Mark, MarkSpec, Node, NodeSpec } from "prosemirror-model";
+import type SchemaDefinition from "./schema-definition.d.mts";
+import { EditorView } from "prosemirror-view";
+
+export default LinkMark;
+
+/**
+ * A class responsible for encapsulating logic around link marks in the ProseMirror schema.
+ */
+declare class LinkMark extends SchemaDefinition {
+  static override tag: "a";
+
+  static override get attrs(): Record<string, unknown>;
+
+  static override getAttrs(el: HTMLLinkElement): boolean | Record<string, unknown>;
+
+  static override toDOM(node: Node): [string, unknown];
+
+  static override make(): NodeSpec | MarkSpec;
+
+  /**
+   * Handle clicks on link marks while editing.
+   * @param view  - The ProseMirror editor view.
+   * @param pos   - The position in the ProseMirror document that the click occurred at.
+   * @param event - The click event
+   * @param mark  - The Mark instance.
+   * @returns Returns true to indicate the click was handled here and should not be propogated to other plugins.
+   */
+  static onClick(view: EditorView, pos: number, event: JQuery.ClickEvent, mark: Mark): boolean | void;
+}
diff --git a/src/foundry/prosemirror/schema/lists.d.mts b/src/foundry/prosemirror/schema/lists.d.mts
new file mode 100644
index 000000000..9b46b969d
--- /dev/null
+++ b/src/foundry/prosemirror/schema/lists.d.mts
@@ -0,0 +1,55 @@
+export declare const ol: {
+  content: string;
+  managed: Record<string, unknown>;
+  group: string;
+  attrs: Record<string, unknown>;
+  parseDOM: Record<string, unknown>[];
+  toDOM: (node: Node) => [string, number] | [string, Record<string, unknown>, number];
+};
+
+export declare const ul: {
+  content: string;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+/**
+ * ProseMirror enforces a stricter subset of HTML where block and inline content cannot be mixed. For example, the
+ * following is valid HTML:
+ * <ul>
+ *   <li>
+ *     The first list item.
+ *     <ul>
+ *       <li>An embedded list.</li>
+ *     </ul>
+ *   </li>
+ * </ul>
+ *
+ * But, since the contents of the <li> would mix inline content (the text), with block content (the inner <ul>), the
+ * schema is defined to only allow block content, and would transform the items to look like this:
+ * <ul>
+ *   <li>
+ *     <p>The first list item.</p>
+ *     <ul>
+ *       <li><p>An embedded list.</p></li>
+ *     </ul>
+ *   </li>
+ * </ul>
+ *
+ * We can address this by hooking into the DOM parsing and 'tagging' the extra paragraph elements inserted this way so
+ * that when the contents are serialized again, they can be removed. This is left as a TODO for now.
+ */
+export declare const li: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const liText: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
diff --git a/src/foundry/prosemirror/schema/marks.d.mts b/src/foundry/prosemirror/schema/marks.d.mts
new file mode 100644
index 000000000..0848c056f
--- /dev/null
+++ b/src/foundry/prosemirror/schema/marks.d.mts
@@ -0,0 +1,44 @@
+export declare const em: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const strong: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const code: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const underline: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, Record<string, string>, number];
+};
+
+export declare const strikethrough: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const superscript: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const subscript: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const span: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const font: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, Record<string, string>];
+};
diff --git a/src/foundry/prosemirror/schema/other.d.mts b/src/foundry/prosemirror/schema/other.d.mts
new file mode 100644
index 000000000..73fc08308
--- /dev/null
+++ b/src/foundry/prosemirror/schema/other.d.mts
@@ -0,0 +1,149 @@
+export declare const details: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const summary: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const summaryBlock: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const dl: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const dt: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const dd: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const fieldset: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const legend: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const picture: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const audio: {
+  content: string;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const video: {
+  content: string;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const track: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
+
+export declare const source: {
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
+
+export declare const object: {
+  inline: boolean;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
+
+export declare const figure: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const figcaption: {
+  content: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const small: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const ruby: {
+  content: string;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const rp: {
+  content: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const rt: {
+  content: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const iframe: {
+  attrs: Record<string, unknown>;
+  managed: Record<string, unknown>;
+  group: string;
+  defining: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, unknown];
+};
diff --git a/src/foundry/prosemirror/schema/schema-definition.d.mts b/src/foundry/prosemirror/schema/schema-definition.d.mts
new file mode 100644
index 000000000..d9597a4ba
--- /dev/null
+++ b/src/foundry/prosemirror/schema/schema-definition.d.mts
@@ -0,0 +1,39 @@
+import { MarkSpec, Node, NodeSpec } from "prosemirror-model";
+
+export default SchemaDefinition;
+
+/**
+ * An abstract interface for a ProseMirror schema definition
+ */
+declare abstract class SchemaDefinition {
+  /**
+   * The HTML tag selector this node is associated with
+   */
+  static tag: string;
+
+  /**
+   * Schema attributes
+   * @remarks SchemaDefinition subclasses must implement the attrs getter.
+   */
+  static get attrs(): Record<string, unknown>;
+
+  /**
+   * Check if an HTML element is appropriate to represent as this node, and if so, extract its schema attributes.
+   * @param el - The HTML element
+   * @returns Returns false if the HTML element is not appropriate for this schema node, otherwise returns its attributes.
+   * @remarks SchemaDefinition subclasses must implement the getAttrs method.
+   */
+  static getAttrs(el: HTMLElement): Record<string, unknown> | boolean;
+
+  /**
+   * Convert a ProseMirror Node back into an HTML element.
+   * @param node - The ProseMirror node.
+   * @remarks SchemaDefinition subclasses must implement the toDOM method.
+   */
+  static toDOM(node: Node): unknown[];
+
+  /**
+   * Create the ProseMirror schema specification.
+   */
+  static make(): NodeSpec | MarkSpec;
+}
diff --git a/src/foundry/prosemirror/schema/secret-node.d.mts b/src/foundry/prosemirror/schema/secret-node.d.mts
new file mode 100644
index 000000000..65c4ddfa3
--- /dev/null
+++ b/src/foundry/prosemirror/schema/secret-node.d.mts
@@ -0,0 +1,27 @@
+import { MarkSpec, Node, NodeSpec } from "prosemirror-model";
+import type SchemaDefinition from "./schema-definition.d.mts";
+import { EditorState, Transaction } from "prosemirror-state";
+
+export default SecretNode;
+
+/**
+ * A class responsible for encapsulating logic around secret nodes in the ProseMirror schema.
+ */
+declare class SecretNode extends SchemaDefinition {
+  static override tag: "section";
+
+  static override get attrs(): Record<string, unknown>;
+
+  static override getAttrs(el: HTMLElement): boolean | Record<string, unknown>;
+
+  static override toDOM(node: Node): [string, Record<string, unknown>, number];
+
+  static override make(): NodeSpec | MarkSpec;
+
+  /**
+   * Handle slitting a secret block in two, making sure the new block gets a unique ID.
+   * @param state    - The ProseMirror editor state.
+   * @param dispatch - The editor dispatch function.
+   */
+  static split(state: EditorState, dispatch: (tr: Transaction) => void): boolean;
+}
diff --git a/src/foundry/prosemirror/schema/tables.d.mts b/src/foundry/prosemirror/schema/tables.d.mts
new file mode 100644
index 000000000..ffc4468a2
--- /dev/null
+++ b/src/foundry/prosemirror/schema/tables.d.mts
@@ -0,0 +1,106 @@
+import { Node } from "prosemirror-model";
+
+export declare const builtInTableNodes: {
+  table: Record<string, unknown>;
+  table_cell: Record<string, unknown>;
+  table_header: Record<string, unknown>;
+  table_row: Record<string, unknown>;
+};
+
+export declare const tableComplex: {
+  content: string;
+  isolating: boolean;
+  group: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const colgroup: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const col: {
+  tableRole: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string];
+};
+
+export declare const thead: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const tbody: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const tfoot: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const caption: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const captionBlock: {
+  content: string;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const tableRowComplex: {
+  content: string;
+  parseDOM: Record<string, unknown>[];
+  toDOM: () => [string, number];
+};
+
+export declare const tableCellComplex: {
+  content: string;
+  attrs: Record<string, unknown>;
+  managed: Record<string, string[]>;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>;
+  toDOM: (node: Node) => [string, unknown, number];
+};
+
+export declare const tableCellComplexBlock: {
+  content: string;
+  attrs: Record<string, unknown>;
+  managed: Record<string, string[]>;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>;
+  toDOM: (node: Node) => [string, unknown, number];
+};
+
+export declare const tableHeaderComplex: {
+  content: string;
+  attrs: Record<string, unknown>;
+  managed: Record<string, string[]>;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>;
+  toDOM: (node: Node) => [string, unknown, number];
+};
+
+export declare const tableHeaderComplexBlock: {
+  content: string;
+  attrs: Record<string, unknown>;
+  managed: Record<string, string[]>;
+  isolating: boolean;
+  parseDOM: Record<string, unknown>;
+  toDOM: (node: Node) => [string, unknown, number];
+};
diff --git a/src/foundry/prosemirror/schema/utils.d.mts b/src/foundry/prosemirror/schema/utils.d.mts
new file mode 100644
index 000000000..288142ee5
--- /dev/null
+++ b/src/foundry/prosemirror/schema/utils.d.mts
@@ -0,0 +1,37 @@
+/**
+ * Determine if an HTML element contains purely inline content, i.e. only text nodes and 'mark' elements.
+ * @param element - The element.
+ */
+export declare function onlyInlineContent(element: HTMLElement): boolean;
+
+/**
+ * Determine if an HTML element is empty.
+ * @param element - The element.
+ */
+export declare function isElementEmpty(element: HTMLElement): boolean;
+
+/**
+ * Convert an element's style attribute string into an object.
+ * @param str - The style string.
+ */
+export declare function stylesFromString(str: string): Record<string, unknown>;
+
+/**
+ * Merge two style attribute strings.
+ * @param a - The first style string.
+ * @param b - The second style string.
+ */
+export declare function mergeStyle(a: string, b: string): string;
+
+/**
+ * Convert an element's class attribute string into an array of class names.
+ * @param str - The class string
+ */
+export declare function classesFromString(str: string): string[];
+
+/**
+ * Merge two class attribute strings.
+ * @param a - The first class string.
+ * @param b - The second class string.
+ */
+export declare function mergeClass(a: string, b: string): string;
diff --git a/src/types/augments/pixi.d.mts b/src/types/augments/pixi.d.mts
index 1bae606e0..cf8cb57cd 100644
--- a/src/types/augments/pixi.d.mts
+++ b/src/types/augments/pixi.d.mts
@@ -1,8 +1,9 @@
-export * from "pixi.js";
 import * as _PIXI from "pixi.js";
 import * as pixiParticles from "@pixi/particle-emitter";
 import * as graphicsSmooth from "@pixi/graphics-smooth";
 
+export * from "pixi.js";
+
 /**
  * Foundry exports PIXI into the global namespace
  */
diff --git a/src/types/helperTypes.d.mts b/src/types/helperTypes.d.mts
index ce5e5666e..648681a3d 100644
--- a/src/types/helperTypes.d.mts
+++ b/src/types/helperTypes.d.mts
@@ -118,3 +118,70 @@ export type LayerClass<T extends DocumentConstructor> = T["metadata"]["name"] ex
     ? CONFIG[T["metadata"]["name"]]["layerClass"]
     : never
   : T;
+
+export type AnyKey = keyof any;
+
+/**
+ * Prefer this type over `K in keyof T ? T[K] : never`.
+ * This type plays nicely with partial or readonly types and also fixes some variance issues because `keyof` is inherently assumed to be contravariant.
+ */
+export type GetKey<T, K extends AnyKey, D = never> = T extends { readonly [_ in K]?: infer V } ? V : D;
+
+/**
+ * `Partial` is usually the wrong type.
+ * In order to make it easier to audit unintentional uses of `Partial` this type is provided.
+ */
+export type IntentionalPartial<T> = Partial<T>;
+
+/**
+ * This type is used to make a constraint where T must be statically known to .
+ */
+export type OverlapsWith<T, U> = [T & U] extends [never] ? U : T;
+
+/**
+ * Use this whenever a type is given that should match some constraint but is
+ * not guaranteed to. For example when additional properties can be declaration
+ * merged into an interface. When the type does not conform then `ConformTo` is
+ * used instead.
+ *
+ * See `MustConform` for a version that throws a compilation error when the type
+ * cannot be statically known to conform.
+ */
+export type MakeConform<T, ConformTo> = T extends ConformTo ? T : ConformTo;
+
+/**
+ * This is useful when you want to ensure that a type conforms to a certain
+ * constraint. If it is not guaranteed to conform then a compilation error is
+ * thrown. This makes it too conservative in some cases.
+ */
+export type MustConform<T extends ConformTo, ConformTo> = T;
+
+/**
+ * This allows you to treat all interfaces as a plain object. But beware, if the
+ * interface represents a function, array, or constructor then these will be
+ * stripped from the interface.
+ *
+ * This is generally intended for cases where an interface is given in order to
+ * be declaration merged and then must be assigned to a plain object type.
+ *
+ * The constraint `T extends object` is used because `object` includes functions
+ * and arrays etc. This is crucial to allow interfaces to be given to this type.
+ */
+export type InterfaceToObject<T extends object> = {
+  // Mapped types are no-ops on most types (even primitives like string) but for
+  // functions they strip the function signatures and if there's no additional
+  // properties returns `{}`.
+  [K in keyof T]: T[K];
+};
+
+/**
+ * This is a helper type that allows you to ensure that a record conforms to a
+ * certain shape. This is useful when you want to ensure that a record has all
+ * keys of a certain type.
+ *
+ * When a value does not conform it is replaced with `never` to indicate that
+ * there is an issue.
+ */
+export type ConformRecord<T extends object, V> = {
+  [K in keyof T]: [T[K]] extends [V] ? T[K] : never;
+};
diff --git a/src/types/index.d.mts b/src/types/index.d.mts
index 6f73776c4..64efd52ea 100644
--- a/src/types/index.d.mts
+++ b/src/types/index.d.mts
@@ -1,4 +1,4 @@
 import "./augments/index.d.mts";
 import "./config.d.mts";
-import "./configuredDocuments.mts";
+import "./configuredDocuments.d.mts";
 import "./utils.d.mts";
diff --git a/src/types/utils.d.mts b/src/types/utils.d.mts
index 2c5d5f845..f482ced89 100644
--- a/src/types/utils.d.mts
+++ b/src/types/utils.d.mts
@@ -4,9 +4,13 @@ import type { ConfiguredDocumentClass, DocumentConstructor } from "./helperTypes
  * Recursively sets keys of an object to optional. Used primarily for update methods
  * @internal
  */
-export type DeepPartial<T> = {
-  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
-};
+export type DeepPartial<T> = T extends unknown
+  ? IsObject<T> extends true
+    ? {
+        [P in keyof T]?: DeepPartial<T[P]>;
+      }
+    : T
+  : T;
 
 /**
  * Make all properties in T optional and explicitly allow `undefined`
@@ -20,13 +24,13 @@ export type InexactPartial<T> = {
  * Any valid class constructor.
  * @internal
  */
-export type AnyClass = abstract new (...args: any[]) => any;
+export type AnyClass = abstract new (...args: never[]) => any;
 
 /**
  * References the constructor of type `T`
  * @internal
  */
-export type ConstructorOf<T> = new (...args: any) => T;
+export type ConstructorOf<T> = new (...args: never[]) => T;
 
 /**
  * Expand an object that contains keys in dotted notation
@@ -93,16 +97,28 @@ export type Merge<T, U> =
 
 /**
  * Returns whether the type is a plain object. Excludes functions and arrays while still being friendly to interfaces.
+ *
+ * @example
+ * ```ts
+ * interface ObjectInterface {
+ *  prop: number;
+ * }
+ *
+ * type Interface = IsObject<ObjectInterface>; // true
+ * type Object = IsObject<{ prop: number }>; // true
+ * type Array = IsObject<number[]>; // false
+ * type Function = IsObject<() => void>; // false
+ *
+ * // By comparison, simply comparing against `Record<string, unknown>` fails.
+ * type RecordFails = Interface extends Record<string, unknown> ? true : false; // false
+ * ```
  */
-export type IsObject<T> =
-  // `Record<string, any>` can be a function or an array, so we need to exclude those
-  T extends Record<string, any>
-    ? T extends readonly any[]
-      ? false
-      : T extends (...args: any[]) => any
-        ? false
-        : true
-    : false;
+// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
+export type IsObject<T> = T extends { readonly [K: string]: any }
+  ? T extends AnyArray | AnyFunction
+    ? false
+    : true
+  : false;
 
 /**
  * A simple, non-recursive merge type.
@@ -111,12 +127,6 @@ export type IsObject<T> =
  */
 export type SimpleMerge<Target, Override> = Omit<Target, keyof Override> & Override;
 
-/**
- * Instance of `T`, which may or may not be in a promise.
- * @typeParam T - the type which might be wrapped in a promise.
- */
-export type MaybePromise<T> = T | Promise<T>;
-
 export type StoredDocument<D extends { _source: unknown }> = D & {
   id: string;
   _id: string;
@@ -146,11 +156,11 @@ export type Mixin<
   BaseClass extends abstract new (...args: any[]) => any,
 > = MixinClass & BaseClass;
 
-type GetDataConfigOptions<T> = {
+interface GetDataConfigOptions<T> {
   partial: Partial<T> & Record<string, unknown>;
   exact: T;
   object: object;
-};
+}
 
 type GetDataConfigOption = GetDataConfig extends {
   mode: keyof GetDataConfigOptions<unknown> & infer Mode;
@@ -159,3 +169,222 @@ type GetDataConfigOption = GetDataConfig extends {
   : "object";
 
 export type GetDataReturnType<T extends object> = GetDataConfigOptions<T>[GetDataConfigOption];
+
+/**
+ * Replaces the type `{}` with `Record<string, never>` by default which is
+ * usually a better representation of an empty object. The type `{}` actually
+ * allows any type be assigned to it except for `null` and `undefined`.
+ *
+ * The theory behind this is that all non-nullish types allow
+ * you to access any property on them without erroring. Primitive types like
+ * `number` will not store the property but it still will not error to simply
+ * try to get and set properties.
+ *
+ * The type `{}` can appear for example after operations like `Omit` if it
+ * removes all properties rom an object, because an empty interface was given,
+ * or so on.
+ *
+ * @example
+ * ```ts
+ * type ObjectArray<T extends Record<string, unknown>> = T[];
+ *
+ * // As you would hope a union can't be assigned. It errors with:
+ * // "type 'string' is not assignable to type 'Record<string, unknown>'."
+ * type UnionErrors = ObjectArray<string | { x: number }>;
+ *
+ * // However, this works.
+ * type EmptyObjectArray = ObjectArray<{}>;
+ *
+ * // But it allows likely unsound behavior like this:
+ * const emptyObject: EmptyObjectArray = [1, "foo", () => 3];
+ *
+ * // So it may be better to define `ObjectArray` like so:
+ * type ObjectArray<T extends Record<string, unknown>> = HandleEmptyObject<T>[];
+ *
+ * // If it were, then this line would error appropriately!
+ * const emptyObject: EmptyObjectArray = [1, "foo", () => 3];
+ * ```
+ */
+export type HandleEmptyObject<
+  T extends Record<string, unknown>,
+  D extends Record<string, unknown> = Record<string, never>,
+> = [{}] extends [T] ? D : T;
+
+/**
+ * This type allows any plain objects. In other words it disallows functions
+ * and arrays.
+ *
+ * Use this type instead of:
+ * - `object` - This allows functions and arrays.
+ * - `Record<string, any>`/`{}` - These allows anything besides `null` and `undefined`.
+ * - `Record<string, unknown>` - This is the appropriate type for any mutable object but doesn't allow readonly objects.
+ */
+// This type is not meant to be extended and it has to use an indexed type.
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/consistent-indexed-object-style
+export type AnyObject = {
+  readonly [K: string]: unknown;
+};
+
+/**
+ * This type allows mutable plain objects. This means readonly objects cannot be
+ * assigned.
+ *
+ * Use this type instead of:
+ * - `object` - This allows functions and arrays.
+ * - `Record<string, any>`/`{}` - These allows anything besides `null` and `undefined`.
+ * - `Record<string, unknown>` - These types are equivalent
+ */
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/consistent-indexed-object-style
+export type AnyMutableObject = {
+  [K: string]: unknown;
+};
+
+/**
+ * Use this type to allow any array. This allows readonly arrays which is
+ * generally what you want. If you need a mutable array use the
+ * {@link MutableArray} type instead of the builtin `T[]` or `Array` types.
+ * This allows us to be more explicit about intent.
+ *
+ * Consider being more specific if possible. You should generally try to use a
+ * concrete array with a union or add a type parameter first.
+ *
+ * Use this instead of:
+ * - `any[]` - When elements of this array are accessed you get `any` which is not safe.
+ * - `unknown[]` - This is the appropriate type for any mutable array but doesn't allow readonly arrays.
+ */
+export type AnyArray = readonly unknown[];
+
+/**
+ * Use this type to allow a mutable array of type `T`. Only use this if mutation
+ * is sound. Otherwise you should be using `readonly T[]` or `ReadonlyArray<T>`.
+ */
+export type MutableArray<T> = Array<T>;
+
+/**
+ * Use this type to allow any function. Notably since this allows any function
+ * it is difficult to call the function in a safe way. This means its uses are
+ * mostly niche and it should be avoided.
+ *
+ * Make sure you have a good reason to use this type. It is almost always better
+ * to use a more specific function type. Please consider leaving a comment about
+ * why this type is necessary.
+ *
+ * Use this instead of:
+ * - `Function` - This refers to the fundamental `Function` object in JS. It allows classes.
+ * - `(...args: any[]) => any` - If someone explicitly accesses the parameters or return value you get `any` which is not safe.
+ * - `(...args: unknown[]) => unknown` - This allows obviously unsound calls like `fn(1, "foo")` because it indicates it can take any arguments.
+ */
+export type AnyFunction = (...args: never[]) => unknown;
+
+/**
+ * Use this type to allow any class, abstract class, or class-like constructor.
+ *
+ * See {@link AnyConcreteConstructor} if you cannot allow abstract classes. Please
+ * also consider writing a comment explaining why {@link AnyConcreteConstructor}
+ * is necessary.
+ *
+ * @example
+ * ```ts
+ * const concrete: AnyConstructor = class Concrete { ... }
+ * const abstract: AnyConstructor = abstract class Abstract { ... }
+ *
+ * // `Date` is not actually a class but it can be used as a constructor.
+ * const classLike: AnyConstructor = Date;
+ * ```
+ */
+export type AnyConstructor = abstract new (...args: never[]) => unknown;
+
+/**
+ * Use this type to allow any class or class-like constructor but disallow
+ * class-like constructors.
+ *
+ * Use this type only when abstract classes would be problematic such as the
+ * base type of a mixin. Please consider writing a comment explaining why.
+ * See {@link AnyConstructor} to also allow abstract classes.
+ *
+ * @example
+ * ```ts
+ * const concrete: AnyConcreteConstructor = class Concrete { ... }
+ *
+ * // `Date` is not actually a class but it can be used as a constructor.
+ * const classLike: AnyConcreteConstructor = Date;
+ *
+ * // This next line errors:
+ * const abstract: AnyConcreteConstructor = abstract class Abstract { ... }
+ * ```
+ */
+export type AnyConcreteConstructor = new (...args: never[]) => unknown;
+
+/**
+ * This type is equivalent to `Promise<T>` but exists to give an explicit signal
+ * that this is not a mistake. When Foundry accepts an asynchronous callback the
+ * vast majority of the time it is best to use {@link MaybePromise | `MaybePromise`}.
+ *
+ * By doing it this way the maximum flexibility is given to the definer of the
+ * callback. This is okay because typically asynchronous callbacks are simply
+ * awaited, meaning that there's no noticeable difference between a `Promise`
+ * and {@link MaybePromise | `MaybePromise`}. Even functions like
+ * {@link Promise.allSettled | `Promise.allSettled`} function correctly
+ * with {@link MaybePromise | `MaybePromise`}.
+ *
+ * Do not use this type or {@link MaybePromise | `MaybePromise`} for the return
+ * type of asynchronous methods on classes. For example for
+ * {@link foundry.abstract.Document._preCreate | Document#_preCreate} the typing
+ * should be `Promise<void>` and not this type. In theory we could use
+ * {@link MaybePromise | `MaybePromise`} in this context as well but this seems
+ * more likely to be confusing than to be helpful.
+ *
+ * Use this type only in the rare case where a callback's return type must be a
+ * `Promise`, for example if `promise.then` or `promise.catch` is explicitly
+ * called. Please also writing a comment explaining why
+ * {@link MaybePromise | `MaybePromise`} is problematic in this context.
+ */
+export type MustBePromise<T> = Promise<T>;
+
+/**
+ * Use when a type may be either a promise or not. This is most useful in
+ * asynchronous callbacks where in most cases it's sound to provide a synchronous
+ * callback instead.
+ *
+ * If it is not sound to provide a non-Promise for whatever reason, see
+ * {@link MustBePromise | `MaybePromise`} to declare this more explicitly than simply writing
+ * `Promise<T>`.
+ *
+ * This should generally not be used in asynchronous methods. For example in
+ * {@link foundry.abstract.Document._preCreate | `Document#_preCreate`} the typing
+ * is `Promise<void>` because it's declared as an async method. Overriding an
+ * asynchronous method with a synchronous method is more confusing than
+ * helpful.
+ */
+export type MaybePromise<T> = T | Promise<T>;
+
+/**
+ * Use this to allow any type besides `null` or `undefined`.
+ *
+ * This type is equivalent to the type `{}`. It exists to give this type a
+ * better name. `{}` is not a type representing an empty object. In reality it
+ * allows assigning any type besides `null` or `undefined`. This is frustrating
+ * but it seems the theory is supposed to be that all types except for `null`
+ * and `undefined` will return `undefined` for any property accessed on them.
+ *
+ * Even primitives like `number` will not error when you get or even set a
+ * property on them, although they will not preserve the property. Since the
+ * only type that cannot be indexed is `null` or `undefined` this is the chosen
+ * semantics of `{}` in TypeScript.
+ */
+// This type is not meant to be extended and it's meant to be the explicit version of what the type `{}` does, i.e. allow any type besides `null` or `undefined`.
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+export type NonNullish = {};
+
+/**
+ * This is the closest approximation to a type representing an empty object.
+ *
+ * Use instead of `{}` when you want to represent an empty object. `{}` actually
+ * allows any type that is not `null` or `undefined`. see
+ * {@link NonNullish | `NonNullish`} if you want that behavior.
+ */
+// This type is not meant to be extended and it has to use an indexed type.
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/consistent-indexed-object-style
+export type EmptyObject = {
+  [K: string]: never;
+};
diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json
index 1e4015fa7..876e10d21 100644
--- a/tsconfig.eslint.json
+++ b/tsconfig.eslint.json
@@ -1,5 +1,5 @@
 {
   "$schema": "https://json.schemastore.org/tsconfig.json",
   "extends": "./tsconfig.json",
-  "include": ["**/*.js", "**/*.d.mts", "**/*.ts"]
+  "include": ["**/*.js", "**/*.cjs", "**/*.d.mts", "**/*.ts"]
 }
diff --git a/tsconfig.json b/tsconfig.json
index 2e0ff1170..90607dc95 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -9,9 +9,10 @@
     "module": "ES2022",
     "moduleResolution": "Bundler",
     "noEmit": true,
+    "noImplicitOverride": true,
     "strict": true,
     "target": "ES2021",
-    "verbatimModuleSyntax": true,
+    "verbatimModuleSyntax": true
   },
-  "include": ["index.d.mts"],
+  "include": ["index.d.mts"]
 }


Test patch:
diff --git a/tests/foundry/client/data/documents/item.test-d.ts b/tests/foundry/client/data/documents/item.test-d.ts
index f7f60b53e..c8c71ad0f 100644
--- a/tests/foundry/client/data/documents/item.test-d.ts
+++ b/tests/foundry/client/data/documents/item.test-d.ts
@@ -32,8 +32,8 @@ if (item) {
   expectTypeOf(item.isOwned).toEqualTypeOf<boolean>();
   expectTypeOf(item.transferredEffects).toEqualTypeOf<ActiveEffect[]>();
   expectTypeOf(item.type).toEqualTypeOf<"weapon" | "armor" | "base">();
-  expectTypeOf(item.getRollData()).toEqualTypeOf<object>();
-  expectTypeOf(item.system).toEqualTypeOf<WeaponData | ArmorData | object>();
+  expectTypeOf(item.getRollData()).toEqualTypeOf<AnyObject>();
+  expectTypeOf(item.system).toEqualTypeOf<WeaponData | ArmorData | AnyObject>();
 
   if (item.system instanceof WeaponData) {
     expectTypeOf(item.system.attack).toEqualTypeOf<number | null | undefined>();
diff --git a/tests/foundry/client/data/documents/macro.test-d.ts b/tests/foundry/client/data/documents/macro.test-d.ts
index 4749f7ab5..e206a814f 100644
--- a/tests/foundry/client/data/documents/macro.test-d.ts
+++ b/tests/foundry/client/data/documents/macro.test-d.ts
@@ -1,24 +1,43 @@
 import { expectTypeOf } from "vitest";
 import type { StoredDocument } from "../../../../../src/types/utils.d.mts";
 
-const macro = new Macro({ name: "my macro", scope: "global", type: "script" });
+const myMacro = new Macro({ name: "my macro", scope: "global", type: "script" });
 
 // properties and functions added by the concrete `Macro` class
-expectTypeOf(macro.isAuthor).toEqualTypeOf<boolean>();
-expectTypeOf(macro.execute).toEqualTypeOf<(scope?: { actor?: Actor; token?: Token }) => any>();
+expectTypeOf(myMacro.execute()).toEqualTypeOf<void | Promise<unknown>>();
+if (myMacro.type === "script") {
+  expectTypeOf(myMacro.type).toEqualTypeOf<"script">();
+  expectTypeOf(myMacro.isAuthor).toEqualTypeOf<boolean>();
+  expectTypeOf(await myMacro.execute({ effect: new ActiveEffect() })).toEqualTypeOf<unknown>();
+  expectTypeOf(
+    await myMacro.execute({ effect: new ActiveEffect(), actor: new Actor({ name: "foo", type: "base" }) }),
+  ).toEqualTypeOf<unknown>();
+
+  // @ts-expect-error The actor property must be an actual Actor
+  expectTypeOf(await myMacro.execute({ actor: new ActiveEffect() })).toEqualTypeOf<unknown>();
+  expectTypeOf(
+    // @ts-expect-error The actor property must be an actual Actor
+    await myMacro.execute({ actor: new ActiveEffect(), effect: new ActiveEffect() }),
+  ).toEqualTypeOf<unknown>();
+}
+if (myMacro.type === "chat") {
+  expectTypeOf(myMacro.type).toEqualTypeOf<"chat">();
+  // Unable to successfully narrow the type here, *should* be void
+  expectTypeOf(myMacro.execute()).toEqualTypeOf<void | Promise<unknown>>();
+}
 
 // properties and functions of `ClientDocumentMixin`
-expectTypeOf(macro.apps).toEqualTypeOf<Record<string, Application>>();
-expectTypeOf(macro.collection).toEqualTypeOf<Collection<Macro>>();
-expectTypeOf(macro.folder).toEqualTypeOf<Folder | null>();
-expectTypeOf(macro.isOwner).toEqualTypeOf<boolean>();
+expectTypeOf(myMacro.apps).toEqualTypeOf<Record<string, Application>>();
+expectTypeOf(myMacro.collection).toEqualTypeOf<Collection<Macro>>();
+expectTypeOf(myMacro.folder).toEqualTypeOf<Folder | null>();
+expectTypeOf(myMacro.isOwner).toEqualTypeOf<boolean>();
 
 // static properties and functions of `ClientDocumentMixin`
 expectTypeOf(Macro.createDialog()).toEqualTypeOf<Promise<Macro | null | undefined>>();
 
 // properties of `Document`
-expectTypeOf(macro.parent).toEqualTypeOf<null>();
-expectTypeOf(macro.pack).toEqualTypeOf<string | null>();
+expectTypeOf(myMacro.parent).toEqualTypeOf<null>();
+expectTypeOf(myMacro.pack).toEqualTypeOf<string | null>();
 
 // static properties of `Document`
 expectTypeOf(Macro.create({ name: "Some Macro" })).toEqualTypeOf<Promise<StoredDocument<Macro> | undefined>>();
diff --git a/tests/foundry/client/dice/dice/coin.test-d.ts b/tests/foundry/client/dice/dice/coin.test-d.ts
index a62801eb7..9ccf31af6 100644
--- a/tests/foundry/client/dice/dice/coin.test-d.ts
+++ b/tests/foundry/client/dice/dice/coin.test-d.ts
@@ -1,4 +1,4 @@
-declare module Coin {
+declare namespace Coin {
   interface Modifiers {
     testModifier1: (this: DiceTerm) => void;
     testModifier2: (this: DiceTerm) => DiceTerm;
diff --git a/tests/foundry/client/dice/dice/die.test-d.ts b/tests/foundry/client/dice/dice/die.test-d.ts
index a536a7bf6..33d112cb0 100644
--- a/tests/foundry/client/dice/dice/die.test-d.ts
+++ b/tests/foundry/client/dice/dice/die.test-d.ts
@@ -1,4 +1,4 @@
-declare module Die {
+declare namespace Die {
   interface Modifiers {
     testModifier1: (this: DiceTerm) => void;
     testModifier2: (this: DiceTerm) => DiceTerm;
diff --git a/tests/foundry/client/dice/dice/fate.test-d.ts b/tests/foundry/client/dice/dice/fate.test-d.ts
index 41f781cae..6500b50f5 100644
--- a/tests/foundry/client/dice/dice/fate.test-d.ts
+++ b/tests/foundry/client/dice/dice/fate.test-d.ts
@@ -1,4 +1,4 @@
-declare module FateDie {
+declare namespace FateDie {
   interface Modifiers {
     testModifier1: (this: DiceTerm) => void;
     testModifier2: (this: DiceTerm) => DiceTerm;
diff --git a/tests/foundry/client/pixi/placeable.test-d.ts b/tests/foundry/client/pixi/placeable.test-d.ts
index 2ba107252..32d041a54 100644
--- a/tests/foundry/client/pixi/placeable.test-d.ts
+++ b/tests/foundry/client/pixi/placeable.test-d.ts
@@ -1,5 +1,5 @@
 import { assertType, expectTypeOf } from "vitest";
-import { Document } from "../../../../src/foundry/common/abstract/module.mts";
+import type { Document } from "../../../../src/foundry/common/abstract/module.d.mts";
 import type { AnyMetadata } from "../../../../src/foundry/common/abstract/document.d.mts";
 
 type EmbeddedInSceneDocumentSheetOptions = DocumentSheetOptions<Document<any, AnyMetadata, Scene.ConfiguredInstance>>;
diff --git a/tests/foundry/client/pixi/webgl/shaders/base.test-d.ts b/tests/foundry/client/pixi/webgl/shaders/base.test-d.ts
index 3576d7f9f..fcd9100da 100644
--- a/tests/foundry/client/pixi/webgl/shaders/base.test-d.ts
+++ b/tests/foundry/client/pixi/webgl/shaders/base.test-d.ts
@@ -1,4 +1,5 @@
 import { expectTypeOf } from "vitest";
+
 class TestShader extends AbstractBaseShader {
   constructor(program: PIXI.Program, uniforms: AbstractBaseShader.Uniforms) {
     super(program, uniforms);
diff --git a/tests/foundry/common/abstract/type-data.mjs.test-d.ts b/tests/foundry/common/abstract/type-data.mjs.test-d.ts
new file mode 100644
index 000000000..9b3940ff7
--- /dev/null
+++ b/tests/foundry/common/abstract/type-data.mjs.test-d.ts
@@ -0,0 +1,133 @@
+import { expectTypeOf } from "vitest";
+import type { fields } from "../../../../src/foundry/common/data/module.d.mts";
+import type BaseJournalEntryPage from "../../../../src/foundry/common/documents/journal-entry-page.d.mts";
+import type { TypeDataModel } from "../../../../src/foundry/common/abstract/type-data.d.mts";
+
+/* attempting to use the example as a test */
+
+export interface QuestSchema extends BaseJournalEntryPage.Schema {
+  description: fields.HTMLField<{ required: false; blank: true; initial: "" }>;
+  steps: fields.ArrayField<fields.StringField<{ required: true }>>;
+}
+
+type BaseQuestData = {
+  // Overrides the schema.
+  // Since this changes the schema `this.description` will have no perfect type. During assignment it should be `HTMLElement` but during access it should be `string`.
+  // This is a limitation of the current implementation. If a dynamic getter/setter pair becomes possible this could be fixed.
+  // See https://github.com/microsoft/TypeScript/issues/43826
+  description: HTMLElement;
+  questName: string;
+};
+type DerivedQuestData = { totalSteps: number };
+
+// Test With specified Base and DerivedData.
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+class QuestModel extends foundry.abstract.TypeDataModel<
+  QuestSchema,
+  BaseJournalEntryPage,
+  BaseQuestData,
+  DerivedQuestData
+> {
+  otherMethod() {}
+
+  prepareBaseData(this: TypeDataModel.PrepareBaseDataThis<this>): void {
+    this.otherMethod();
+
+    // From schema
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+    expectTypeOf(this.description).toEqualTypeOf<HTMLElement | undefined>;
+
+    // @ts-expect-error Derived Data is not available yet
+    this.totalSteps + 1;
+
+    // @ts-expect-error Recursively calling is technically possible but wouldn't be desired. Removing it also seems to reduce the type complexity.
+    this.prepareBaseData();
+
+    // @ts-expect-error The this parameter is incompatible.
+    this.prepareDerivedData();
+  }
+
+  prepareDerivedData(this: TypeDataModel.PrepareDerivedDataThis<this>): void {
+    this.otherMethod();
+
+    // From JournalEntryPage
+    expectTypeOf(this.flags).toEqualTypeOf<Record<string, unknown>>;
+
+    // From QuestSchema
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+
+    // From BaseData
+    expectTypeOf(this.description).toEqualTypeOf<HTMLElement>;
+
+    expectTypeOf(this.totalSteps).toEqualTypeOf<number | undefined>();
+
+    // @ts-expect-error this key was declared nowhere.
+    this.afsdasdfqeqw + 1;
+
+    // @ts-expect-error The this parameter is incompatible.
+    this.prepareBaseData();
+
+    // @ts-expect-error Recursively calling is technically possible but wouldn't be desired. Removing it also seems to reduce the type complexity.
+    this.prepareDerivedData();
+  }
+}
+
+/* Test with default BaseData and DerivedData */
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+class QuestModel2 extends foundry.abstract.TypeDataModel<QuestSchema, BaseJournalEntryPage> {
+  prepareBaseData(this: TypeDataModel.PrepareBaseDataThis<this>): void {
+    // From JournalEntryPage
+    expectTypeOf(this.flags).toEqualTypeOf<Record<string, unknown>>;
+
+    // Comes from the schema
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+
+    // @ts-expect-error there is no base data this time.
+    this.questName;
+
+    // @ts-expect-error there is no derived data this time.
+    this.totalSteps + 1;
+  }
+
+  prepareDerivedData(this: TypeDataModel.PrepareDerivedDataThis<this>): void {
+    // From JournalEntryPage
+    expectTypeOf(this.flags).toEqualTypeOf<Record<string, unknown>>;
+
+    // Comes from the schema
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+
+    // @ts-expect-error there is no base data this time.
+    this.questName;
+
+    // @ts-expect-error there is no derived data this time.
+    this.totalSteps + 1;
+  }
+}
+
+/* Test with no DerivedData */
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+class QuestModel3 extends foundry.abstract.TypeDataModel<QuestSchema, BaseJournalEntryPage, BaseQuestData> {
+  prepareBaseData(this: TypeDataModel.PrepareBaseDataThis<this>): void {
+    // From JournalEntryPage
+    expectTypeOf(this.flags).toEqualTypeOf<Record<string, unknown>>;
+
+    // From BaseData
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+    expectTypeOf(this.description).toEqualTypeOf<HTMLElement | undefined>;
+
+    // @ts-expect-error There is no derived Data
+    this.totalSteps + 1;
+  }
+
+  prepareDerivedData(this: TypeDataModel.PrepareDerivedDataThis<this>): void {
+    // From JournalEntryPage
+    expectTypeOf(this.flags).toEqualTypeOf<Record<string, unknown>>;
+
+    // From BaseData
+    expectTypeOf(this.steps).toEqualTypeOf<string[]>;
+    expectTypeOf(this.description).toEqualTypeOf<HTMLElement>;
+
+    // @ts-expect-error There is no DerivedData
+    this.totalSteps + 1;
+  }
+}
diff --git a/tests/foundry/common/data/validation-failure.mjs.test-d.ts b/tests/foundry/common/data/validation-failure.mjs.test-d.ts
new file mode 100644
index 000000000..7150ffea5
--- /dev/null
+++ b/tests/foundry/common/data/validation-failure.mjs.test-d.ts
@@ -0,0 +1,9 @@
+import { expectTypeOf } from "vitest";
+
+new foundry.data.validation.DataModelValidationFailure();
+
+const myModelValidationFailure = new foundry.data.validation.DataModelValidationFailure({ message: "something" });
+
+expectTypeOf(myModelValidationFailure.asError()).toEqualTypeOf<foundry.data.validation.DataModelValidationError>();
+
+new foundry.data.validation.DataModelValidationError("Failure", { cause: "nested" });
diff --git a/tests/foundry/common/documents/actor.test-d.ts b/tests/foundry/common/documents/actor.test-d.ts
index ede02c2a6..8684b1e15 100644
--- a/tests/foundry/common/documents/actor.test-d.ts
+++ b/tests/foundry/common/documents/actor.test-d.ts
@@ -1,6 +1,7 @@
 import { expectTypeOf } from "vitest";
 import type EmbeddedCollection from "../../../../src/foundry/common/abstract/embedded-collection.d.mts";
 import type { NumberField, SchemaField } from "../../../../src/foundry/common/data/fields.d.mts";
+import type { TypeDataModel } from "../../../../src/foundry/common/abstract/type-data.d.mts";
 
 // @ts-expect-error name and type are required
 new foundry.documents.BaseActor();
@@ -46,7 +47,7 @@ type MyCharacterSchema = {
 };
 
 class MyCharacter extends foundry.abstract.TypeDataModel<MyCharacterSchema, Actor.ConfiguredInstance> {
-  static defineSchema() {
+  static override defineSchema() {
     const { SchemaField, NumberField } = foundry.data.fields;
     return {
       abilities: new SchemaField({
@@ -68,7 +69,7 @@ class MyCharacter extends foundry.abstract.TypeDataModel<MyCharacterSchema, Acto
     };
   }
 
-  prepareDerivedData(): void {
+  override prepareDerivedData(): void {
     this.abilities.strength.value + 2;
     for (const ability of Object.values(this.abilities)) {
       // @ts-expect-error Derived data must be declared
@@ -101,10 +102,10 @@ declare namespace BoilerplateActorBase {
 
 class BoilerplateActorBase<
   Schema extends BoilerplateActorBase.Schema = BoilerplateActorBase.Schema,
-  BaseData extends Record<string, unknown> = Record<string, never>,
-  DerivedData extends Record<string, unknown> = Record<string, never>,
+  BaseData extends AnyObject = Record<string, never>,
+  DerivedData extends AnyObject = Record<string, never>,
 > extends foundry.abstract.TypeDataModel<Schema, Actor.ConfiguredInstance, BaseData, DerivedData> {
-  static defineSchema(): BoilerplateActorBase.Schema {
+  static override defineSchema(): BoilerplateActorBase.Schema {
     const fields = foundry.data.fields;
     const requiredInteger = { required: true, nullable: false, integer: true };
     const schema: DataSchema = {};
@@ -147,13 +148,13 @@ declare namespace BoilerplateCharacter {
     extra: foundry.data.fields.SchemaField<{
       deep: foundry.data.fields.SchemaField<{
         check: foundry.data.fields.SchemaField<{
-          propA: foundry.data.fields.StringField;
+          propA: foundry.data.fields.StringField<{ required: true }>;
         }>;
       }>;
     }>;
   }
 
-  interface DerivedProps {
+  interface DerivedProps extends AnyObject {
     abilities: {
       strength: {
         mod: number;
@@ -163,7 +164,11 @@ declare namespace BoilerplateCharacter {
     extra: {
       deep: {
         check: {
-          propB: number;
+          deepDerivedProp: number;
+        };
+
+        derived: {
+          prop: string;
         };
       };
     };
@@ -174,9 +179,9 @@ declare namespace BoilerplateCharacter {
 class BoilerplateCharacter extends BoilerplateActorBase<
   BoilerplateCharacter.Schema,
   Record<string, never>,
-  BoilerplateCharacter.DerivedProps & Record<string, unknown>
+  BoilerplateCharacter.DerivedProps & AnyObject
 > {
-  static defineSchema() {
+  static override defineSchema() {
     const fields = foundry.data.fields;
     const requiredInteger = { required: true, nullable: false, integer: true };
     const schema = super.defineSchema();
@@ -200,23 +205,24 @@ class BoilerplateCharacter extends BoilerplateActorBase<
     return schema;
   }
 
-  prepareDerivedData() {
+  override prepareDerivedData(this: TypeDataModel.PrepareDerivedDataThis<this>) {
     // Loop through ability scores, and add their modifiers to our sheet output.
-
     for (const [key, abil] of Object.entries(this.abilities)) {
       // Calculate the modifier using d20 rules.
       abil.mod = Math.floor((abil.value - 10) / 2);
       // Handle ability label localization.
-      abil.label = (game as Game).i18n!.localize(CONFIG.BOILERPLATE.abilities[key]) ?? key;
+      abil.label = game.i18n!.localize(CONFIG.BOILERPLATE.abilities[key]) ?? key;
     }
-    this.extra.deep.check.propA;
-    this.extra.deep.check.propB;
-    // FIXME: This should be an optional property
-    this.derivedString.includes("foo");
+
+    expectTypeOf(this.extra.deep.check.propA).toEqualTypeOf<string>();
+    expectTypeOf(this.extra.deep.check.deepDerivedProp).toEqualTypeOf<number | undefined>();
+    expectTypeOf(this.extra.deep.derived?.prop).toEqualTypeOf<string | undefined>();
+
+    expectTypeOf(this.derivedString).toEqualTypeOf<string | undefined>();
   }
 
   getRollData() {
-    const data: Record<string, unknown> = {};
+    const data: AnyObject = {};
 
     // Copy the ability scores to the top level, so that rolls can use
     // formulas like `@str.mod + 4`.
@@ -231,6 +237,14 @@ class BoilerplateCharacter extends BoilerplateActorBase<
   }
 }
 
+declare const boilerplateCharacter: BoilerplateCharacter;
+
+// The class is assumed to have fully gone through initialization.
+// Therefore the derived properties are all available.
+expectTypeOf(boilerplateCharacter.abilities.strength.mod).toEqualTypeOf<number>();
+expectTypeOf(boilerplateCharacter.extra.deep.check.deepDerivedProp).toEqualTypeOf<number>();
+expectTypeOf(boilerplateCharacter.extra.deep.derived.prop).toEqualTypeOf<string>();
+
 declare global {
   interface DataModelConfig {
     Actor: {
diff --git a/tests/foundry/common/documents/macro.test-d.ts b/tests/foundry/common/documents/macro.test-d.ts
index 0a7feaf5a..013657d99 100644
--- a/tests/foundry/common/documents/macro.test-d.ts
+++ b/tests/foundry/common/documents/macro.test-d.ts
@@ -7,3 +7,7 @@ new foundry.documents.BaseMacro();
 new foundry.documents.BaseMacro({});
 
 expectTypeOf(new foundry.documents.BaseMacro({ name: "foo" })).toEqualTypeOf<foundry.documents.BaseMacro>();
+
+const myMacro = new foundry.documents.BaseMacro({ name: "foo" });
+
+expectTypeOf(myMacro.type).toEqualTypeOf<"chat" | "script">();
diff --git a/tests/foundry/public/scripts/earcut-edges/earcut-edges.test-d.ts b/tests/foundry/public/scripts/earcut-edges/earcut-edges.test-d.ts
index 92796ba7e..b81d8dea7 100644
--- a/tests/foundry/public/scripts/earcut-edges/earcut-edges.test-d.ts
+++ b/tests/foundry/public/scripts/earcut-edges/earcut-edges.test-d.ts
@@ -1,4 +1,5 @@
 import { expectTypeOf } from "vitest";
+
 expectTypeOf(earcut.earcutEdges).parameters.toEqualTypeOf<[data: number[], holeIndices: number[]]>;
 expectTypeOf(earcut.earcutEdges).returns.toEqualTypeOf<number[]>;
 expectTypeOf(earcut.earcutEdges.flatten).toEqualTypeOf<
diff --git a/vitest.config.js b/vitest.config.js
index 455e665a2..5e6068329 100644
--- a/vitest.config.js
+++ b/vitest.config.js
@@ -1,5 +1,6 @@
 // @ts-check
 
+// eslint-disable-next-line import/extensions
 import { defineConfig } from "vitest/config";
 
 export default defineConfig({