Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TokenConfig and DefaultTokenConfig #2326

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sapphie132
Copy link
Contributor

@sapphie132 sapphie132 commented Dec 16, 2022

@@ -7,18 +8,21 @@ declare global {
* be changed in v10.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A piece of this comment was removed in V10. It should also be removed here.

Options,
InstanceType<ConfiguredDocumentClassForName<"Token">> | InstanceType<ConfiguredDocumentClassForName<"Actor">>
> {
class TokenConfig<Options extends DocumentSheetOptions = DocumentSheetOptions> extends DocumentSheet<Options> {
constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comments for the parameters should be copied over from the sources.

actor: InstanceType<ConfiguredDocumentClassForName<"Actor">>;
/** Preserve a copy of the original document before any changes are made. */
// TODO: unsure about this type.
original: TokenData["_source"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
original: TokenData["_source"];
original: BaseToken.Source;

static override get defaultOptions(): FormApplicationOptions;

override get id(): string;
static override get defaultOptions(): DocumentSheetOptions;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the documented default return value.

* @internal
* Mimic changes to the Token document as if they were true document updates.
* @param change - Data which simulates a document update
* @param reset - To know if this preview change is a reset. Defaults to false.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param reset - To know if this preview change is a reset. Defaults to false.
* @param reset - To know if this preview change is a reset. Defaults to false.

@@ -87,7 +98,16 @@ declare global {
* Handle changing the attribute bar in the drop-down selector to update the default current and max value
* @internal
*/
protected _onBarChange(ev: JQuery.ChangeEvent): void;
protected _onBarChange(event: JQuery.ChangeEvent): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now has parameter documentation, which should be added.

Comment on lines +105 to +106
* @param event - The originating click event */
protected _onClickActionButton(event: JQuery.ClickEvent): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param event - The originating click event */
protected _onClickActionButton(event: JQuery.ClickEvent): void;
* @param event - The originating click event
*/
protected _onClickActionButton(event: JQuery.ClickEvent): void;

Comment on lines +107 to +110
/**
* Disable the user's ability to edit the token image field if wildcard images are enabled and that user does not have
* file browser permissions. */
private _disableEditImage(): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* Disable the user's ability to edit the token image field if wildcard images are enabled and that user does not have
* file browser permissions. */
private _disableEditImage(): void;
/**
* Disable the user's ability to edit the token image field if wildcard images are enabled and that user does not have
* file browser permissions.
*/
private _disableEditImage(): void;

@@ -158,7 +176,7 @@ declare global {
* })
* ```
*/
static override get defaultOptions(): FormApplicationOptions;
static override get defaultOptions(): DocumentSheetOptions;

override get id(): string;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getData's parameter is now optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update DefaultTokenConfig for Foundry VTT v10.274 Update TokenConfig for Foundry VTT v10.286
2 participants