-
Notifications
You must be signed in to change notification settings - Fork 54
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
base: main
Are you sure you want to change the base?
Update TokenConfig and DefaultTokenConfig #2326
Conversation
sapphie132
commented
Dec 16, 2022
•
edited
Loading
edited
- Closes Update TokenConfig for Foundry VTT v10.286 #1891
- Closes Update DefaultTokenConfig for Foundry VTT v10.274 #1892
@@ -7,18 +8,21 @@ declare global { | |||
* be changed in v10. |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
original: TokenData["_source"]; | |
original: BaseToken.Source; |
static override get defaultOptions(): FormApplicationOptions; | ||
|
||
override get id(): string; | ||
static override get defaultOptions(): DocumentSheetOptions; |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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; |
There was a problem hiding this comment.
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.
* @param event - The originating click event */ | ||
protected _onClickActionButton(event: JQuery.ClickEvent): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param event - The originating click event */ | |
protected _onClickActionButton(event: JQuery.ClickEvent): void; | |
* @param event - The originating click event | |
*/ | |
protected _onClickActionButton(event: JQuery.ClickEvent): 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* 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; | |||
|
There was a problem hiding this comment.
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.