Repository: League-of-Foundry-Developers/foundry-vtt-types
Pull request #2589 (2024-07-04 22:10:21)

Synching updates to v11/data-models


Patch:
diff --git a/package.json b/package.json
index 8b57dba9e..11f34c604 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "$schema": "https://json.schemastore.org/package.json",
   "name": "@league-of-foundry-developers/foundry-vtt-types",
-  "version": "12.328.0",
+  "version": "11.315.0",
   "description": "TypeScript type definitions for Foundry VTT",
   "type": "module",
   "exports": {
diff --git a/src/foundry/client-esm/applications/_module.d.mts b/src/foundry/client-esm/applications/_module.d.mts
deleted file mode 100644
index f310d134d..000000000
--- a/src/foundry/client-esm/applications/_module.d.mts
+++ /dev/null
@@ -1,20 +0,0 @@
-export * as types from "./_types.mts";
-export * as api from "./api/_module.mts";
-export * as dice from "./dice/_module.mts";
-export * as elements from "./elements/_module.mts";
-export * as fields from "./forms/fields.mts";
-export * as apps from "./apps/_module.mts";
-export * as sheets from "./sheets/_module.mts";
-export * as ui from "./ui/_module.mts";
-
-/**
- * A registry of currently rendered ApplicationV2 instances.
- */
-export const instances: Map<number, foundry.applications.api.ApplicationV2>;
-
-/**
- * Parse an HTML string, returning a processed HTMLElement or HTMLCollection.
- * A single HTMLElement is returned if the provided string contains only a single top-level element.
- * An HTMLCollection is returned if the provided string contains multiple top-level elements.
- */
-export function parseHTML(htmlString: string): HTMLCollection | HTMLElement;
diff --git a/src/foundry/client-esm/applications/_types.d.mts b/src/foundry/client-esm/applications/_types.d.mts
deleted file mode 100644
index 4fe88a711..000000000
--- a/src/foundry/client-esm/applications/_types.d.mts
+++ /dev/null
@@ -1,92 +0,0 @@
-// Open question - this is just types?
-
-export interface ApplicationConfiguration {
-  /**
-   * An HTML element identifier used for this Application instance
-   */
-  id: string;
-  /**
-   * An string discriminator substituted for \{id\} in the default
-   * HTML element identifier for the class
-   */
-  uniqueId: string;
-  /**
-   * An array of CSS classes to apply to the Application
-   */
-  classes: string[];
-  /**
-   * The HTMLElement tag type used for the outer Application frame
-   */
-  tag: string;
-  /**
-   * Configuration of the window behaviors for this Application
-   */
-  window: ApplicationWindowConfiguration;
-  /**
-   * Click actions supported by the Application and their event handler
-   * functions. A handler function can be defined directly which only
-   * responds to left-click events. Otherwise, an object can be declared
-   * containing both a handler function and an array of buttons which are
-   * matched against the PointerEvent#button property.
-   */
-  actions: Record<string, ApplicationClickAction | { handler: ApplicationClickAction; buttons: number[] }>;
-  /**
-   * Configuration used if the application top-level element is a form
-   */
-  form?: ApplicationFormConfiguration;
-  /**
-   * Default positioning data for the application
-   */
-  position: Partial<ApplicationPosition>;
-}
-
-export type ApplicationPosition = {
-  /** Window offset pixels from top */
-  top: number;
-
-  /** Window offset pixels from left */
-  left: number;
-
-  /** Un-scaled pixels in width or "auto" */
-  width: number | "auto";
-
-  /** Un-scaled pixels in height or "auto" */
-  height: number | "auto";
-
-  /** A numeric scaling factor applied to application dimensions */
-  scale: number;
-
-  /** A z-index of the application relative to siblings */
-  zIndex: number;
-};
-
-export type ApplicationWindowConfiguration = {};
-
-export type ApplicationFormConfiguration = {};
-
-export type ApplicationHeaderControlsEntry = {};
-
-export type ApplicationConstructionParams = {
-  position: ApplicationPosition;
-};
-
-export type ApplicationRenderOptions = {};
-
-export type ApplicationWindowRenderOptions = {};
-
-/**
- * Context data provided to the renderer
- */
-export interface ApplicationRenderContext extends Record<string, any> {}
-
-export type ApplicationClosingOptions = {};
-
-export type ApplicationClickAction = (event: PointerEvent, target: HTMLElement) => Promise<void>;
-
-export type ApplicationFormSubmission = () => Promise<void>;
-
-export type ApplicationTab = {};
-
-export type FormNode = {};
-
-export type FormFooterButton = {};
diff --git a/src/foundry/client-esm/applications/api/_module.d.mts b/src/foundry/client-esm/applications/api/_module.d.mts
deleted file mode 100644
index a8a4d9d19..000000000
--- a/src/foundry/client-esm/applications/api/_module.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as ApplicationV2 } from "./application.mts";
-export { default as DialogV2 } from "./dialog.mts";
-export { default as DocumentSheetV2 } from "./document-sheet.mts";
-export { default as HandlebarsApplicationMixin } from "./handlebars-application.mts";
diff --git a/src/foundry/client-esm/applications/api/application.d.mts b/src/foundry/client-esm/applications/api/application.d.mts
deleted file mode 100644
index d6a95657f..000000000
--- a/src/foundry/client-esm/applications/api/application.d.mts
+++ /dev/null
@@ -1,422 +0,0 @@
-import type { DeepPartial, InexactPartial } from "../../../../types/utils.d.mts";
-import type EventEmitterMixin from "../../../common/utils/event-emitter.d.mts";
-import type {
-  ApplicationClosingOptions,
-  ApplicationConfiguration,
-  ApplicationFormConfiguration,
-  ApplicationHeaderControlsEntry,
-  ApplicationPosition,
-  ApplicationRenderContext,
-  ApplicationRenderOptions,
-} from "../_types.d.mts";
-
-// TODO: Investigate use of DeepPartial vs Partial vs InexactPartial
-// TODO: Should
-
-/**
- * The Application class is responsible for rendering an HTMLElement into the Foundry Virtual Tabletop user interface.
- */
-export default class ApplicationV2<
-  Configuration extends ApplicationConfiguration = ApplicationConfiguration,
-  RenderOptions extends ApplicationRenderOptions = ApplicationRenderOptions,
-> extends EventEmitterMixin(Object) {
-  constructor(options: DeepPartial<Configuration>);
-
-  static BASE_APPLICATION: typeof ApplicationV2;
-
-  static DEFAULT_OPTIONS: DeepPartial<ApplicationConfiguration>;
-
-  static readonly RENDER_STATES: {
-    ERROR: -3;
-    CLOSING: -2;
-    CLOSED: -1;
-    NONE: 0;
-    RENDERING: 1;
-    RENDERED: 2;
-  };
-
-  static override readonly emittedEvents: ["render", "close", "position"];
-
-  /**
-   * Application instance configuration options.
-   */
-  options: DeepPartial<Configuration>;
-
-  /**
-   * Convenience references to window header elements.
-   */
-  get window(): {
-    header?: HTMLElement | undefined;
-    resize?: HTMLElement | undefined;
-    title: HTMLHeadingElement | undefined;
-    icon: HTMLElement | undefined;
-    close: HTMLButtonElement | undefined;
-    controls: HTMLButtonElement | undefined;
-    controlsDropdown: HTMLDivElement | undefined;
-    onDrag: (event: PointerEvent) => void;
-    onResize: (event: PointerEvent) => void;
-    pointerStartPosition: ApplicationPosition | undefined;
-    pointerMoveThrottle: boolean;
-  };
-
-  /**
-   * If this Application uses tabbed navigation groups, this mapping is updated whenever the changeTab method is called.
-   * Reports the active tab for each group.
-   * Subclasses may override this property to define default tabs for each group.
-   */
-  tabGroups: Record<string, string>;
-
-  /**
-   * The CSS class list of this Application instance
-   */
-  get classList(): DOMTokenList;
-
-  /**
-   * The HTML element ID of this Application instance.
-   */
-  get id(): string;
-
-  /**
-   * A convenience reference to the title of the Application window.
-   */
-  get title(): string;
-
-  /**
-   * The HTMLElement which renders this Application into the DOM.
-   */
-  get element(): HTMLElement;
-
-  /**
-   * Is this Application instance currently minimized?
-   */
-  get minimized(): boolean;
-
-  /**
-   * The current position of the application with respect to the window.document.body.
-   */
-  position: ApplicationPosition;
-
-  /**
-   * Is this Application instance currently rendered?
-   */
-  get rendered(): boolean;
-
-  /**
-   * The current render state of the Application.
-   */
-  get state(): typeof ApplicationV2.RENDER_STATES;
-
-  /**
-   * Does this Application instance render within an outer window frame?
-   */
-  get hasFrame(): boolean;
-
-  /**
-   * Iterate over the inheritance chain of this Application.
-   * The chain includes this Application itself and all parents until the base application is encountered.
-   */
-  static inheritanceChain(): Generator<typeof ApplicationV2>;
-
-  /**
-   * Initialize configuration options for the Application instance.
-   * The default behavior of this method is to intelligently merge options for each class with those of their parents.
-   * - Array-based options are concatenated
-   * - Inner objects are merged
-   * - Otherwise, properties in the subclass replace those defined by a parent
-   * @param options - Options provided directly to the constructor
-   * @returns Configured options for the application instance
-   */
-  protected _initializeApplicationOptions(
-    options: DeepPartial<Configuration>,
-  ): DeepPartial<Configuration> & Record<string, unknown>;
-
-  /**
-   * Render the Application, creating its HTMLElement and replacing its innerHTML.
-   * Add it to the DOM if it is not currently rendered and rendering is forced. Otherwise, re-render its contents.
-   * @param options  - Options which configure application rendering behavior.
-   *                   A boolean is interpreted as the "force" option.
-   * @param _options - Legacy options for backwards-compatibility with the original
-   *                   ApplicationV1#render signature.
-   * @returns A Promise which resolves to the rendered Application instance
-   */
-  render(options?: DeepPartial<Configuration> | boolean, _options?: DeepPartial<RenderOptions>): Promise<this>;
-
-  /**
-   * Modify the provided options passed to a render request.
-   * @param options - Options which configure application rendering behavior
-   */
-  protected _configureRenderOptions(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Prepare application rendering context data for a given render request.
-   * @param options - Options which configure application rendering behavior
-   * @returns Context data for the render operation
-   */
-  protected _prepareContext(options: DeepPartial<RenderOptions>): Promise<ApplicationRenderContext>;
-
-  /**
-   * Configure the array of header control menu options
-   */
-  protected _getHeaderControls(): ApplicationHeaderControlsEntry[];
-
-  /**
-   * Iterate over header control buttons, filtering for controls which are visible for the current client.
-   */
-  protected _headerControlsButtons(): Generator<ApplicationHeaderControlsEntry>;
-
-  /**
-   * Render an HTMLElement for the Application.
-   * An Application subclass must implement this method in order for the Application to be renderable.
-   * @param context - Context data for the render operation
-   * @param options - Options which configure application rendering behavior
-   * @returns The result of HTML rendering may be implementation specific.
-   *          Whatever value is returned here is passed to _replaceHTML
-   */
-  protected _renderHTML(context: ApplicationRenderContext, options: DeepPartial<RenderOptions>): Promise<any>; //TODO: Might be the subject of a generic?
-
-  /**
-   * Replace the HTML of the application with the result provided by the rendering backend.
-   * An Application subclass should implement this method in order for the Application to be renderable.
-   * @param result  - The result returned by the application rendering backend
-   * @param content - The content element into which the rendered result must be inserted
-   * @param options - Options which configure application rendering behavior
-   */
-  protected _replaceHTML(
-    // TODO: Ignore warning?
-    result: Awaited<ReturnType<this["_renderHTML"]>>,
-    content: HTMLElement,
-    options: DeepPartial<RenderOptions>,
-  ): void;
-
-  /**
-   * Render the outer framing HTMLElement which wraps the inner HTML of the Application.
-   * @param options - Options which configure application rendering behavior
-   */
-  protected _renderFrame(options: DeepPartial<RenderOptions>): Promise<HTMLElement>;
-
-  /**
-   * Render a header control button.
-   */
-  protected _renderHeaderControl(control: ApplicationHeaderControlsEntry): HTMLLIElement;
-
-  /**
-   * When the Application is rendered, optionally update aspects of the window frame.
-   * @param options - Options provided at render-time
-   */
-  protected _updateFrame(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Insert the application HTML element into the DOM.
-   * Subclasses may override this method to customize how the application is inserted.
-   * @param element - The element to insert
-   * @returns The inserted element
-   */
-  // TODO: Actual function def appears to be void?
-  protected _insertElement(element: HTMLElement): HTMLElement;
-
-  /**
-   * Close the Application, removing it from the DOM.
-   * @param options - Options which modify how the application is closed.
-   * @returns A Promise which resolves to the closed Application instance
-   */
-  close(options?: DeepPartial<ApplicationClosingOptions>): Promise<this>;
-
-  /**
-   * Remove the application HTML element from the DOM.
-   * Subclasses may override this method to customize how the application element is removed.
-   * @param element - The element to be removed
-   */
-  protected _removeElement(element: HTMLElement): void;
-
-  /**
-   * Update the Application element position using provided data which is merged with the prior position.
-   * @param position - New Application positioning data
-   */
-  setPosition(position: DeepPartial<ApplicationPosition>): ApplicationPosition;
-
-  /**
-   * Translate a requested application position updated into a resolved allowed position for the Application.
-   * Subclasses may override this method to implement more advanced positioning behavior.
-   * @param position - Requested Application positioning data
-   * @returns Resolved Application positioning data
-   */
-  protected _updatePosition(position: ApplicationPosition): ApplicationPosition;
-
-  /**
-   * Toggle display of the Application controls menu.
-   * Only applicable to window Applications.
-   * @param expanded - Set the controls visibility to a specific state.
-   *                   Otherwise, the visible state is toggled from its current value
-   */
-  toggleControls(expanded?: boolean): void;
-
-  /**
-   * Minimize the Application, collapsing it to a minimal header.
-   */
-  minimize(): Promise<void>;
-
-  /**
-   * Restore the Application to its original dimensions.
-   */
-  maximize(): Promise<void>;
-
-  /**
-   * Bring this Application window to the front of the rendering stack by increasing its z-index.
-   * Once ApplicationV1 is deprecated we should switch from _maxZ to ApplicationV2#maxZ
-   * We should also eliminate ui.activeWindow in favor of only ApplicationV2#frontApp
-   */
-  bringToFront(): void;
-
-  /**
-   * Change the active tab within a tab group in this Application instance.
-   * @param tab     - The name of the tab which should become active
-   * @param group   - The name of the tab group which defines the set of tabs
-   * @param options - Additional options which affect tab navigation
-   */
-  changeTab(
-    tab: string,
-    group: string,
-    options?: InexactPartial<{
-      /**
-       * An interaction event which caused the tab change, if any
-       */
-      event: Event;
-      /**
-       * An explicit navigation element being modified
-       */
-      navElement: HTMLElement;
-      /**
-       * Force changing the tab even if the new tab is already active
-       * @defaultValue `false`
-       */
-      force: boolean;
-      /**
-       * Update application position after changing the tab?
-       * @defaultValue `false`
-       */
-      updatePosition: boolean;
-    }>,
-  ): void;
-
-  /**
-   * Test whether this Application is allowed to be rendered.
-   * @param options - Provided render options
-   * @returns Return false to prevent rendering
-   * @throws An Error to display a warning message
-   */
-  protected _canRender(options: DeepPartial<RenderOptions>): false | void;
-
-  /**
-   * Actions performed before a first render of the Application.
-   * @param context - Prepared context data
-   * @param options - Provided render options
-   */
-  protected _preFirstRender(
-    context: DeepPartial<ApplicationRenderContext>,
-    options: DeepPartial<RenderOptions>,
-  ): Promise<void>;
-
-  /**
-   * Actions performed after a first render of the Application.
-   * Post-render steps are not awaited by the render process.
-   * @param context - Prepared context data
-   * @param options - Provided render options
-   */
-  protected _onFirstRender(context: DeepPartial<ApplicationRenderContext>, options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Actions performed before any render of the Application.
-   * Pre-render steps are awaited by the render process.
-   * @param context - Prepared context data
-   * @param options - Provided render options
-   */
-  protected _preRender(
-    context: DeepPartial<ApplicationRenderContext>,
-    options: DeepPartial<RenderOptions>,
-  ): Promise<void>;
-
-  /**
-   * Actions performed after any render of the Application.
-   * Post-render steps are not awaited by the render process.
-   * @param context - Prepared context data
-   * @param options - Provided render options
-   */
-  protected _onRender(context: DeepPartial<ApplicationRenderContext>, options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Actions performed before closing the Application.
-   * Pre-close steps are awaited by the close process.
-   * @param options - Provided render options
-   */
-  protected _preClose(options: DeepPartial<RenderOptions>): Promise<void>;
-
-  /**
-   * Actions performed after closing the Application.
-   * Post-close steps are not awaited by the close process.
-   * @param options - Provided render options
-   */
-  protected _onClose(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Actions performed before the Application is re-positioned.
-   * Pre-position steps are not awaited because setPosition is synchronous.
-   * @param options - Provided render options
-   */
-  protected _prePosition(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Actions performed after the Application is re-positioned.
-   * @param options - Provided render options
-   */
-  protected _onPosition(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Attach event listeners to the Application frame.
-   */
-  protected _attachFrameListeners(): void;
-
-  /**
-   * A generic event handler for action clicks which can be extended by subclasses.
-   * Action handlers defined in DEFAULT_OPTIONS are called first. This method is only called for actions which have
-   * no defined handler.
-   * @param event  - The originating click event
-   * @param target - The capturing HTML element which defined a [data-action]
-   */
-  protected _onClickAction(event: PointerEvent, target: HTMLElement & { dataset: { action: string } }): void;
-
-  /**
-   * Handle submission for an Application which uses the form element.
-   * @param formConfig - The form configuration for which this handler is bound
-   * @param event      - The form submission event
-   */
-  protected _onSubmitForm(formConfig: ApplicationFormConfiguration, event: Event | SubmitEvent): Promise<void>;
-
-  /**
-   * Handle changes to an input element within the form.
-   * @param formConfig - The form configuration for which this handler is bound
-   * @param event      - The form submission event
-   */
-  _onChangeForm(formConfig: ApplicationFormConfiguration, event: Event): void;
-
-  /**
-   * Parse a CSS style rule into a number of pixels which apply to that dimension.
-   * @param style           - The CSS style rule
-   * @param parentDimension - The relevant dimension of the parent element
-   * @returns The parsed style dimension in pixels
-   */
-  static parseCSSDimensions(style: string, parentDimension: number): number;
-
-  /**
-   * Wait for a CSS transition to complete for an element.
-   * @param element - The element which is transitioning
-   * @param timeout - A timeout in milliseconds in case the transitionend event does not occur
-   * @internal
-   */
-  protected _awaitTransition(element: HTMLElement, timeout: number): Promise<void>;
-
-  /**
-   * @deprecated since v12, will be removed in v14
-   * @remarks `"ApplicationV2#bringToTop is not a valid function and redirects to ApplicationV2#bringToFront. This shim will be removed in v14."`
-   */
-  bringToTop(): void;
-}
diff --git a/src/foundry/client-esm/applications/api/dialog.d.mts b/src/foundry/client-esm/applications/api/dialog.d.mts
deleted file mode 100644
index 165f70db9..000000000
--- a/src/foundry/client-esm/applications/api/dialog.d.mts
+++ /dev/null
@@ -1,63 +0,0 @@
-import type ApplicationV2 from "./application.d.mts";
-
-/**
- * A lightweight Application that renders a dialog containing a form with arbitrary content, and some buttons.
- *
- * @example Prompt the user to confirm an action.
- * ```js
- * const proceed = await foundry.applications.api.DialogV2.confirm({
- *   content: "Are you sure?",
- *   rejectClose: false,
- *   modal: true
- * });
- * if ( proceed ) console.log("Proceed.");
- * else console.log("Do not proceed.");
- * ```
- *
- * @example Prompt the user for some input.
- * ```js
- * let guess;
- * try {
- *   guess = await foundry.applications.api.DialogV2.prompt({
- *     window: { title: "Guess a number between 1 and 10" },
- *     content: '<input name="guess" type="number" min="1" max="10" step="1" autofocus>',
- *     ok: {
- *       label: "Submit Guess",
- *       callback: (event, button, dialog) => button.form.elements.guess.valueAsNumber
- *     }
- *   });
- * } catch {
- *   console.log("User did not make a guess.");
- *   return;
- * }
- * const n = Math.ceil(CONFIG.Dice.randomUniform() * 10);
- * if ( n === guess ) console.log("User guessed correctly.");
- * else console.log("User guessed incorrectly.");
- * ```
- *
- * @example A custom dialog.
- * ```js
- * new foundry.applications.api.DialogV2({
- *   window: { title: "Choose an option" },
- *   content: `
- *     <label><input type="radio" name="choice" value="one" checked> Option 1</label>
- *     <label><input type="radio" name="choice" value="two"> Option 2</label>
- *     <label><input type="radio" name="choice" value="three"> Options 3</label>
- *   `,
- *   buttons: [{
- *     action: "choice",
- *     label: "Make Choice",
- *     default: true,
- *     callback: (event, button, dialog) => button.form.elements.choice.value
- *   }, {
- *     action: "all",
- *     label: "Take All"
- *   }],
- *   submit: result => {
- *     if ( result === "all" ) console.log("User picked all options.");
- *     else console.log(`User picked option: ${result}`);
- *   }
- * }).render({ force: true });
- * ```
- */
-export default class DialogV2 extends ApplicationV2 {}
diff --git a/src/foundry/client-esm/applications/api/document-sheet.d.mts b/src/foundry/client-esm/applications/api/document-sheet.d.mts
deleted file mode 100644
index 14a372379..000000000
--- a/src/foundry/client-esm/applications/api/document-sheet.d.mts
+++ /dev/null
@@ -1,120 +0,0 @@
-import type { DeepPartial } from "../../../../types/utils.d.mts";
-import type {
-  ApplicationConfiguration,
-  ApplicationHeaderControlsEntry,
-  ApplicationRenderContext,
-  ApplicationRenderOptions,
-} from "../_types.d.mts";
-import type ApplicationV2 from "./application.d.mts";
-
-interface DocumentSheetConfiguration<
-  Document extends foundry.abstract.Document<any, any, any> = foundry.abstract.Document<any, any, any>,
-> extends ApplicationConfiguration {
-  /**
-   * The Document instance associated with this sheet
-   */
-  document: Document;
-  /**
-   * A permission level in CONST.DOCUMENT_OWNERSHIP_LEVELS
-   */
-  viewPermission: typeof foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS;
-  /**
-   * A permission level in CONST.DOCUMENT_OWNERSHIP_LEVELS
-   */
-  editPermission: typeof foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS;
-  /**
-   * Allow sheet configuration as a header button
-   */
-  sheetConfig: boolean;
-}
-
-interface DocumentSheetRenderOptions extends ApplicationRenderOptions {
-  /** A string with the format "\{operation\}\{documentName\}" providing context */
-  renderContext: string;
-  /** Data describing the document modification that occurred */
-  renderData: object;
-}
-
-/**
- * The Application class is responsible for rendering an HTMLElement into the Foundry Virtual Tabletop user interface.
- */
-export default class DocumentSheetV2<
-  Document extends foundry.abstract.Document<any, any, any>,
-  Configuration extends DocumentSheetConfiguration<Document> = DocumentSheetConfiguration<Document>,
-  RenderOptions extends DocumentSheetRenderOptions = DocumentSheetRenderOptions,
-> extends ApplicationV2<Configuration, RenderOptions> {
-  constructor(options: DeepPartial<Configuration> & { document: Document });
-
-  static DEFAULT_OPTIONS: DeepPartial<DocumentSheetConfiguration>;
-
-  get document(): Document;
-
-  override get title(): string;
-
-  /**
-   * Is this Document sheet visible to the current User?
-   * This is governed by the viewPermission threshold configured for the class.
-   */
-  get isVisible(): boolean;
-
-  /**
-   * Is this Document sheet editable by the current User?
-   * This is governed by the editPermission threshold configured for the class.
-   */
-  get isEditable(): boolean;
-
-  protected _initializeApplicationOptions(
-    options: DeepPartial<Configuration>,
-  ): DeepPartial<Configuration> & Record<string, unknown>;
-
-  protected override _headerControlsButtons(): Generator<ApplicationHeaderControlsEntry>;
-
-  protected override _renderFrame(options: DeepPartial<RenderOptions>): Promise<HTMLElement>;
-
-  protected override _canRender(options: DeepPartial<RenderOptions>): false | void;
-
-  protected override _onFirstRender(
-    context: DeepPartial<ApplicationRenderContext>,
-    options: DeepPartial<RenderOptions>,
-  ): void;
-
-  protected override _onClose(options: DeepPartial<RenderOptions>): void;
-
-  /**
-   * Prepare data used to update the Item upon form submission.
-   * This data is cleaned and validated before being returned for further processing.
-   * @param event    - The originating form submission event
-   * @param form     - The form element that was submitted
-   * @param formData - Processed data for the submitted form
-   * @returns Prepared submission data as an object
-   * @throws Subclasses may throw validation errors here to prevent form submission
-   */
-  // TODO: Improve typing?
-  protected _prepareSubmitData(event: SubmitEvent, form: HTMLFormElement, formData: FormDataExtended): object;
-
-  /**
-   * Customize how form data is extracted into an expanded object.
-   * @param event    - The originating form submission event
-   * @param form     - The form element that was submitted
-   * @param formData - Processed data for the submitted form
-   * @returns An expanded object of processed form data
-   * @throws Subclasses may throw validation errors here to prevent form submission
-   */
-  _processFormData(event: SubmitEvent, form: HTMLFormElement, formData: FormDataExtended): object;
-
-  /**
-   * Submit a document update based on the processed form data.
-   * @param event    - The originating form submission event
-   * @param form     - The form element that was submitted
-   * @param formData - Processed and validated form data to be used for a document update
-   */
-  _processSubmitData(event: SubmitEvent, form: HTMLFormElement, formData: FormDataExtended): Promise<void>;
-
-  /**
-   * Programmatically submit a DocumentSheetV2 instance, providing additional data to be merged with form data.
-   */
-  submit(options?: {
-    /** Additional data merged with processed form data */
-    updateData: object;
-  }): Promise<void>;
-}
diff --git a/src/foundry/client-esm/applications/api/handlebars-application.d.mts b/src/foundry/client-esm/applications/api/handlebars-application.d.mts
deleted file mode 100644
index b17c6e377..000000000
--- a/src/foundry/client-esm/applications/api/handlebars-application.d.mts
+++ /dev/null
@@ -1,159 +0,0 @@
-import type { DeepPartial, Mixin } from "../../../../types/utils.d.mts";
-import type { ApplicationFormConfiguration, ApplicationRenderContext, ApplicationRenderOptions } from "../_types.d.mts";
-import type ApplicationV2 from "./application.d.mts";
-
-// TODO: How does this merge with DocumentSheetRenderOptions?
-interface HandlebarsRenderOptions extends ApplicationRenderOptions {
-  parts: string[];
-}
-
-type HandlebarsTemplatePart = {
-  /**
-   * The template entry-point for the part
-   */
-  template: string;
-  /**
-   * A CSS id to assign to the top-level element of the rendered part.
-   * This id string is automatically prefixed by the application id.
-   */
-  id?: string;
-  /**
-   * An array of CSS classes to apply to the top-level element of the
-   * rendered part.
-   */
-  classes?: string[];
-  /**
-   * An array of templates that are required to render the part.
-   * If omitted, only the entry-point is inferred as required.
-   */
-  templates?: string[];
-  /**
-   * An array of selectors within this part whose scroll positions should
-   * be persisted during a re-render operation. A blank string is used
-   * to denote that the root level of the part is scrollable.
-   */
-  scrollabe?: string[];
-  /**
-   * A registry of forms selectors and submission handlers.
-   */
-  forms?: Record<string, ApplicationFormConfiguration>;
-};
-
-/**
- * The mixed application class augmented with [Handlebars](https://handlebarsjs.com) template rendering behavior.
- */
-declare class HandlebarsApplication {
-  /**
-   * Configure a registry of template parts which are supported for this application for partial rendering.
-   * @defaultValue `{}`
-   */
-  static PARTS: Record<string, HandlebarsTemplatePart>;
-
-  /**
-   * A record of all rendered template parts.
-   * @defaultValue `{}`
-   */
-  get parts(): Record<string, HTMLElement>;
-
-  protected _configureRenderOptions(options: DeepPartial<HandlebarsRenderOptions>): void;
-
-  protected _preFirstRender(
-    context: DeepPartial<ApplicationRenderContext>,
-    options: DeepPartial<ApplicationRenderOptions>,
-  ): Promise<void>;
-
-  /**
-   * Render each configured application part using Handlebars templates.
-   * @param context - Context data for the render operation
-   * @param options - Options which configure application rendering behavior
-   * @returns A single rendered HTMLElement for each requested part
-   */
-  protected _renderHTML(
-    context: ApplicationRenderContext,
-    options: DeepPartial<ApplicationRenderOptions>,
-  ): Promise<Record<string, HTMLElement>>;
-
-  /**
-   * Prepare context that is specific to only a single rendered part.
-   *
-   * It is recommended to augment or mutate the shared context so that downstream methods like _onRender have
-   * visibility into the data that was used for rendering. It is acceptable to return a different context object
-   * rather than mutating the shared context at the expense of this transparency.
-   *
-   * @param partId  - The part being rendered
-   * @param context - Shared context provided by _prepareContext
-   * @param options - Options which configure application rendering behavior
-   * @returns Context data for a specific part
-   */
-  protected _preparePartContext(
-    partId: string,
-    context: ApplicationRenderContext,
-    options: DeepPartial<HandlebarsRenderOptions>,
-  ): Promise<ApplicationRenderContext>;
-
-  /**
-   * Replace the HTML of the application with the result provided by Handlebars rendering.
-   * @param result  - The result from Handlebars template rendering
-   * @param content - The content element into which the rendered result must be inserted
-   * @param options - Options which configure application rendering behavior
-   */
-  protected _replaceHTML(
-    result: Record<string, HTMLElement>,
-    content: HTMLElement,
-    options: DeepPartial<ApplicationRenderOptions>,
-  ): void;
-
-  /**
-   * Prepare data used to synchronize the state of a template part.
-   * @param partId       - The id of the part being rendered
-   * @param newElement   - The new rendered HTML element for the part
-   * @param priorElement - The prior rendered HTML element for the part
-   * @param state        - A state object which is used to synchronize after replacement
-   */
-  protected _preSyncPartState(
-    partId: string,
-    newElement: HTMLElement,
-    priorElement: HTMLElement,
-    state: HandlebarsApplicationMixin.partState,
-  ): void;
-
-  /**
-   * Synchronize the state of a template part after it has been rendered and replaced in the DOM.
-   * @param partId       - The id of the part being rendered
-   * @param newElement   - The new rendered HTML element for the part
-   * @param priorElement - The prior rendered HTML element for the part
-   * @param state        - A state object which is used to synchronize after replacement
-   */
-  protected _syncPartState(
-    partId: string,
-    newElement: HTMLElement,
-    priorElement: HTMLElement,
-    state: HandlebarsApplicationMixin.partState,
-  ): void;
-
-  /**
-   * Attach event listeners to rendered template parts.
-   * @param partId      - The id of the part being rendered
-   * @param htmlElement - The rendered HTML element for the part
-   * @param options     - Rendering options passed to the render method
-   */
-  protected _attachPartListeners(
-    partId: string,
-    htmlElement: HTMLElement,
-    options: DeepPartial<HandlebarsRenderOptions>,
-  ): void;
-}
-
-/**
- * Augment an Application class with [Handlebars](https://handlebarsjs.com) template rendering behavior.
- */
-export default function HandlebarsApplicationMixin<BaseClass extends typeof ApplicationV2>(
-  BaseApplication: BaseClass,
-): Mixin<typeof HandlebarsApplication, BaseClass>;
-
-declare namespace HandlebarsApplicationMixin {
-  interface partState {
-    scrollPositions: Array<[el1: HTMLElement, scrollTop: number, scrollLeft: number]>;
-    focus?: string | undefined;
-  }
-}
diff --git a/src/foundry/client-esm/applications/apps/_module.d.mts b/src/foundry/client-esm/applications/apps/_module.d.mts
deleted file mode 100644
index ecd15ab71..000000000
--- a/src/foundry/client-esm/applications/apps/_module.d.mts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as CompendiumArtConfig } from "./compendium-art-config.mts";
-export { default as PermissionConfig } from "./permission-config.mts";
diff --git a/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts b/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts
deleted file mode 100644
index 8b70a07cd..000000000
--- a/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-import type ApplicationV2 from "../api/application.d.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mjs";
-
-export default class CompendiumArtConfig extends HandlebarsApplicationMixin(ApplicationV2) {}
diff --git a/src/foundry/client-esm/applications/apps/permission-config.d.mts b/src/foundry/client-esm/applications/apps/permission-config.d.mts
deleted file mode 100644
index ca9d2251f..000000000
--- a/src/foundry/client-esm/applications/apps/permission-config.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-import type ApplicationV2 from "../api/application.d.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mjs";
-
-export default class PermissionConfig extends HandlebarsApplicationMixin(ApplicationV2) {}
diff --git a/src/foundry/client-esm/applications/dice/_module.d.mts b/src/foundry/client-esm/applications/dice/_module.d.mts
deleted file mode 100644
index 3f3f23352..000000000
--- a/src/foundry/client-esm/applications/dice/_module.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-export { default as RollResolver } from "./roll-resolver.mts";
diff --git a/src/foundry/client-esm/applications/dice/roll-resolver.d.mts b/src/foundry/client-esm/applications/dice/roll-resolver.d.mts
deleted file mode 100644
index d9e40cc59..000000000
--- a/src/foundry/client-esm/applications/dice/roll-resolver.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-import type ApplicationV2 from "../api/application.d.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mjs";
-
-export default class RollResolver extends HandlebarsApplicationMixin(ApplicationV2) {}
diff --git a/src/foundry/client-esm/applications/elements/_module.d.mts b/src/foundry/client-esm/applications/elements/_module.d.mts
deleted file mode 100644
index d46de49ba..000000000
--- a/src/foundry/client-esm/applications/elements/_module.d.mts
+++ /dev/null
@@ -1,11 +0,0 @@
-export { default as AbstractFormInputElement } from "./form-element.mts";
-export { default as HTMLColorPickerElement } from "./color-picker.mts";
-export { default as HTMLDocumentTagsElement } from "./document-tags.mts";
-export { default as HTMLFilePickerElement } from "./file-picker.mts";
-export { default as HTMLHueSelectorSlider } from "./hue-slider.mts";
-export { default as HTMLRangePickerElement } from "./range-picker.mts";
-export { default as HTMLStringTagsElement } from "./string-tags.mts";
-export { default as HTMLProseMirrorElement } from "./prosemirror-editor.mts";
-export * from "./multi-select.mts";
-
-// TODO: Figure out if custom elements need to be otherwise registered for TS compatibility
diff --git a/src/foundry/client-esm/applications/forms/fields.d.mts b/src/foundry/client-esm/applications/forms/fields.d.mts
deleted file mode 100644
index 806378e47..000000000
--- a/src/foundry/client-esm/applications/forms/fields.d.mts
+++ /dev/null
@@ -1,11 +0,0 @@
-declare global {
-  type CustomFormGroup = unknown;
-
-  type CustomFormElement = unknown;
-
-  interface FormGroupConfig {}
-
-  interface FormInputConfig {}
-}
-
-export function createFormGroup(config: FormGroupConfig): HTMLDivElement;
diff --git a/src/foundry/client-esm/applications/sheets/_module.d.mts b/src/foundry/client-esm/applications/sheets/_module.d.mts
deleted file mode 100644
index fe97204d8..000000000
--- a/src/foundry/client-esm/applications/sheets/_module.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-export { default as ActorSheetV2 } from "./actor-sheet.mts";
-export { default as AmbientSoundConfig } from "./ambient-sound-config.mts";
-export { default as AmbientLightConfig } from "./ambient-light-config.mts";
-export { default as ItemSheetV2 } from "./item-sheet.mts";
-export { default as RegionBehaviorConfig } from "./region-behavior-config.mts";
-export { default as RegionConfig } from "./region-config.mts";
-export { default as UserConfig } from "./user-config.mts";
diff --git a/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts b/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts
deleted file mode 100644
index e2efee91f..000000000
--- a/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-
-/**
- * A base class for providing Actor Sheet behavior using ApplicationV2.
- */
-export default class ActorSheetV2 extends DocumentSheetV2<Actor.ConfiguredInstance> {}
diff --git a/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts b/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts
deleted file mode 100644
index 4353c4710..000000000
--- a/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * The AmbientLight configuration application.
- */
-export default class AmbientLightConfig extends HandlebarsApplicationMixin(DocumentSheetV2) {}
diff --git a/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts b/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts
deleted file mode 100644
index 05d605545..000000000
--- a/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * The AmbientSound configuration application.
- */
-export default class AmbientSoundConfig extends HandlebarsApplicationMixin(DocumentSheetV2) {}
diff --git a/src/foundry/client-esm/applications/sheets/item-sheet.d.mts b/src/foundry/client-esm/applications/sheets/item-sheet.d.mts
deleted file mode 100644
index fb90fa093..000000000
--- a/src/foundry/client-esm/applications/sheets/item-sheet.d.mts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-
-/**
- * A base class for providing Item Sheet behavior using ApplicationV2.
- */
-export default class ItemSheetV2 extends DocumentSheetV2<Item.ConfiguredInstance> {}
diff --git a/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts b/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts
deleted file mode 100644
index 873bdb636..000000000
--- a/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * The Scene Region configuration application.
- */
-export default class RegionBehaviorConfig extends HandlebarsApplicationMixin(DocumentSheetV2) {}
diff --git a/src/foundry/client-esm/applications/sheets/region-config.d.mts b/src/foundry/client-esm/applications/sheets/region-config.d.mts
deleted file mode 100644
index 6063d60c5..000000000
--- a/src/foundry/client-esm/applications/sheets/region-config.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * The Scene Region configuration application.
- */
-export default class RegionConfig extends HandlebarsApplicationMixin(DocumentSheetV2) {}
diff --git a/src/foundry/client-esm/applications/sheets/user-config.d.mts b/src/foundry/client-esm/applications/sheets/user-config.d.mts
deleted file mode 100644
index f497a1488..000000000
--- a/src/foundry/client-esm/applications/sheets/user-config.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type DocumentSheetV2 from "../api/document-sheet.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * The User configuration application.
- */
-export default class UserConfig extends HandlebarsApplicationMixin(DocumentSheetV2) {}
diff --git a/src/foundry/client-esm/applications/ui/_module.d.mts b/src/foundry/client-esm/applications/ui/_module.d.mts
deleted file mode 100644
index 5bcebf1f9..000000000
--- a/src/foundry/client-esm/applications/ui/_module.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-export { default as RegionLegend } from "./region-legend.mts";
diff --git a/src/foundry/client-esm/applications/ui/region-legend.d.mts b/src/foundry/client-esm/applications/ui/region-legend.d.mts
deleted file mode 100644
index 59127ed3e..000000000
--- a/src/foundry/client-esm/applications/ui/region-legend.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type ApplicationV2 from "../api/application.mts";
-import type HandlebarsApplicationMixin from "../api/handlebars-application.mts";
-
-/**
- * Scene Region Legend.
- */
-export default class RegionLegend extends HandlebarsApplicationMixin(ApplicationV2) {}
diff --git a/src/foundry/client-esm/audio/_module.d.mts b/src/foundry/client-esm/audio/_module.d.mts
deleted file mode 100644
index c16d649ac..000000000
--- a/src/foundry/client-esm/audio/_module.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-export * as types from "./_types.mts";
-export { default as AudioBufferCache } from "./cache.mts";
-export { default as AudioHelper } from "./helper.mts";
-export { default as AudioTimeout } from "./timeout.mts";
-export { default as Sound } from "./sound.mts";
-export { default as BiquadFilterEffect } from "./biquad.mts";
-export { default as ConvolverEffect } from "./convolver.mts";
diff --git a/src/foundry/client-esm/audio/_types.d.mts b/src/foundry/client-esm/audio/_types.d.mts
deleted file mode 100644
index 18f5129a1..000000000
--- a/src/foundry/client-esm/audio/_types.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-// Open question - this is just types?
diff --git a/src/foundry/client-esm/canvas/_module.d.mts b/src/foundry/client-esm/canvas/_module.d.mts
deleted file mode 100644
index 6b1b66331..000000000
--- a/src/foundry/client-esm/canvas/_module.d.mts
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as SceneManager } from "./scene-manager.mts";
-export { default as SMAAFilter } from "./smaa/smaa.mts";
-export * as edges from "./edges/_module.mts";
-export * as regions from "./regions/_module.mts";
-export * as sources from "./sources/_module.mts";
-export * as tokens from "./tokens/_module.mts";
diff --git a/src/foundry/client-esm/canvas/edges/_module.d.mts b/src/foundry/client-esm/canvas/edges/_module.d.mts
deleted file mode 100644
index df48da244..000000000
--- a/src/foundry/client-esm/canvas/edges/_module.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as CanvasEdges } from "./edges.mts";
-export { default as CollisionResult } from "./collision.mts";
-export { default as Edge } from "./edge.mts";
-export { default as PolygonVertex } from "./vertex.mts";
diff --git a/src/foundry/client-esm/canvas/regions/_module.d.mts b/src/foundry/client-esm/canvas/regions/_module.d.mts
deleted file mode 100644
index 209a0921b..000000000
--- a/src/foundry/client-esm/canvas/regions/_module.d.mts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as RegionGeometry } from "./geometry.mts";
-export { default as RegionMesh } from "./mesh.mts";
-export { default as RegionPolygonTree } from "./polygon-tree.mts";
-export { default as RegionShape } from "./shape.mts";
diff --git a/src/foundry/client-esm/canvas/scene-manager.d.mts b/src/foundry/client-esm/canvas/scene-manager.d.mts
deleted file mode 100644
index 1dc239f8f..000000000
--- a/src/foundry/client-esm/canvas/scene-manager.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-export default class SceneManager {}
diff --git a/src/foundry/client-esm/canvas/smaa/smaa.d.mts b/src/foundry/client-esm/canvas/smaa/smaa.d.mts
deleted file mode 100644
index b2c5171e4..000000000
--- a/src/foundry/client-esm/canvas/smaa/smaa.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-export default class SMAAFilter extends PIXI.Filter {}
diff --git a/src/foundry/client-esm/canvas/sources/_module.d.mts b/src/foundry/client-esm/canvas/sources/_module.d.mts
deleted file mode 100644
index e36fec35a..000000000
--- a/src/foundry/client-esm/canvas/sources/_module.d.mts
+++ /dev/null
@@ -1,10 +0,0 @@
-export { default as BaseEffectSource } from "./base-effect-source.mts";
-export { default as BaseLightSource } from "./base-light-source.mts";
-export { default as GlobalLightSource } from "./global-light-source.mts";
-export { default as PointDarknessSource } from "./point-darkness-source.mts";
-export { default as PointEffectSourceMixin } from "./point-effect-source.mts";
-export { default as PointLightSource } from "./point-light-source.mts";
-export { default as PointMovementSource } from "./point-movement-source.mts";
-export { default as PointSoundSource } from "./point-sound-source.mts";
-export { default as PointVisionSource } from "./point-vision-source.mts";
-export { default as RenderedEffectSource } from "./rendered-effect-source.mts";
diff --git a/src/foundry/client-esm/canvas/tokens/_module.d.mts b/src/foundry/client-esm/canvas/tokens/_module.d.mts
deleted file mode 100644
index f37ff3309..000000000
--- a/src/foundry/client-esm/canvas/tokens/_module.d.mts
+++ /dev/null
@@ -1,1 +0,0 @@
-export { default as TokenRing } from "./ring.mts";
diff --git a/src/foundry/client-esm/client.d.mts b/src/foundry/client-esm/client.d.mts
deleted file mode 100644
index 3a5e097f6..000000000
--- a/src/foundry/client-esm/client.d.mts
+++ /dev/null
@@ -1,16 +0,0 @@
-import * as _applications from "./applications/_module.mts";
-import * as _audio from "./audio/_module.mts";
-import * as _canvas from "./canvas/_module.mts";
-// import * as _data from "./data/_module.mts";
-import * as _dice from "./dice/_module.mts";
-
-declare global {
-  namespace foundry {
-    export import applications = _applications;
-    export import audio = _audio;
-    export import canvas = _canvas;
-    // TODO: Handle the merge
-    // export import data = _data;
-    export import dice = _dice;
-  }
-}
diff --git a/src/foundry/client-esm/data/_module.d.mts b/src/foundry/client-esm/data/_module.d.mts
deleted file mode 100644
index 485e32fb1..000000000
--- a/src/foundry/client-esm/data/_module.d.mts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from "../../common/data/module.mts";
-export * as regionBehaviors from "./region-behaviors/_module.mts";
-export { default as ClientDatabaseBackend } from "./client-backend.mts";
diff --git a/src/foundry/client-esm/data/region-behaviors/_module.d.mts b/src/foundry/client-esm/data/region-behaviors/_module.d.mts
deleted file mode 100644
index f588549c3..000000000
--- a/src/foundry/client-esm/data/region-behaviors/_module.d.mts
+++ /dev/null
@@ -1,8 +0,0 @@
-export { default as RegionBehaviorType } from "./base.mts";
-export { default as AdjustDarknessLevelRegionBehaviorType } from "./adjust-darkness-level.mts";
-export { default as ExecuteMacroRegionBehaviorType } from "./execute-macro.mts";
-export { default as ExecuteScriptRegionBehaviorType } from "./execute-script.mts";
-export { default as PauseGameRegionBehaviorType } from "./pause-game.mts";
-export { default as SuppressWeatherRegionBehaviorType } from "./suppress-weather.mts";
-export { default as TeleportTokenRegionBehaviorType } from "./teleport-token.mts";
-export { default as ToggleBehaviorRegionBehaviorType } from "./toggle-behavior.mts";
diff --git a/src/foundry/client-esm/dice/_module.d.mts b/src/foundry/client-esm/dice/_module.d.mts
deleted file mode 100644
index c92c03846..000000000
--- a/src/foundry/client-esm/dice/_module.d.mts
+++ /dev/null
@@ -1,7 +0,0 @@
-export * as types from "./_types.mts";
-export * as terms from "./terms/_module.mts";
-
-export { default as Roll } from "./roll.mts";
-export { default as RollGrammar } from "./grammar.pegjs";
-export { default as RollParser } from "./parser.mts";
-export { default as MersenneTwister } from "./twister.mts";
diff --git a/src/foundry/client-esm/dice/terms/_module.d.mts b/src/foundry/client-esm/dice/terms/_module.d.mts
deleted file mode 100644
index 6c978a87c..000000000
--- a/src/foundry/client-esm/dice/terms/_module.d.mts
+++ /dev/null
@@ -1,11 +0,0 @@
-export { default as Coin } from "./coin.mts";
-export { default as DiceTerm } from "./dice.mts";
-export { default as Die } from "./die.mts";
-export { default as FateDie } from "./fate.mts";
-export { default as FunctionTerm } from "./function.mts";
-export { default as NumericTerm } from "./numeric.mts";
-export { default as OperatorTerm } from "./operator.mts";
-export { default as ParentheticalTerm } from "./parenthetical.mts";
-export { default as PoolTerm } from "./pool.mts";
-export { default as RollTerm } from "./term.mts";
-export { default as StringTerm } from "./string.mts";
diff --git a/src/foundry/client/apps/sidebar/apps/module-management.d.mts b/src/foundry/client/apps/sidebar/apps/module-management.d.mts
index 8a761dd5d..c48d4bd9f 100644
--- a/src/foundry/client/apps/sidebar/apps/module-management.d.mts
+++ b/src/foundry/client/apps/sidebar/apps/module-management.d.mts
@@ -130,6 +130,4 @@ declare global {
       search: string;
     };
   }
-
-  interface ModuleSubTypeCounts extends Record<string, Record<string, number>> {}
 }
diff --git a/src/foundry/client/core/index.d.mts b/src/foundry/client/core/index.d.mts
index 4b7d9c319..5b35da091 100644
--- a/src/foundry/client/core/index.d.mts
+++ b/src/foundry/client/core/index.d.mts
@@ -2,6 +2,7 @@ import "./document-index.d.mts";
 import "./gamepad.d.mts";
 import "./hooks.d.mts";
 import "./image.d.mts";
+import "./issues.d.mts";
 import "./keybindings.d.mts";
 import "./keyboard.d.mts";
 import "./mouse.d.mts";
diff --git a/src/foundry/client/core/issues.d.mts b/src/foundry/client/core/issues.d.mts
new file mode 100644
index 000000000..e712f6b3e
--- /dev/null
+++ b/src/foundry/client/core/issues.d.mts
@@ -0,0 +1,214 @@
+import type { DocumentConstructor, DocumentType } from "../../../types/helperTypes.d.mts";
+import type { DataModelValidationError } from "../../common/data/validation-failure.d.mts";
+
+declare global {
+  /**
+   * An object structure of document types at the top level, with a count of different sub-types for that document type.
+   */
+  interface ModuleSubTypeCounts extends Record<DocumentType, Record<string, number>> {}
+
+  /**
+   * A class responsible for tracking issues in the current world.
+   */
+  class ClientIssues {
+    /**
+     * Keep track of valid Documents in the world that are using module-provided sub-types.
+     * @remarks the keys are module ids.
+     */
+    #moduleTypeMap: Map<string, ModuleSubTypeCounts>;
+
+    /**
+     * Keep track of document validation failures.
+     */
+    #documentValidationFailures: Record<
+      DocumentType,
+      Record<string, { name: string; error: DataModelValidationError }>
+    >;
+
+    /**
+     * Keep track of any usability issues related to browser or technology versions.
+     */
+    #usabilityIssues: Record<string, ClientIssues.UsabilityIssue>;
+
+    /** The minimum supported resolution. */
+    static #MIN_RESOLUTION: { WIDTH: 1024; HEIGHT: 700 };
+
+    /**
+     * The minimum supported client versions.
+     */
+    static #BROWSER_TESTS: {
+      /**
+       * @defaultValue
+       * ```typescript
+       * {
+       *   minimum: 24;
+       *   match: RegExp;
+       *   message: "ERROR.ElectronVersion";
+       * }
+       * ```
+       */
+      Electron: ClientIssues.BROWSER_TEST;
+      /**
+       * @defaultValue
+       * ```
+       * {
+       *   minimum: 92;
+       *   match: RegExp;
+       *   message: "ERROR.BrowserVersion";
+       * }
+       * ```
+       */
+      Chromium: ClientIssues.BROWSER_TEST;
+      /**
+       * @defaultValue
+       * ```
+       * {
+       *   minimum: 90;
+       *   match: RegExp;
+       *   message: "ERROR.BrowserVersion";
+       * }
+       * ```
+       */
+      Firefox: ClientIssues.BROWSER_TEST;
+      /**
+       * @defaultValue
+       * ```
+       * {
+       *   minimum: 15.4;
+       *   match: RegExp;
+       *   message: "ERROR.BrowserVersion";
+       * }
+       * ```
+       */
+      Safari: ClientIssues.BROWSER_TEST;
+    };
+
+    /**
+     * Add a Document to the count of module-provided sub-types.
+     * @param documentName      - The Document name.
+     * @param subType           - The Document's sub-type.
+     */
+    #countDocumentSubType(
+      documentName: DocumentType,
+      subType: string,
+      options?: {
+        /**
+         * Decrement the counter rather than incrementing it.
+         * @defaultValue `false`
+         */
+        decrement?: boolean;
+      },
+    ): void;
+
+    /**
+     * Detect the user's browser and display a notification if it is below the minimum required version.
+     */
+    #detectBrowserVersion(): void;
+
+    /**
+     * Record a reference to a resolution notification ID so that we can remove it if the problem is remedied.
+     */
+    #resolutionTooLowNotification: number;
+
+    /**
+     * Detect the user's resolution and display a notification if it is too small.
+     */
+    #detectResolution(): void;
+
+    /**
+     * Detect and display warnings for known performance issues which may occur due to the user's hardware or browser
+     * configuration.
+     * @internal
+     */
+    _detectWebGLIssues(): void;
+
+    /**
+     * Add an invalid Document to the module-provided sub-type counts.
+     * @param documentName      - The Document name.
+     * @param source            - The Document's source data.
+     * @internal
+     *
+     * @remarks official documentation says "invalid", but the document can be valid, it is simply not yet validated.
+     */
+    _countDocumentSubType(
+      documentName: DocumentType,
+      source: unknown,
+      options?: {
+        /**
+         * Decrement the counter rather than incrementing it.
+         * @defaultValue `false`
+         */
+        decrement?: boolean;
+      },
+    ): void;
+
+    /**
+     * Track a validation failure that occurred in a WorldCollection.
+     * @param collection - The parent collection.
+     * @param source     - The Document's source data.
+     * @param error      - The validation error.
+     * @internal
+     */
+    _trackValidationFailures(
+      collection: WorldCollection<DocumentConstructor, string>,
+      source: unknown,
+      error: DataModelValidationError,
+    ): void;
+
+    /**
+     * Detect and record certain usability error messages which are likely to result in the user having a bad experience.
+     * @internal
+     */
+    _detectUsabilityIssues(): void;
+
+    /**
+     * Get the Document sub-type counts for a given module.
+     * @param module - The module or its ID.
+     */
+    getSubTypeCountsFor(module: Module | string): ModuleSubTypeCounts | undefined;
+
+    /**
+     * Retrieve all sub-type counts in the world.
+     */
+    getAllSubtypeCounts(): IterableIterator<[string, ModuleSubTypeCounts]>;
+
+    /**
+     * Retrieve the tracked validation failures.
+     */
+    get validationFailures(): Record<DocumentType, Record<string, { name: string; error: DataModelValidationError }>>;
+
+    /**
+     * Retrieve the tracked usability issues.
+     */
+    get usabilityIssues(): Record<string, ClientIssues.UsabilityIssue>;
+
+    /**
+     * Retrieve package compatibility issues.
+     */
+    get packageCompatibilityIssues(): { error: string[]; warning: string[] };
+  }
+
+  namespace ClientIssues {
+    interface BROWSER_TEST {
+      /** The minimum supported version for this browser. */
+      minimum: number;
+
+      /** A regular expression to match the browser against the user agent string. */
+      match: RegExp;
+
+      /** A message to display if the user's browser version does not meet the minimum. */
+      message: string;
+    }
+
+    interface UsabilityIssue {
+      /** The pre-localized message to display in relation to the usability issue. */
+      message: string;
+
+      /** The severity of the issue, either "error", "warning", or "info". */
+      severity: "error" | "warning" | "info";
+
+      /** Parameters to supply to the localization. */
+      params?: Record<string, object> | undefined;
+    }
+  }
+}
diff --git a/src/foundry/client/core/tooltip.d.mts b/src/foundry/client/core/tooltip.d.mts
index 9702ad6a9..67cb84409 100644
--- a/src/foundry/client/core/tooltip.d.mts
+++ b/src/foundry/client/core/tooltip.d.mts
@@ -94,9 +94,9 @@ declare global {
          */
         cssClass?: string;
         /** An optional boolean to lock the tooltip after creation. Defaults to false. */
-        locked: boolean;
+        locked?: boolean;
         /** Explicit HTML content to inject into the tooltip rather than using tooltip text. */
-        content: HTMLElement;
+        content?: HTMLElement;
       },
     ): void;
 
diff --git a/src/foundry/client/data/abstract/document-collection.d.mts b/src/foundry/client/data/abstract/document-collection.d.mts
index 758473df9..9b3812a6c 100644
--- a/src/foundry/client/data/abstract/document-collection.d.mts
+++ b/src/foundry/client/data/abstract/document-collection.d.mts
@@ -155,7 +155,7 @@ declare global {
          */
         exclude: string[];
       }>,
-    ): string[];
+    ): InstanceType<ConfiguredDocumentClass<T>>[];
 
     /**
      * Update all objects in this DocumentCollection with a provided transformation.
diff --git a/src/foundry/client/data/collections/compendium-collection.d.mts b/src/foundry/client/data/collections/compendium-collection.d.mts
index 230998e72..f489fc2c0 100644
--- a/src/foundry/client/data/collections/compendium-collection.d.mts
+++ b/src/foundry/client/data/collections/compendium-collection.d.mts
@@ -447,13 +447,16 @@ declare global {
     }
     interface Metadata {
       type: foundry.CONST.COMPENDIUM_DOCUMENT_TYPES;
-      id: string;
       name: string;
       label: string;
       path: string;
       private: boolean;
       package: string;
       system?: string;
+      /** Added by PackageCompendiumPacks#initialize */
+      id: string;
+      packageType: string;
+      packageName: string;
     }
 
     interface GetIndexOptions<T extends CompendiumCollection.Metadata> {
diff --git a/src/foundry/client/game.d.mts b/src/foundry/client/game.d.mts
index b384c0dd2..e2f40d9ee 100644
--- a/src/foundry/client/game.d.mts
+++ b/src/foundry/client/game.d.mts
@@ -7,25 +7,17 @@ import type {
 } from "../../types/helperTypes.d.mts";
 import type { StoredDocument, ValueOf } from "../../types/utils.d.mts";
 
-// TODO: Apps
-type ClientIssues = unknown;
-
-type EventsRan = {
-  none: "none";
-  init: "init";
-  i18nInit: "init" | "i18nInit";
-  setup: "init" | "i18nInit" | "setup";
-  ready: "init" | "i18nInit" | "setup" | "ready";
-};
+type InitializationEvent = "none" | "init" | "i18nInit" | "setup" | "ready";
 
-type InitializationEvent = keyof EventsRan;
+type InitializedWhen<Data, MustRun extends InitializationEvent, RunEvents extends InitializationEvent, D = undefined> =
+  Extract<RunEvents, MustRun> extends never ? D : Data;
 
-type InitializedWhen<
+type MaybeInitialized<Data, MustRun extends InitializationEvent> = InitializedWhen<
   Data,
-  InitializedWhen extends InitializationEvent,
-  Event extends InitializationEvent,
-  D = undefined,
-> = InitializedWhen extends EventsRan[Event] ? Data : "none" extends Event ? D : Data | D;
+  MustRun,
+  keyof AssumeHookRan,
+  Data | undefined
+>;
 
 declare class InternalGame<RunEvents extends InitializationEvent> {
   /**
@@ -129,9 +121,9 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
 
   /**
    * The user role permissions setting
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  readonly permissions: InitializedWhen<Game.Permissions, "ready", RunEvents>;
+  readonly permissions: InitializedWhen<Game.Permissions, "setup", RunEvents>;
 
   /**
    * The client session id which is currently active
@@ -216,7 +208,7 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
    * A flag for whether the Game has successfully reached the "ready" hook
    * @defaultValue `false`
    */
-  ready: boolean;
+  ready: InitializedWhen<true, "ready", RunEvents, false>;
 
   /**
    * Fetch World data and return a Game instance
@@ -297,64 +289,64 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
   initializeDocuments(): void;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  users?: InitializedWhen<ConfiguredCollectionClassForName<"User">, "ready", RunEvents>;
+  users: InitializedWhen<ConfiguredCollectionClassForName<"User">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  folders?: InitializedWhen<ConfiguredCollectionClassForName<"Folder">, "ready", RunEvents>;
+  folders: InitializedWhen<ConfiguredCollectionClassForName<"Folder">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  actors?: InitializedWhen<ConfiguredCollectionClassForName<"Actor">, "ready", RunEvents>;
+  actors: InitializedWhen<ConfiguredCollectionClassForName<"Actor">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  items?: InitializedWhen<ConfiguredCollectionClassForName<"Item">, "ready", RunEvents>;
+  items: InitializedWhen<ConfiguredCollectionClassForName<"Item">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  scenes?: InitializedWhen<ConfiguredCollectionClassForName<"Scene">, "ready", RunEvents>;
+  scenes: InitializedWhen<ConfiguredCollectionClassForName<"Scene">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  combats?: InitializedWhen<ConfiguredCollectionClassForName<"Combat">, "ready", RunEvents>;
+  combats: InitializedWhen<ConfiguredCollectionClassForName<"Combat">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  journal?: InitializedWhen<ConfiguredCollectionClassForName<"JournalEntry">, "ready", RunEvents>;
+  journal: InitializedWhen<ConfiguredCollectionClassForName<"JournalEntry">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  macros?: InitializedWhen<ConfiguredCollectionClassForName<"Macro">, "ready", RunEvents>;
+  macros: InitializedWhen<ConfiguredCollectionClassForName<"Macro">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  playlists?: InitializedWhen<ConfiguredCollectionClassForName<"Playlist">, "ready", RunEvents>;
+  playlists: InitializedWhen<ConfiguredCollectionClassForName<"Playlist">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  tables?: InitializedWhen<ConfiguredCollectionClassForName<"RollTable">, "ready", RunEvents>;
+  tables: InitializedWhen<ConfiguredCollectionClassForName<"RollTable">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  cards?: InitializedWhen<ConfiguredCollectionClassForName<"Cards">, "ready", RunEvents>;
+  cards: InitializedWhen<ConfiguredCollectionClassForName<"Cards">, "setup", RunEvents>;
 
   /**
-   * @remarks Initialized just before the `"ready"` hook event.
+   * @remarks Initialized just before the `"setup"` hook event.
    */
-  messages?: InitializedWhen<ConfiguredCollectionClassForName<"ChatMessage">, "ready", RunEvents>;
+  messages: InitializedWhen<ConfiguredCollectionClassForName<"ChatMessage">, "setup", RunEvents>;
 
   /**
    * Initialize the Compendium packs which are present within this Game
@@ -370,7 +362,7 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
   /**
    * @remarks Initialized just before the `"ready"` hook event.
    */
-  webrtc?: InitializedWhen<AVMaster, "ready", RunEvents>;
+  webrtc: InitializedWhen<AVMaster, "ready", RunEvents>;
 
   /**
    * Initialize core UI elements
@@ -549,16 +541,26 @@ declare class InternalGame<RunEvents extends InitializationEvent> {
   protected _initializeStreamView(): Promise<void>;
 }
 
+type _InitGame = Game & InternalGame<"init">;
+type _I18nInitGame = Game & InternalGame<"init" | "i18nInit">;
+type _SetupGame = Game & InternalGame<"init" | "i18nInit" | "setup">;
+type _ReadyGame = Game & InternalGame<"init" | "i18nInit" | "setup" | "ready">;
+
 declare global {
   /**
    * The core Game instance which encapsulates the data, settings, and states relevant for managing the game experience.
    * The singleton instance of the Game class is available as the global variable game.
    */
-  class Game extends InternalGame<never> {}
+  class Game extends InternalGame<any> {}
+
+  // These helper types show `Game` at different points in its life cycle.
+  // They're merged with `Game` to preserve the invariant `XYZGame instanceof Game`.
+  // They're interfaces for easier user declaration merges as well as to give intellisense better names to use as the expanded type is intimidating.
 
-  type I18nInitGame = InternalGame<"i18nInit">;
-  type SetupGame = InternalGame<"setup">;
-  type ReadyGame = InternalGame<"ready">;
+  interface InitGame extends _InitGame {}
+  interface I18nInitGame extends _I18nInitGame {}
+  interface SetupGame extends _SetupGame {}
+  interface ReadyGame extends _ReadyGame {}
 
   interface HotReloadData {
     /** The type of package which was modified */
diff --git a/src/foundry/client/head.d.mts b/src/foundry/client/head.d.mts
index 8c63766c0..9ec7d2af3 100644
--- a/src/foundry/client/head.d.mts
+++ b/src/foundry/client/head.d.mts
@@ -1,4 +1,38 @@
-import type { InitializedWhen, InternalGame } from "./game.d.mts";
+import type { InitializationEvent } from "./game.d.mts";
+
+type ValidRanHooks = Extract<keyof AssumeHookRan, InitializationEvent>;
+
+type EarlierEvents = {
+  none: never;
+  init: "none";
+  i18nInit: "none" | "init";
+  setup: "none" | "init" | "i18nInit";
+  ready: "none" | "init" | "i18nInit" | "setup";
+};
+
+// All earlier hooks can definitely be ignored since they're assumed to have ran.
+type CheckHooks = Exclude<InitializationEvent, EarlierEvents[ValidRanHooks]>;
+
+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 = {
+  none: UninitializedGame;
+  init: InitGame;
+  i18nInit: I18nInitGame;
+  setup: SetupGame;
+  ready: ReadyGame;
+};
+
+// Put in its own helper type to cause type distribution.
+type DiscriminatedGame<Event extends InitializationEvent> = Event extends unknown ? Games[Event] : never;
+
+type MaybeUI = keyof AssumeHookRan extends never
+  ? Partial<UiApplications>
+  : keyof AssumeHookRan extends "ready"
+    ? UiApplications
+    : Partial<UiApplications>;
 
 declare global {
   /**
@@ -12,7 +46,7 @@ declare global {
    * @remarks
    * Initialized just before the `"init"` hook event.
    */
-  let game: InitializedWhen<InternalGame<keyof AssumeHookRan>, "init", keyof AssumeHookRan, {}>;
+  let game: DiscriminatedGame<CheckHooks>;
 
   /**
    * The global boolean for whether the EULA is signed
@@ -48,7 +82,7 @@ declare global {
      * @defaultValue `{}`
      */
     windows: Record<number, Application>;
-  } & InitializedWhen<UiApplications, "init", keyof AssumeHookRan>;
+  } & MaybeUI;
 
   /**
    * The client side console logger
diff --git a/src/foundry/client/ui/dialog.d.mts b/src/foundry/client/ui/dialog.d.mts
index fd482c14c..4c6ae10f5 100644
--- a/src/foundry/client/ui/dialog.d.mts
+++ b/src/foundry/client/ui/dialog.d.mts
@@ -15,7 +15,7 @@ declare global {
     /**
      * A Font Awesome icon for the button
      */
-    icon: string;
+    icon?: string;
 
     /**
      * The label for the button
diff --git a/src/foundry/common/constants.d.mts b/src/foundry/common/constants.d.mts
index 67654850a..5998f0ae9 100644
--- a/src/foundry/common/constants.d.mts
+++ b/src/foundry/common/constants.d.mts
@@ -137,9 +137,9 @@ export declare const CANVAS_PERFORMANCE_MODES: Readonly<{
 export type CANVAS_PERFORMANCE_MODES = ValueOf<typeof CANVAS_PERFORMANCE_MODES>;
 
 /**
- * Valid Chat Message styles which affect how the message is presented in the chat log.
+ * Valid Chat Message types
  */
-export declare const CHAT_MESSAGE_STYLES: Readonly<{
+export declare const CHAT_MESSAGE_TYPES: Readonly<{
   /**
    * An uncategorized chat message
    */
@@ -163,20 +163,18 @@ export declare const CHAT_MESSAGE_STYLES: Readonly<{
   EMOTE: 3;
 
   /**
-   * @deprecated since v12
-   *
-   * @remarks Define rolls directly in ChatMessage#rolls instead.
+   * A message whispered to the target.
+   * If the user sending the message does not have the "Private Messages" permission, Gamemasters will be able to see the content of the message even if they were not a recipient.
+   * If the whisper's target is a character, the whisper will be sent to whoever controls the token.
    */
-  ROLL: 0;
+  WHISPER: 4;
 
   /**
-   * @deprecated since v12
-   *
-   * @remarks Define whispers directly in ChatMessage#whisper instead.
+   * A message that is a dice roll.
    */
-  WHISPER: 0;
+  ROLL: 5;
 }>;
-export type CHAT_MESSAGE_STYLES = ValueOf<typeof CHAT_MESSAGE_STYLES>;
+export type CHAT_MESSAGE_TYPES = ValueOf<typeof CHAT_MESSAGE_TYPES>;
 
 /**
  * Define the set of languages which have built-in support in the core software
@@ -209,19 +207,6 @@ export declare const COMPATIBILITY_MODES: Readonly<{
 }>;
 export type COMPATIBILITY_MODES = ValueOf<typeof COMPATIBILITY_MODES>;
 
-/**
- * The lighting illumination levels which are supported.
- */
-export declare const LIGHTING_LEVELS: Readonly<{
-  DARKNESS: -2;
-  HALFDARK: -1;
-  UNLIT: 0;
-  DIM: 1;
-  BRIGHT: 2;
-  BRIGHTEST: 3;
-}>;
-export type LIGHTING_LEVELS = ValueOf<typeof LIGHTING_LEVELS>;
-
 /**
  * The CSS themes which are currently supported for the V11 Setup menu.
  */
@@ -240,82 +225,27 @@ export declare const DEFAULT_TOKEN: "icons/svg/mystery-man.svg";
 /**
  * Define the allowed Document class types.
  */
-export declare const PRIMARY_DOCUMENT_TYPES: readonly [
+export declare const DOCUMENT_TYPES: readonly [
   "Actor",
-  "Adventure",
   "Cards",
   "ChatMessage",
   "Combat",
-  "FogExploration",
-  "Folder",
   "Item",
-  "JournalEntry",
-  "Macro",
-  "Playlist",
-  "RollTable",
-  "Scene",
-  "Setting",
-  "User",
-];
-export type PRIMARY_DOCUMENT_TYPES = ValueOf<typeof PRIMARY_DOCUMENT_TYPES>;
-
-/**
- * The embedded Document types.
- */
-export const EMBEDDED_DOCUMENT_TYPES: readonly [
-  "ActiveEffect",
-  "ActorDelta",
-  "AmbientLight",
-  "AmbientSound",
-  "Card",
-  "Combatant",
-  "Drawing",
-  "Item",
-  "JournalEntryPage",
-  "MeasuredTemplate",
-  "Note",
-  "PlaylistSound",
-  "Region",
-  "RegionBehavior",
-  "TableResult",
-  "Tile",
-  "Token",
-  "Wall",
-];
-export type EMBEDDED_DOCUMENT_TYPES = ValueOf<typeof EMBEDDED_DOCUMENT_TYPES>;
-
-/**
- * A listing of all valid Document types, both primary and embedded.
- */
-export type ALL_DOCUMENT_TYPES = PRIMARY_DOCUMENT_TYPES | EMBEDDED_DOCUMENT_TYPES;
-
-/**
- * The allowed primary Document types which may exist within a World.
- */
-export declare const WORLD_DOCUMENT_TYPES: readonly [
-  "Actor",
-  "Cards",
-  "ChatMessage",
-  "Combat",
-  "FogExploration",
   "Folder",
-  "Item",
   "JournalEntry",
   "Macro",
   "Playlist",
   "RollTable",
   "Scene",
-  "Setting",
   "User",
 ];
-export type WORLD_DOCUMENT_TYPES = ValueOf<typeof WORLD_DOCUMENT_TYPES>;
+export type DOCUMENT_TYPES = ValueOf<typeof DOCUMENT_TYPES>;
 
 /**
- * The allowed primary Document types which may exist within a Compendium pack.
+ * The allowed Document types which may exist within a Compendium pack.
  */
 export declare const COMPENDIUM_DOCUMENT_TYPES: readonly [
   "Actor",
-  "Adventure",
   "Cards",
   "Item",
   "JournalEntry",
@@ -323,6 +253,7 @@ export declare const COMPENDIUM_DOCUMENT_TYPES: readonly [
   "Playlist",
   "RollTable",
   "Scene",
+  "Adventure",
 ];
 export type COMPENDIUM_DOCUMENT_TYPES = ValueOf<typeof COMPENDIUM_DOCUMENT_TYPES>;
 
@@ -369,6 +300,13 @@ export declare const DOCUMENT_META_OWNERSHIP_LEVELS: Readonly<{
 }>;
 export type DOCUMENT_META_OWNERSHIP_LEVELS = ValueOf<typeof DOCUMENT_META_OWNERSHIP_LEVELS>;
 
+/**
+ * @deprecated since v10, will be removed in v12
+ * @see CONST.DOCUMENT_OWNERSHIP_LEVELS
+ */
+export declare const DOCUMENT_PERMISSION_LEVELS: typeof DOCUMENT_OWNERSHIP_LEVELS;
+export type DOCUMENT_PERMISSION_LEVELS = DOCUMENT_OWNERSHIP_LEVELS;
+
 /**
  * Define the allowed Document types which may be dynamically linked in chat
  */
@@ -460,25 +398,10 @@ export declare const FOLDER_MAX_DEPTH: 4;
  */
 export declare const GAME_VIEWS: readonly ["game", "stream"];
 
-/**
- * The directions of movement.
- */
-export declare const MOVEMENT_DIRECTIONS: Readonly<{
-  UP: 0x1;
-  DOWN: 0x2;
-  LEFT: 0x4;
-  RIGHT: 0x8;
-  UP_LEFT: 0x1 | 0x4;
-  UP_RIGHT: 0x1 | 0x8;
-  DOWN_LEFT: 0x2 | 0x4;
-  DOWN_RIGHT: 0x2 | 0x8;
-}>;
-export type MOVEMENT_DIRECTIONS = ValueOf<typeof MOVEMENT_DIRECTIONS>;
-
 /**
  * The minimum allowed grid size which is supported by the software
  */
-export declare const GRID_MIN_SIZE: 20;
+export declare const GRID_MIN_SIZE: 50;
 
 /**
  * The allowed Grid types which are supported by the software
@@ -496,169 +419,27 @@ export declare const GRID_TYPES: Readonly<{
   SQUARE: 1;
 
   /**
-   * A row-wise hexagon grid (pointy-topped) where odd-numbered rows are offset.
+   * A column-wise hexagon grid (flat-topped) where odd-numbered rows are offset.
    */
   HEXODDR: 2;
 
   /**
-   * A row-wise hexagon grid (pointy-topped) where even-numbered rows are offset.
+   * A column-wise hexagon grid (flat-topped) where even-numbered rows are offset.
    */
   HEXEVENR: 3;
 
   /**
-   * A column-wise hexagon grid (flat-topped) where odd-numbered columns are offset.
+   * A row-wise hexagon grid (pointy-topped) where odd-numbered columns are offset.
    */
   HEXODDQ: 4;
 
   /**
-   * A column-wise hexagon grid (flat-topped) where even-numbered columns are offset.
+   * A row-wise hexagon grid (pointy-topped) where even-numbered columns are offset.
    */
   HEXEVENQ: 5;
 }>;
 export type GRID_TYPES = ValueOf<typeof GRID_TYPES>;
 
-/**
- * The different rules to define and measure diagonal distance/cost in a square grid.
- * The description of each option refers to the distance/cost of moving diagonally relative to the distance/cost of a horizontal or vertical move.
- */
-export declare const GRID_DIAGONALS: Readonly<{
-  /**
-   * The diagonal distance is 1. Diagonal movement costs the same as horizontal/vertical movement.
-   */
-  EQUIDISTANT: 0;
-
-  /**
-   * The diagonal distance is √2. Diagonal movement costs √2 times as much as horizontal/vertical movement.
-   */
-  EXACT: 1;
-
-  /**
-   * The diagonal distance is 1.5. Diagonal movement costs 1.5 times as much as horizontal/vertical movement.
-   */
-  APPROXIMATE: 2;
-
-  /**
-   * The diagonal distance is 2. Diagonal movement costs 2 times as much as horizontal/vertical movement.
-   */
-  RECTILINEAR: 3;
-
-  /**
-   * The diagonal distance alternates between 1 and 2 starting at 1.
-   * The first diagonal movement costs the same as horizontal/vertical movement
-   * The second diagonal movement costs 2 times as much as horizontal/vertical movement.
-   * And so on...
-   */
-  ALTERNATING_1: 4;
-
-  /**
-   * The diagonal distance alternates between 2 and 1 starting at 2.
-   * The first diagonal movement costs 2 times as much as horizontal/vertical movement.
-   * The second diagonal movement costs the same as horizontal/vertical movement.
-   * And so on...
-   */
-  ALTERNATING_2: 5;
-
-  /**
-   * The diagonal distance is ∞. Diagonal movement is not allowed/possible.
-   */
-  ILLEGAL: 6;
-}>;
-export type GRID_DIAGONALS = ValueOf<typeof GRID_DIAGONALS>;
-
-/**
- * The grid snapping modes.
- */
-export declare const GRID_SNAPPING_MODES: Readonly<{
-  /**
-   * Nearest center point.
-   */
-  CENTER: 0x1;
-
-  /**
-   * Nearest edge midpoint.
-   */
-  EDGE_MIDPOINT: 0x2;
-
-  /**
-   * Nearest top-left vertex.
-   */
-  TOP_LEFT_VERTEX: 0x10;
-
-  /**
-   * Nearest top-right vertex.
-   */
-  TOP_RIGHT_VERTEX: 0x20;
-
-  /**
-   * Nearest bottom-left vertex.
-   */
-  BOTTOM_LEFT_VERTEX: 0x40;
-
-  /**
-   * Nearest bottom-right vertex.
-   */
-  BOTTOM_RIGHT_VERTEX: 0x80;
-
-  /**
-   * Nearest vertex.
-   * Alias for `TOP_LEFT_VERTEX | TOP_RIGHT_VERTEX | BOTTOM_LEFT_VERTEX | BOTTOM_RIGHT_VERTEX`.
-   */
-  VERTEX: 0xf0;
-
-  /**
-   * Nearest top-left corner.
-   */
-  TOP_LEFT_CORNER: 0x100;
-
-  /**
-   * Nearest top-right corner.
-   */
-  TOP_RIGHT_CORNER: 0x200;
-
-  /**
-   * Nearest bottom-left corner.
-   */
-  BOTTOM_LEFT_CORNER: 0x400;
-
-  /**
-   * Nearest bottom-right corner.
-   */
-  BOTTOM_RIGHT_CORNER: 0x800;
-
-  /**
-   * Nearest corner.
-   * Alias for `TOP_LEFT_CORNER | TOP_RIGHT_CORNER | BOTTOM_LEFT_CORNER | BOTTOM_RIGHT_CORNER`.
-   */
-  CORNER: 0xf00;
-
-  /**
-   * Nearest top side midpoint.
-   */
-  TOP_SIDE_MIDPOINT: 0x1000;
-
-  /**
-   * Nearest bottom side midpoint.
-   */
-  BOTTOM_SIDE_MIDPOINT: 0x2000;
-
-  /**
-   * Nearest left side midpoint.
-   */
-  LEFT_SIDE_MIDPOINT: 0x4000;
-
-  /**
-   * Nearest right side midpoint.
-   */
-  RIGHT_SIDE_MIDPOINT: 0x8000;
-
-  /**
-   * Nearest side midpoint.
-   * Alias for `TOP_SIDE_MIDPOINT | BOTTOM_SIDE_MIDPOINT | LEFT_SIDE_MIDPOINT | RIGHT_SIDE_MIDPOINT`.
-   */
-  SIDE_MIDPOINT: 0xf000;
-}>;
-export type GRID_SNAPPING_MODES = ValueOf<typeof GRID_SNAPPING_MODES>;
-
 /**
  * A list of supported setup URL names
  */
@@ -687,16 +468,6 @@ export declare const MACRO_TYPES: Readonly<{
 }>;
 export type MACRO_TYPES = ValueOf<typeof MACRO_TYPES>;
 
-/**
- * The allowed channels for audio playback.
- */
-export declare const AUDIO_CHANNELS: Readonly<{
-  music: "AUDIO.CHANNELS.MUSIC.label";
-  environment: "AUDIO.CHANNELS.ENVIRONMENT.label";
-  interface: "AUDIO.CHANNELS.INTERFACE.label";
-}>;
-export type AUDIO_CHANNELS = ValueOf<typeof AUDIO_CHANNELS>;
-
 /**
  * The allowed playback modes for an audio Playlist
  * @see https://foundryvtt.com/article/playlists/
@@ -863,17 +634,17 @@ export declare const TABLE_RESULT_TYPES: Readonly<{
   /**
    *  Plain text or HTML scripted entries which will be output to Chat.
    */
-  TEXT: "text";
+  TEXT: 0;
 
   /**
    * An in-World Document reference which will be linked to in the chat message.
    */
-  DOCUMENT: "document";
+  DOCUMENT: 1;
 
   /**
    * A Compendium Pack reference which will be linked to in the chat message.
    */
-  COMPENDIUM: "pack";
+  COMPENDIUM: 2;
 }>;
 export type TABLE_RESULT_TYPES = ValueOf<typeof TABLE_RESULT_TYPES>;
 
@@ -927,7 +698,7 @@ export declare const TEXT_ANCHOR_POINTS: Readonly<{
 export type TEXT_ANCHOR_POINTS = ValueOf<typeof TEXT_ANCHOR_POINTS>;
 
 /**
- * Define the valid occlusion modes which a tile can use
+ * Define the valid occlusion modes which an overhead tile can use
  * @defaultValue `1`
  * @see https://foundryvtt.com/article/tiles/
  */
@@ -964,37 +735,6 @@ export type OCCLUSION_MODES = ValueOf<typeof OCCLUSION_MODES>;
 export declare const TILE_OCCLUSION_MODES: typeof OCCLUSION_MODES;
 export type TILE_OCCLUSION_MODES = ValueOf<typeof TILE_OCCLUSION_MODES>;
 
-/**
- * The occlusion modes that define the set of tokens that trigger occlusion.
- */
-export declare const TOKEN_OCCLUSION_MODES: Readonly<{
-  /**
-   * Owned tokens that aren't hidden.
-   */
-  OWNED: 0x1;
-
-  /**
-   * Controlled tokens.
-   */
-  CONTROLLED: 0x2;
-
-  /**
-   * Hovered tokens that are visible.
-   */
-  HOVERED: 0x4;
-
-  /**
-   * Highlighted tokens that are visible.
-   */
-  HIGHLIGHTED: 0x8;
-
-  /**
-   * All visible tokens.
-   */
-  VISIBLE: 0x10;
-}>;
-export type TOKEN_OCCLUSION_MODES = ValueOf<typeof TOKEN_OCCLUSION_MODES>;
-
 /**
  * Describe the various thresholds of token control upon which to show certain pieces of information
  * @see https://foundryvtt.com/article/tokens/
@@ -1059,42 +799,6 @@ export declare const TOKEN_DISPOSITIONS: Readonly<{
 }>;
 export type TOKEN_DISPOSITIONS = ValueOf<typeof TOKEN_DISPOSITIONS>;
 
-/**
- * The possible shapes of Tokens in hexagonal grids.
- */
-export declare const TOKEN_HEXAGONAL_SHAPES: Readonly<{
-  /**
-   * Ellipse (Variant 1)
-   */
-  ELLIPSE_1: 0;
-
-  /**
-   * Ellipse (Variant 2)
-   */
-  ELLIPSE_2: 1;
-
-  /**
-   * Trapezoid (Variant 1)
-   */
-  TRAPEZOID_1: 2;
-
-  /**
-   * Trapezoid (Variant 2)
-   */
-  TRAPEZOID_2: 3;
-
-  /**
-   * Rectangle (Variant 1)
-   */
-  RECTANGLE_1: 4;
-
-  /**
-   * Rectangle (Variant 2)
-   */
-  RECTANGLE_2: 5;
-}>;
-export type TOKEN_HEXAGONAL_SHAPES = ValueOf<typeof TOKEN_HEXAGONAL_SHAPES>;
-
 /**
  * Define the allowed User permission levels.
  * Each level is assigned a value in ascending order. Higher levels grant more permissions.
@@ -1306,19 +1010,6 @@ export declare const USER_PERMISSIONS: Readonly<{
    */
   MACRO_SCRIPT: UserPermission;
 
-  /**
-   * @defaultValue
-   * ```typescript
-   * {
-   *    label: "PERMISSION.ManualRolls",
-   *    hint: "PERMISSION.ManualRollsHint",
-   *    disableGM: true,
-   *    defaultRole: USER_ROLES.TRUSTED
-   * }
-   * ```
-   */
-  MANUAL_ROLLS: UserPermission;
-
   /**
    * @defaultValue
    * ```typescript
@@ -1358,19 +1049,6 @@ export declare const USER_PERMISSIONS: Readonly<{
    */
   PING_CANVAS: UserPermission;
 
-  /**
-   * @defaultValue
-   * ```typescript
-   * {
-   *   label: "PERMISSION.PlaylistCreate",
-   *   hint: "PERMISSION.PlaylistCreateHint",
-   *   disableGM: false,
-   *   defaultRole: USER_ROLES.ASSISTANT
-   * }
-   * ```
-   */
-  PLAYLIST_CREATE: UserPermission;
-
   /**
    * @defaultValue
    * ```typescript
@@ -1816,23 +1494,7 @@ export type SHOWDOWN_OPTIONS = ValueOf<typeof SHOWDOWN_OPTIONS>;
  * The list of allowed attributes in HTML elements.
  */
 export const ALLOWED_HTML_ATTRIBUTES: Readonly<{
-  "*": [
-    "class",
-    "data-*",
-    "id",
-    "title",
-    "style",
-    "draggable",
-    "aria-*",
-    "tabindex",
-    "dir",
-    "hidden",
-    "inert",
-    "role",
-    "is",
-    "lang",
-    "popover",
-  ];
+  "*": ["class", "data-*", "id", "title", "style", "draggable", "aria-*", "tabindex", "dir"];
   a: ["href", "name", "target", "rel"];
   area: ["alt", "coords", "href", "rel", "shape", "target"];
   audio: ["controls", "loop", "muted", "src", "autoplay"];
@@ -1913,16 +1575,13 @@ export declare const SETUP_PACKAGE_PROGRESS: Readonly<{
     INSTALL_PKG: "installPackage";
     LAUNCH_WORLD: "launchWorld";
     UPDATE_CORE: "updateCore";
-    UPDATE_DOWNLOAD: "updateDownload";
   };
 
   STEPS: {
     ARCHIVE: "archive";
     CHECK_DISK_SPACE: "checkDiskSpace";
     CONNECT_WORLD: "connectWorld";
-    MIGRATE_WORLD: "migrateWorld";
     CONNECT_PKG: "connectPackage";
-    MIGRATE_PKG: "migratePackage";
     MIGRATE_CORE: "migrateCore";
     MIGRATE_SYSTEM: "migrateSystem";
     DOWNLOAD: "download";
@@ -1944,110 +1603,23 @@ export namespace SETUP_PACKAGE_PROGRESS {
 }
 
 /**
- * The combat announcements.
- */
-export declare const COMBAT_ANNOUNCEMENTS: readonly ["startEncounter", "nextUp", "yourTurn"];
-export type COMBAT_ANNOUNCEMENTS = ValueOf<typeof COMBAT_ANNOUNCEMENTS>;
-
-/**
- * The fit modes of {@link foundry.data.TextureData#fit}.
+ * @deprecated since v10, will be removed in v12
+ * @see {@link foundry.data.ShapeData.TYPES}
  */
-export declare const TEXTURE_DATA_FIT_MODES: readonly ["fill", "contain", "cover", "width", "height"];
-export type TEXTURE_DATA_FIT_MODES = ValueOf<typeof TEXTURE_DATA_FIT_MODES>;
-
-/**
- * The maximum depth to recurse to when embedding enriched text.
- */
-export const TEXT_ENRICH_EMBED_MAX_DEPTH = 5;
-
-/**
- * The Region events that are supported by core.
- */
-export declare const REGION_EVENTS: Readonly<{
-  /**
-   * Triggered when the shapes or bottom/top elevation of the Region are changed.
-   */
-  REGION_BOUNDARY: "regionBoundary";
-
-  /**
-   * Triggered when the behavior is enabled/disabled or the Scene its Region is in is viewed/unviewed.
-   */
-  BEHAVIOR_STATUS: "behaviorStatus";
-
-  /**
-   * Triggered when a Token enters a Region.
-   */
-  TOKEN_ENTER: "tokenEnter";
-
-  /**
-   * Triggered when a Token exists a Region.
-   */
-  TOKEN_EXIT: "tokenExit";
-
-  /**
-   * Triggered when a Token is about to move into, out of, through, or within a Region.
-   */
-  TOKEN_PRE_MOVE: "tokenPreMove";
-
-  /**
-   * Triggered when a Token moves into, out of, through, or within a Region.
-   */
-  TOKEN_MOVE: "tokenMove";
-
-  /**
-   * Triggered when a Token moves into a Region.
-   */
-  TOKEN_MOVE_IN: "tokenMoveIn";
-
-  /**
-   * Triggered when a Token moves out of a Region.
-   */
-  TOKEN_MOVE_OUT: "tokenMoveOut";
-
-  /**
-   * Triggered when a Token starts its Combat turn in a Region.
-   */
-  TOKEN_TURN_START: "tokenTurnStart";
-
-  /**
-   * Triggered when a Token ends its Combat turn in a Region.
-   */
-  TOKEN_TURN_END: "tokenTurnEnd";
-
-  /**
-   * Triggered when a Token starts the Combat round in a Region.
-   */
-  TOKEN_ROUND_START: "tokenRoundStart";
-
-  /**
-   * Triggered when a Token ends the Combat round in a Region.
-   */
-  TOKEN_ROUND_END: "tokenRoundEnd";
+export declare const DRAWING_TYPES: Readonly<{
+  RECTANGLE: "r";
+  ELLIPSE: "e";
+  TEXT: "t";
+  POLYGON: "p";
+  FREEHAND: "f";
 }>;
-export type REGION_EVENTS = ValueOf<typeof REGION_EVENTS>;
-
 /**
- * The possible visibility state of Region.
+ * @deprecated since v10, will be removed in v12
  */
-export declare const REGION_VISIBILITY: Readonly<{
-  /**
-   * Only visible on the RegionLayer.
-   */
-  LAYER: 0;
-
-  /**
-   * Only visible to Gamemasters.
-   */
-  GAMEMASTER: 1;
-
-  /**
-   * Visible to anyone.
-   */
-  ALWAYS: 2;
-}>;
-export type REGION_VISIBILITY = ValueOf<typeof REGION_VISIBILITY>;
+export type DRAWING_TYPES = ValueOf<typeof DRAWING_TYPES>;
 
 /**
- * @deprecated since v12
+ * The combat announcements.
  */
-export type DOCUMENT_TYPES = Exclude<WORLD_DOCUMENT_TYPES, "FogExploration" | "Setting">;
+export declare const COMBAT_ANNOUNCEMENTS: readonly ["startEncounter", "nextUp", "yourTurn"];
+export type COMBAT_ANNOUNCEMENTS = ValueOf<typeof COMBAT_ANNOUNCEMENTS>;
diff --git a/src/foundry/common/data/fields.d.mts b/src/foundry/common/data/fields.d.mts
index 68ce7997f..f89cba6a8 100644
--- a/src/foundry/common/data/fields.d.mts
+++ b/src/foundry/common/data/fields.d.mts
@@ -3,7 +3,7 @@ import type {
   ConfiguredDocumentClassForName,
   ConfiguredFlags,
 } from "../../../types/helperTypes.mts";
-import type { RemoveIndexSignatures, ConstructorOf, SimpleMerge } from "../../../types/utils.d.mts";
+import type { RemoveIndexSignatures, ConstructorOf, SimpleMerge, ValueOf } from "../../../types/utils.d.mts";
 import type { DataModel } from "../abstract/data.mts";
 import type Document from "../abstract/document.mts";
 import type { EmbeddedCollection, EmbeddedCollectionDelta } from "../abstract/module.d.mts";
@@ -3088,17 +3088,17 @@ declare namespace DocumentStatsField {
  * InitialValue: `{}`
  */
 declare class TypeDataField<
-  const DocumentType extends Document.Any,
-  const Options extends TypeDataField.Options<DocumentType> = TypeDataField.DefaultOptions,
-  const AssignmentType = TypeDataField.AssignmentType<DocumentType, Options>,
-  const InitializedType = TypeDataField.InitializedType<DocumentType, Options>,
-  const PersistedType extends object | null | undefined = TypeDataField.PersistedType<DocumentType, Options>,
+  const SystemDocument extends Document.SystemConstructor,
+  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>,
 > extends ObjectField<Options, AssignmentType, InitializedType, PersistedType> {
   /**
    * @param document - The base document class which belongs in this field
    * @param options  - Options which configure the behavior of the field
    */
-  constructor(document: ConstructorOf<DocumentType>, options?: Options);
+  constructor(document: ConstructorOf<SystemDocument>, options?: Options);
 
   /** @defaultValue `true` */
   override required: boolean;
@@ -3106,7 +3106,7 @@ declare class TypeDataField<
   /**
    * The canonical document name of the document type which belongs in this field
    */
-  document: ConstructorOf<DocumentType>;
+  document: ConstructorOf<SystemDocument>;
 
   protected static override get _defaults(): TypeDataField.Options<Document.Any>;
 
@@ -3219,12 +3219,9 @@ declare namespace TypeDataField {
    * @typeParam Options - the options that override the default options
    */
   type AssignmentType<
-    DocumentType extends Document.Any,
-    Opts extends Options<DocumentType>,
-  > = DataField.DerivedAssignmentType<
-    SchemaField.InnerAssignmentType<DataModel.SchemaFor<DocumentType>>,
-    MergedOptions<DocumentType, Opts>
-  >;
+    SystemDocumentConstructor extends Document.SystemConstructor,
+    Opts extends Options<InstanceType<SystemDocumentConstructor>>,
+  > = DataField.DerivedAssignmentType<object, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
 
   /**
    * A shorthand for the initialized type of a TypeDataField class.
@@ -3232,11 +3229,11 @@ declare namespace TypeDataField {
    * @typeParam Options - the options that override the default options
    */
   type InitializedType<
-    DocumentType extends Document.Any,
-    Opts extends Options<DocumentType>,
+    SystemDocumentConstructor extends Document.SystemConstructor,
+    Opts extends Options<InstanceType<SystemDocumentConstructor>>,
   > = DataField.DerivedInitializedType<
-    SchemaField.InnerInitializedType<DataModel.SchemaFor<DocumentType>>,
-    MergedOptions<DocumentType, Opts>
+    ValueOf<Config<SystemDocumentConstructor>> | object,
+    MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>
   >;
 
   /**
@@ -3245,12 +3242,9 @@ declare namespace TypeDataField {
    * @typeParam Opts         - the options that override the default options
    */
   type PersistedType<
-    DocumentType extends Document.Any,
-    Opts extends Options<DocumentType>,
-  > = DataField.DerivedInitializedType<
-    SchemaField.InnerPersistedType<DataModel.SchemaFor<DocumentType>>,
-    MergedOptions<DocumentType, Opts>
-  >;
+    SystemDocumentConstructor extends Document.SystemConstructor,
+    Opts extends Options<InstanceType<SystemDocumentConstructor>>,
+  > = DataField.DerivedInitializedType<object, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
 }
 
 /**
@@ -3286,7 +3280,9 @@ declare namespace ModelValidationError {
 /**
  * @deprecated since v10, will be removed in v12
  */
-export function systemDataField<const D extends Document.Any>(document: D): TypeDataField<D>;
+export function systemDataField<const D extends Document.SystemConstructor>(
+  document: InstanceType<D>,
+): TypeDataField<D>;
 
 /**
  * @deprecated since v10, will be removed in v12
diff --git a/src/foundry/common/documents/actor.d.mts b/src/foundry/common/documents/actor.d.mts
index 39df38bc1..6bfbd3fe7 100644
--- a/src/foundry/common/documents/actor.d.mts
+++ b/src/foundry/common/documents/actor.d.mts
@@ -72,7 +72,7 @@ declare namespace BaseActor {
      * The system data object which is defined by the system template.json model
      * @defaultValue `{}`
      */
-    system: fields.TypeDataField<BaseActor>;
+    system: fields.TypeDataField<typeof BaseActor>;
 
     /**
      * Default Token settings which are used for Tokens created from this Actor
diff --git a/src/foundry/common/documents/card.d.mts b/src/foundry/common/documents/card.d.mts
index 245988ccb..5151986af 100644
--- a/src/foundry/common/documents/card.d.mts
+++ b/src/foundry/common/documents/card.d.mts
@@ -136,7 +136,7 @@ declare namespace BaseCard {
      * Game system data which is defined by the system template.json model
      * @defaultValue `{}`
      */
-    system: fields.TypeDataField<BaseCard>;
+    system: fields.TypeDataField<typeof BaseCard>;
 
     /**
      * An optional suit designation which is used by default sorting
diff --git a/src/foundry/common/documents/cards.d.mts b/src/foundry/common/documents/cards.d.mts
index 990d742eb..f0a854de7 100644
--- a/src/foundry/common/documents/cards.d.mts
+++ b/src/foundry/common/documents/cards.d.mts
@@ -121,7 +121,7 @@ declare namespace BaseCards {
      * Game system data which is defined by the system template.json model
      * @defaultValue `{}`
      */
-    system: fields.TypeDataField<BaseCards>;
+    system: fields.TypeDataField<typeof BaseCards>;
 
     /**
      * A collection of Card documents which currently belong to this stack
diff --git a/src/foundry/common/documents/chat-message.d.mts b/src/foundry/common/documents/chat-message.d.mts
index 326d646aa..a27b59523 100644
--- a/src/foundry/common/documents/chat-message.d.mts
+++ b/src/foundry/common/documents/chat-message.d.mts
@@ -101,8 +101,8 @@ declare namespace BaseChatMessage {
      */
     type: fields.NumberField<{
       required: true;
-      choices: CONST.CHAT_MESSAGE_STYLES[];
-      initial: typeof CONST.CHAT_MESSAGE_STYLES.OTHER;
+      choices: CONST.CHAT_MESSAGE_TYPES[];
+      initial: typeof CONST.CHAT_MESSAGE_TYPES.OTHER;
       validationError: "must be a value in CONST.CHAT_MESSAGE_TYPES";
     }>;
 
diff --git a/src/foundry/common/documents/item.d.mts b/src/foundry/common/documents/item.d.mts
index 506e734a0..42dfea2e1 100644
--- a/src/foundry/common/documents/item.d.mts
+++ b/src/foundry/common/documents/item.d.mts
@@ -136,7 +136,7 @@ declare namespace BaseItem {
      * The system data object which is defined by the system template.json model
      * @defaultValue `{}`
      */
-    system: fields.TypeDataField<BaseItem>;
+    system: fields.TypeDataField<typeof BaseItem>;
 
     /**
      * A collection of ActiveEffect embedded Documents
diff --git a/src/foundry/common/documents/journal-entry-page.d.mts b/src/foundry/common/documents/journal-entry-page.d.mts
index 021f64d77..3c2f7f482 100644
--- a/src/foundry/common/documents/journal-entry-page.d.mts
+++ b/src/foundry/common/documents/journal-entry-page.d.mts
@@ -212,7 +212,7 @@ declare namespace BaseJournalEntryPage {
      * System-specific data.
      * @defaultValue `{}`
      */
-    system: fields.TypeDataField<BaseJournalEntryPage>;
+    system: fields.TypeDataField<typeof BaseJournalEntryPage>;
 
     /**
      * The numeric sort value which orders this page relative to its siblings.
diff --git a/src/foundry/common/utils/event-emitter.d.mts b/src/foundry/common/utils/event-emitter.d.mts
deleted file mode 100644
index e5d11ef2b..000000000
--- a/src/foundry/common/utils/event-emitter.d.mts
+++ /dev/null
@@ -1,59 +0,0 @@
-import type { InexactPartial, Mixin } from "../../../types/utils.d.mts";
-
-declare global {
-  type EmittedEventListener = (event: Event) => any;
-}
-
-/**
- * A mixin class which implements the behavior of EventTarget.
- * This is useful in cases where a class wants EventTarget-like behavior but needs to extend some other class.
- * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
- */
-declare class EventEmitter {
-  /**
-   * An array of event types which are valid for this class.
-   */
-  static emittedEvents: string[];
-
-  /**
-   * Add a new event listener for a certain type of event.
-   * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
-   * @param type     - The type of event being registered for
-   * @param listener - The listener function called when the event occurs
-   * @param options  - Options which configure the event listener
-   */
-  addEventListener(
-    type: string,
-    listener: EmittedEventListener,
-    options?: InexactPartial<{
-      /**
-       * Should the event only be responded to once and then removed
-       * @defaultValue `false`
-       */
-      once: boolean;
-    }>,
-  ): void;
-
-  /**
-   * Remove an event listener for a certain type of event.
-   * @param type     - The type of event being removed
-   * @param listener - The listener function being removed
-   */
-  removeEventListener(type: string, listener: EmittedEventListener): void;
-
-  /**
-   * Dispatch an event on this target.
-   * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent
-   * @param event - The Event to dispatch
-   * @returns Was default behavior for the event prevented?
-   */
-  dispatchEvent(event: Event): boolean;
-}
-
-/**
- * Augment a base class with EventEmitter behavior.
- * @param BaseClass - Some base class augmented with event emitter functionality
- */
-export default function EventEmitterMixin<ExtendedClass extends abstract new (...args: any[]) => any>(
-  BaseClass: ExtendedClass,
-): Mixin<typeof EventEmitter, ExtendedClass>;
diff --git a/src/foundry/common/utils/module.d.mts b/src/foundry/common/utils/module.d.mts
index c005ff62b..ac10fc337 100644
--- a/src/foundry/common/utils/module.d.mts
+++ b/src/foundry/common/utils/module.d.mts
@@ -3,7 +3,6 @@ export * from "./helpers.mts";
 export * from "./http.mts";
 export * from "./logging.mts";
 export { default as Collection } from "./collection.mts";
-export { default as EventEmitterMixin } from "./event-emitter.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";
diff --git a/src/foundry/index.d.mts b/src/foundry/index.d.mts
index e8bb15959..ab70e5a7b 100644
--- a/src/foundry/index.d.mts
+++ b/src/foundry/index.d.mts
@@ -1,5 +1,4 @@
 import "./client/index.d.mts";
-import "./client-esm/client.d.mts";
 import "./clipper/index.d.mts";
 import "./common/module.d.mts";
 import "./prosemirror/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 17e5eb270..f7f60b53e 100644
--- a/tests/foundry/client/data/documents/item.test-d.ts
+++ b/tests/foundry/client/data/documents/item.test-d.ts
@@ -33,6 +33,7 @@ if (item) {
   expectTypeOf(item.transferredEffects).toEqualTypeOf<ActiveEffect[]>();
   expectTypeOf(item.type).toEqualTypeOf<"weapon" | "armor" | "base">();
   expectTypeOf(item.getRollData()).toEqualTypeOf<object>();
+  expectTypeOf(item.system).toEqualTypeOf<WeaponData | ArmorData | object>();
 
   if (item.system instanceof WeaponData) {
     expectTypeOf(item.system.attack).toEqualTypeOf<number | null | undefined>();
diff --git a/tests/foundry/client/game.test-d.ts b/tests/foundry/client/game.test-d.ts
index 23f5b08dd..2b5f87899 100644
--- a/tests/foundry/client/game.test-d.ts
+++ b/tests/foundry/client/game.test-d.ts
@@ -60,3 +60,28 @@ const requiredApiModule = aGame.modules.get("required-api-module");
 
 expectTypeOf(requiredApiModule).toEqualTypeOf<Module & ModuleConfig["required-api-module"]>();
 expectTypeOf(requiredApiModule.hooks.triggerDialog(5)).toEqualTypeOf<void>();
+
+declare global {
+  interface Game {
+    declarationMergingWorks: number;
+  }
+
+  interface ReadyGame {
+    onlyInReady: string;
+  }
+}
+
+expectTypeOf(game.declarationMergingWorks).toEqualTypeOf<number | undefined>();
+
+if (game instanceof Game) {
+  expectTypeOf(game.declarationMergingWorks).toEqualTypeOf<number>();
+
+  // @ts-expect-error - game is not guaranteed to be ready yet.
+  // Arguably it shouldn't be a hard error, just undefined.
+  game.onlyInReady;
+}
+
+if (game.ready) {
+  expectTypeOf(game.declarationMergingWorks).toEqualTypeOf<number>();
+  expectTypeOf(game.onlyInReady).toEqualTypeOf<string>();
+}
diff --git a/tests/foundry/client/head.test-d.ts b/tests/foundry/client/head.test-d.ts
index e697665f6..d71d551b0 100644
--- a/tests/foundry/client/head.test-d.ts
+++ b/tests/foundry/client/head.test-d.ts
@@ -1,7 +1,9 @@
 import { expectTypeOf } from "vitest";
 
-expectTypeOf(game).toEqualTypeOf<Game | {}>();
-expectTypeOf(ui.menu).toEqualTypeOf<MainMenu>();
+type UninitializedGame = { [K in keyof Game]?: never };
+
+expectTypeOf(game).toEqualTypeOf<UninitializedGame | I18nInitGame | InitGame | SetupGame | ReadyGame>();
+expectTypeOf(ui.menu).toEqualTypeOf<MainMenu | undefined>();
 
 const myColor = Color.from("foobar");
 
diff --git a/tests/foundry/common/constants.test-d.ts b/tests/foundry/common/constants.test-d.ts
index d6891476b..8cfd768b6 100644
--- a/tests/foundry/common/constants.test-d.ts
+++ b/tests/foundry/common/constants.test-d.ts
@@ -4,40 +4,26 @@ import type { ValueOf } from "../../../src/types/utils.d.mts";
 expectTypeOf<foundry.CONST.ACTIVE_EFFECT_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.CARD_DRAW_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.CANVAS_PERFORMANCE_MODES>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.CHAT_MESSAGE_STYLES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.COMPATIBILITY_MODES>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.LIGHTING_LEVELS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.CSS_THEMES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.PRIMARY_DOCUMENT_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.EMBEDDED_DOCUMENT_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.ALL_DOCUMENT_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.WORLD_DOCUMENT_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.COMPENDIUM_DOCUMENT_TYPES>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.DOCUMENT_META_OWNERSHIP_LEVELS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.DICE_ROLL_MODES>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.DRAWING_FILL_TYPES>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.FOLDER_DOCUMENT_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.MOVEMENT_DIRECTIONS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.GRID_TYPES>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.GRID_DIAGONALS>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.GRID_SNAPPING_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.MACRO_TYPES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.AUDIO_CHANNELS>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.PLAYLIST_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.PLAYLIST_SORT_MODES>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.DIRECTORY_SEARCH_MODES>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.PACKAGE_AVAILABILITY_CODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.SOFTWARE_UPDATE_CHANNELS>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.TABLE_RESULT_TYPES>().toMatchTypeOf<string>();
+expectTypeOf<foundry.CONST.TABLE_RESULT_TYPES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.JOURNAL_ENTRY_PAGE_FORMATS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.TEXT_ANCHOR_POINTS>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.OCCLUSION_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.TILE_OCCLUSION_MODES>().toMatchTypeOf<foundry.CONST.OCCLUSION_MODES>();
-expectTypeOf<foundry.CONST.TOKEN_OCCLUSION_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.TOKEN_DISPLAY_MODES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.TOKEN_DISPOSITIONS>().toMatchTypeOf<number>();
-expectTypeOf<foundry.CONST.TOKEN_HEXAGONAL_SHAPES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.USER_ROLES>().toMatchTypeOf<number>();
 expectTypeOf<foundry.CONST.USER_ROLE_NAMES>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.MEASURED_TEMPLATE_TYPES>().toMatchTypeOf<string>();
@@ -63,8 +49,3 @@ expectTypeOf<foundry.CONST.ALLOWED_HTML_ATTRIBUTES>().toMatchTypeOf<string[]>();
 
 expectTypeOf<foundry.CONST.SETUP_PACKAGE_PROGRESS.ACTIONS>().toMatchTypeOf<string>();
 expectTypeOf<foundry.CONST.SETUP_PACKAGE_PROGRESS.STEPS>().toMatchTypeOf<string>();
-
-expectTypeOf<foundry.CONST.COMBAT_ANNOUNCEMENTS>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.TEXTURE_DATA_FIT_MODES>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.REGION_EVENTS>().toMatchTypeOf<string>();
-expectTypeOf<foundry.CONST.REGION_VISIBILITY>().toMatchTypeOf<number>();
diff --git a/tests/foundry/common/data/fields.test-d.ts b/tests/foundry/common/data/fields.test-d.ts
index 2a720a0f8..5b7e0f81e 100644
--- a/tests/foundry/common/data/fields.test-d.ts
+++ b/tests/foundry/common/data/fields.test-d.ts
@@ -42,6 +42,11 @@ declare global {
 expectTypeOf(JEPCoreTypes).toEqualTypeOf<"base" | "image" | "pdf" | "text" | "video">();
 expectTypeOf(JEPSystemTypes).toEqualTypeOf<"headquarters">();
 
+declare const myJournalEntryPage: JournalEntryPage;
+if (myJournalEntryPage.system instanceof foundry.abstract.TypeDataModel) {
+  expectTypeOf(myJournalEntryPage.system?.prepareBaseData()).toEqualTypeOf<void>();
+}
+
 /** EmbeddedDataField */
 
 declare const embeddedModel: foundry.data.LightData;