From 48d5ca0090f941c2b8a3f390c669cd6769a3a46d Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 2 Aug 2025 11:51:59 +0200 Subject: [PATCH 1/5] fix: make BaseActorDelta#_prepareDeltaUpdate params optional --- src/foundry/common/documents/actor-delta.d.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundry/common/documents/actor-delta.d.mts b/src/foundry/common/documents/actor-delta.d.mts index 7bcdcf47c..467027ec8 100644 --- a/src/foundry/common/documents/actor-delta.d.mts +++ b/src/foundry/common/documents/actor-delta.d.mts @@ -93,7 +93,7 @@ declare abstract class BaseActorDelta< * @param changes - Candidate source changes. (default: `{}`) * @param options - Options which determine how the new data is merged. (default: `{}`) */ - protected _prepareDeltaUpdate(changes: ActorDelta.UpdateData, options: DataModel.UpdateOptions): void; + protected _prepareDeltaUpdate(changes?: ActorDelta.UpdateData, options?: DataModel.UpdateOptions): void; /** @remarks passes to {@linkcode _prepareDeltaUpdate} prior to calling super */ override updateSource(changes?: ActorDelta.UpdateData, options?: DataModel.UpdateOptions): ActorDelta.UpdateData; From 8d8045bad15cdfaf08d25857bd54563c37de3f7b Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 2 Aug 2025 11:53:10 +0200 Subject: [PATCH 2/5] fix: make BaseScene#updateSource params optional --- src/foundry/common/documents/scene.d.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundry/common/documents/scene.d.mts b/src/foundry/common/documents/scene.d.mts index 8ace548b8..f89166516 100644 --- a/src/foundry/common/documents/scene.d.mts +++ b/src/foundry/common/documents/scene.d.mts @@ -65,7 +65,7 @@ declare abstract class BaseScene extends Document<"Scene", BaseScene.Schema, any protected override _initialize(options?: Document.InitializeOptions): void; - override updateSource(changes: Scene.UpdateData, options: DataModel.UpdateOptions): Scene.UpdateData; + override updateSource(changes?: Scene.UpdateData, options?: DataModel.UpdateOptions): Scene.UpdateData; /** * @remarks From 3cb80155523519d5c308a91b18c72e207a8720b3 Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 2 Aug 2025 15:09:32 +0200 Subject: [PATCH 3/5] feat: use HandlebarsApplicationMixin as base for TokenApplicationMixin --- .../client/applications/sheets/token/mixin.d.mts | 12 +++++++++++- .../applications/sheets/token/prototype-config.d.mts | 2 ++ .../applications/sheets/token/token-config.d.mts | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/foundry/client/applications/sheets/token/mixin.d.mts b/src/foundry/client/applications/sheets/token/mixin.d.mts index 91ca77aa5..02cb7b3a9 100644 --- a/src/foundry/client/applications/sheets/token/mixin.d.mts +++ b/src/foundry/client/applications/sheets/token/mixin.d.mts @@ -1,3 +1,4 @@ +import type HandlebarsApplicationMixin from "#client/applications/api/handlebars-application.mjs"; import type { PrototypeToken } from "#common/data/data.mjs"; import type { FixedInstanceType, Mixin } from "#utils"; import type ApplicationV2 from "../../api/application.d.mts"; @@ -5,11 +6,17 @@ import type ApplicationV2 from "../../api/application.d.mts"; /** * @remarks This does NOT exist at runtime. This is only here to be used as a type when relevant as well as to avoid * issues with anonymous mixin classes. + * @remarks TODO: Stub */ // eslint-disable-next-line @typescript-eslint/no-unused-vars declare class TokenApplication { /** @privateRemarks All mixin classses should accept anything for its constructor. */ constructor(...args: any[]); + + /** + * The TokenDocument or PrototypeToken + */ + get token(): TokenDocument.Implementation | PrototypeToken; } /** @@ -17,13 +24,16 @@ declare class TokenApplication { */ declare function TokenApplicationMixin( BaseApplication: BaseClass, -): Mixin; +): TokenApplicationMixin.Mix; declare namespace TokenApplicationMixin { type AnyMixedConstructor = ReturnType>; interface AnyMixed extends FixedInstanceType {} type BaseClass = ApplicationV2.Internal.Constructor; + type Mix = HandlebarsApplicationMixin.Mix< + Mixin + >; type Token = TokenDocument.Implementation | PrototypeToken; diff --git a/src/foundry/client/applications/sheets/token/prototype-config.d.mts b/src/foundry/client/applications/sheets/token/prototype-config.d.mts index 7bc4ab3f9..d67e0c6c5 100644 --- a/src/foundry/client/applications/sheets/token/prototype-config.d.mts +++ b/src/foundry/client/applications/sheets/token/prototype-config.d.mts @@ -22,6 +22,8 @@ declare class PrototypeTokenConfig< > extends TokenApplicationMixin(ApplicationV2) { // Fake override. static override DEFAULT_OPTIONS: PrototypeTokenConfig.DefaultOptions; + + override get token(): TokenDocument.Implementation | PrototypeToken; } declare namespace PrototypeTokenConfig { diff --git a/src/foundry/client/applications/sheets/token/token-config.d.mts b/src/foundry/client/applications/sheets/token/token-config.d.mts index 681f71c19..685a3091d 100644 --- a/src/foundry/client/applications/sheets/token/token-config.d.mts +++ b/src/foundry/client/applications/sheets/token/token-config.d.mts @@ -1,3 +1,4 @@ +import type { PrototypeToken } from "#common/data/data.mjs"; import type { Identity } from "#utils"; import type DocumentSheetV2 from "../../api/document-sheet.d.mts"; import type TokenApplicationMixin from "./mixin.d.mts"; @@ -23,7 +24,9 @@ declare class TokenConfig< RenderContext, Configuration, RenderOptions -> {} +> { + override get token(): TokenDocument.Implementation | PrototypeToken; +} declare namespace TokenConfig { interface Any extends AnyTokenConfig {} From f6c5b1a1f71c788eac1ac38d676f80d3462f0fb6 Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 2 Aug 2025 15:28:29 +0200 Subject: [PATCH 4/5] feat: add missing properties to _FormInputConfig --- .../client/applications/forms/fields.d.mts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/foundry/client/applications/forms/fields.d.mts b/src/foundry/client/applications/forms/fields.d.mts index b02a0bb9b..892709082 100644 --- a/src/foundry/client/applications/forms/fields.d.mts +++ b/src/foundry/client/applications/forms/fields.d.mts @@ -66,11 +66,21 @@ export interface FormGroupConfig extends NullishProps<_FormGroupConfig> { } interface _FormInputConfig { + /** + * The name of the form element + */ + name: string; + /** * The current value of the form element */ value: FormInputValue; + /** + * An id to assign to the element + */ + id: string; + /** * Is the field required? * @defaultValue `false` @@ -106,11 +116,22 @@ interface _FormInputConfig { */ dataset: Record; + /** + * Aria attributes to assign to the input + * @remarks Omit the `aria-`-prefix + */ + aria: Record; + /** * A placeholder value, if supported by the element type */ placeholder: string; + /** + * Space-delimited class names to apply to the input. + */ + classes: string; + input: CustomFormInput; } From 41195d68129376411e19c707ef1238ed779027af Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 13 Sep 2025 11:09:38 +0200 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20widen=20event=20parameter=20types?= =?UTF-8?q?=20for=20=5FonHover=E2=80=A6=20in=20PlaceableObject=20and=20Tok?= =?UTF-8?q?en?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/canvas/placeables/placeable-object.d.mts | 9 +++++++-- src/foundry/client/canvas/placeables/token.d.mts | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/foundry/client/canvas/placeables/placeable-object.d.mts b/src/foundry/client/canvas/placeables/placeable-object.d.mts index b98ac37e1..3bcfd7ece 100644 --- a/src/foundry/client/canvas/placeables/placeable-object.d.mts +++ b/src/foundry/client/canvas/placeables/placeable-object.d.mts @@ -466,16 +466,21 @@ declare abstract class PlaceableObject< * @param event - The triggering canvas interaction event * @param options - Options which customize event handling * @remarks {@link Wall._onHoverIn | `Wall#_onHoverIn`} can return `false`, otherwise this is always `void` + * @remarks This method barely does anything with the given event and can thus also just be given a {@link MouseEvent}. */ // options: not null (destructured) - protected _onHoverIn(event: Canvas.Event.Pointer, options?: PlaceableObject.HoverInOptions): false | void; + protected _onHoverIn( + event: Canvas.Event.Pointer | MouseEvent, + options?: PlaceableObject.HoverInOptions, + ): false | void; /** * Actions that should be taken for this Placeable Object when a mouseout event occurs * @see `MouseInteractionManager##handlePointerOut` * @param event - The triggering canvas interaction event + * @remarks The event is not used in the method. */ - protected _onHoverOut(event: Canvas.Event.Pointer): void; + protected _onHoverOut(event?: Canvas.Event.Pointer): void; /** * Should the placeable propagate left click downstream? diff --git a/src/foundry/client/canvas/placeables/token.d.mts b/src/foundry/client/canvas/placeables/token.d.mts index b81759da5..a903ec62a 100644 --- a/src/foundry/client/canvas/placeables/token.d.mts +++ b/src/foundry/client/canvas/placeables/token.d.mts @@ -821,9 +821,12 @@ declare class Token extends PlaceableObject { protected override _canDrag(user: User.Implementation, event?: Canvas.Event.Pointer): boolean; // options: not null (destructured) - protected override _onHoverIn(event: Canvas.Event.Pointer, options?: PlaceableObject.HoverInOptions): void; + protected override _onHoverIn( + event: Canvas.Event.Pointer | MouseEvent, + options?: PlaceableObject.HoverInOptions, + ): void; - protected override _onHoverOut(event: Canvas.Event.Pointer): void; + protected override _onHoverOut(event?: Canvas.Event.Pointer): void; protected override _onClickLeft(event: Canvas.Event.Pointer): void;