Update foundry-vtt-types to remove some type workarounds

This commit is contained in:
Johannes Loher 2021-03-16 07:11:12 +01:00
parent 48e06678a9
commit 67d0253f66
5 changed files with 9 additions and 12 deletions

View file

@ -45,7 +45,7 @@
"postinstall": "husky install" "postinstall": "husky install"
}, },
"devDependencies": { "devDependencies": {
"@league-of-foundry-developers/foundry-vtt-types": "^0.7.9-1", "@league-of-foundry-developers/foundry-vtt-types": "^0.7.9-3",
"@types/fs-extra": "^9.0.8", "@types/fs-extra": "^9.0.8",
"@types/jest": "^26.0.20", "@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/eslint-plugin": "^4.16.1",

View file

@ -23,7 +23,7 @@ export async function createItemMacro(itemData: DS4ItemData, slot: string): Prom
}, },
{ displaySheet: false }, { displaySheet: false },
)); ));
game.user?.assignHotbarMacro(macro, (slot as unknown) as number); // TODO(types): adjust so that cast is not needed, slot should be an optional string game.user?.assignHotbarMacro(macro, slot);
} }
/** /**

View file

@ -8,7 +8,7 @@ export class DS4Roll<D extends Record<string, unknown> = Record<string, unknown>
* template if the first dice term is a ds4 check. * template if the first dice term is a ds4 check.
* @override * @override
*/ */
async render(chatOptions: Roll.ChatOptions = {}): Promise<HTMLElement> { async render(chatOptions: Roll.ChatOptions = {}): Promise<string> {
chatOptions = mergeObject( chatOptions = mergeObject(
{ {
user: game.user?._id, user: game.user?._id,
@ -39,6 +39,6 @@ export class DS4Roll<D extends Record<string, unknown> = Record<string, unknown>
}; };
// Render the roll display template // Render the roll display template
return (renderTemplate(chatOptions.template ?? "", chatData) as unknown) as Promise<HTMLElement>; // TODO(types): Make this cast unnecessary by fixing upstream return renderTemplate(chatOptions.template ?? "", chatData);
} }
} }

View file

@ -1,9 +1,6 @@
import { DS4Check } from "./check"; import { DS4Check } from "./check";
export default function registerSlayingDiceModifier(): void { export default function registerSlayingDiceModifier(): void {
// TODO(types): Adjust types to allow extension of DiceTerm.MODIFIERS (see https://github.com/League-of-Foundry-Developers/foundry-vtt-types/pull/573)
// eslint-disable-next-line
// @ts-ignore
DicePool.MODIFIERS.x = slay; DicePool.MODIFIERS.x = slay;
DicePool.POOL_REGEX = /^{([^}]+)}([A-z]([A-z0-9<=>]+)?)?$/; DicePool.POOL_REGEX = /^{([^}]+)}([A-z]([A-z0-9<=>]+)?)?$/;
} }

View file

@ -647,9 +647,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@league-of-foundry-developers/foundry-vtt-types@npm:^0.7.9-1": "@league-of-foundry-developers/foundry-vtt-types@npm:^0.7.9-3":
version: 0.7.9-1 version: 0.7.9-3
resolution: "@league-of-foundry-developers/foundry-vtt-types@npm:0.7.9-1" resolution: "@league-of-foundry-developers/foundry-vtt-types@npm:0.7.9-3"
dependencies: dependencies:
"@types/howler": 2.2.1 "@types/howler": 2.2.1
"@types/jquery": 3.5.1 "@types/jquery": 3.5.1
@ -659,7 +659,7 @@ __metadata:
pixi.js: 5.3.4 pixi.js: 5.3.4
tinymce: 5.6.2 tinymce: 5.6.2
typescript: ^4.1.4 typescript: ^4.1.4
checksum: 1b2e311e5ab2db9da4d67fee7b5ab038b228b76ff78f90830f770ae4cee7191f652a18dec0161cc7e2e9696fc06969e23b33a0402249bc4251cc557fa5efc430 checksum: 75524c7aa78ddb77cad1a9d041af30ae5bbd708f5b26568dabbb3d913a4643aefcc6f2ed80e1e76b3c17050579665eab155f035f840db6397691cf68eeee9b3f
languageName: node languageName: node
linkType: hard linkType: hard
@ -2820,7 +2820,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "dungeonslayers4@workspace:." resolution: "dungeonslayers4@workspace:."
dependencies: dependencies:
"@league-of-foundry-developers/foundry-vtt-types": ^0.7.9-1 "@league-of-foundry-developers/foundry-vtt-types": ^0.7.9-3
"@types/fs-extra": ^9.0.8 "@types/fs-extra": ^9.0.8
"@types/jest": ^26.0.20 "@types/jest": ^26.0.20
"@typescript-eslint/eslint-plugin": ^4.16.1 "@typescript-eslint/eslint-plugin": ^4.16.1