switch to foundry-vtt-types

This commit is contained in:
Johannes Loher 2021-01-26 03:55:18 +01:00
parent 6e10d4b093
commit 62cc5a0e7c
13 changed files with 713 additions and 84 deletions

570
package-lock.json generated
View file

@ -110,6 +110,383 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@pixi/accessibility": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-5.3.4.tgz",
"integrity": "sha512-g8hQnnVSYJ+gLrdQyCsDDSu+VehhVL9Pcr2fkQSC9VBhxiMIN+Paky8kOxC2LL5nsKRIUGGaTa6iHtiopPQQMw==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/app": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/app/-/app-5.3.4.tgz",
"integrity": "sha512-XT/EFyGslFdvdHY9ZS7yDAdLOj0U1UHeLxFr1kwiawuwIt/WsxNeH4jq2IijvZuQ3L5ON7Y7zQf54JEPv5fK0Q==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4"
}
},
"@pixi/constants": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.3.4.tgz",
"integrity": "sha512-YsWjdMVMoJA8kG/0D4s9/DWWa2lPlexk0qNZOcV3tICaPG0IYfIhepfveMeMhIb0QrdSAsPbhYdcaxxgoaNF1A==",
"dev": true
},
"@pixi/core": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.3.4.tgz",
"integrity": "sha512-k6SRniy4pH7ZKAKC2HkbLSKPm+j7bF17fTO5+6xLSiVqLnfa7ChV51wNuoa30olVF3/d8ME2uraf7dsvXwomzw==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/runner": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/ticker": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/display": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.3.4.tgz",
"integrity": "sha512-RCi39Qi1L8mlIu1YvWvPI45WpKHRbpYlvSIT/414wmoaAoFZnaJ+qoVuqDCfzfNhWWirGAWpXniQjNRzkUZjcA==",
"dev": true,
"requires": {
"@pixi/math": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/extract": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-5.3.4.tgz",
"integrity": "sha512-HTGF5WKts4kF0v1rOU4YcLMUpb18FzcxKhaCwjXpqm3vANgjuGAUL9PxpmC4ecS03mkRa0+9vAXEUkJLQeNLPg==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/filter-alpha": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-5.3.4.tgz",
"integrity": "sha512-lgRCN8bDeHlMpRtQv/P5gCJ+9e3AufJVC2H0TdkCRmJqm1dB+rhKwxIeNINsjjz+kiuumOe88CxRbRd3CpEydg==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4"
}
},
"@pixi/filter-blur": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-5.3.4.tgz",
"integrity": "sha512-PYPHc8MEsZWfmVQkm0UKO70dmZpcWyu/Bs0xJa5apsmCm6zXNzXfMh02lsXu82HrNQ+9iJT/mAKrrDABGn9vtg==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/settings": "5.3.4"
}
},
"@pixi/filter-color-matrix": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-5.3.4.tgz",
"integrity": "sha512-9Iflvr1moc7ns5A/73lWVwLUbe+wb678NLA4X9SYXAJTiij4M1isDrULhk95TGUaWo4bbSBaov1vm8XbUZNG8w==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4"
}
},
"@pixi/filter-displacement": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-5.3.4.tgz",
"integrity": "sha512-CldemXpcKr1GRT1Ll33TTFWtU6KDl4sYTvAwWTAEu8OhKedobBB/mRCIK9p1h7iZYtaj5MRYQjewmFKRrqyXrQ==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/math": "5.3.4"
}
},
"@pixi/filter-fxaa": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-5.3.4.tgz",
"integrity": "sha512-GtIfaOsqQlsK+F1795V/JJIq5Uu15nasiCwGr+wVwHNGMBanAXt7AnSy8JHcgup3Eqx8FXRuM/AyD/4IYUquuA==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4"
}
},
"@pixi/filter-noise": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-5.3.4.tgz",
"integrity": "sha512-pNq4T4LC2naWz0pZXF3RT9aA7XdLL4TuBjJsYrrBaJZraupbOo6Mp8VwxVJs8GThmMl7/U13GalOzVSb/HjzDg==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4"
}
},
"@pixi/graphics": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-5.3.4.tgz",
"integrity": "sha512-W6cuFfzwgfx3zVFICu98cENgwjy+d2e6xNJ/yJI0q8QiwlZmpuSXHBCfZrtIWpp9VSJZe2KDIo1LUnLhCpp3Yg==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/interaction": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-5.3.4.tgz",
"integrity": "sha512-7/JN7AtCuYmmWczrQROKSI9Z42p6C6p7B2wDVqNYYgROSaeGbGsZ8H0sa6nYLnIj4F3CaGSRoRnAMPz+CO70bw==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/ticker": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/loaders": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-5.3.4.tgz",
"integrity": "sha512-/dFznZnsivzq/MW7n/PPhMeznWFMMDYrac958OlxzSwrEAgtq6ZVLZbz7pCf9uhiifMnqwBGefphOFubj3Qorw==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/utils": "5.3.4",
"resource-loader": "^3.0.1"
}
},
"@pixi/math": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.3.4.tgz",
"integrity": "sha512-UQ2jhdlCHIvAVf8EcHB3QuR5GhB49VdTccWmer96RZCeGkcZsPSUk1ldO1GZnIctcf0Iuvmq74G02dYbtC7JxQ==",
"dev": true
},
"@pixi/mesh": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-5.3.4.tgz",
"integrity": "sha512-y0Y52cwsqETc/35DMGVCzQmhPCrQ3ZhjWcW9JwQoHMy3PoNSN9QUqYjVjF2oEj5hxcJnGNo3GAXFZz2Uh/UReQ==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/mesh-extras": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-5.3.4.tgz",
"integrity": "sha512-mjc3RlgLGYUv2FUKrVv/Dfaj2KW5qhX9c6Ev+yJ4lg/sMblet5gtYuyKsmJMS/K6B8V8+oMlTfX9ozFCzq1oJQ==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/mesh": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/mixin-cache-as-bitmap": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-5.3.4.tgz",
"integrity": "sha512-8ZAmzDK1fHXIzYFHFH72LUMRZerY1Pt71XI3UgsWExABS1aREe20oPLuVByLP94W7X/kTXz+zK+nt51O5MGKsA==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/mixin-get-child-by-name": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-5.3.4.tgz",
"integrity": "sha512-PY1Qe6CKYu+UNSRAFIfRyhRfkrpsTMwh9sI6iXVVi712bM3JkZIwDfDF31TA4nYX8z7H49w+KCWY4PejZ8l2WA==",
"dev": true,
"requires": {
"@pixi/display": "5.3.4"
}
},
"@pixi/mixin-get-global-position": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-5.3.4.tgz",
"integrity": "sha512-yv+huwUAOfyXDEHbQp6W5/3RjQpwG6AhpgMY4b3XBMtvrp9R/5Wgw/YC/nea9kZ3Gb2u4Aqeco8U+tPIRNjeIA==",
"dev": true,
"requires": {
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4"
}
},
"@pixi/particles": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/particles/-/particles-5.3.4.tgz",
"integrity": "sha512-sX0BGGbS7yCwlam1mC5awW2BjU7QFmZv82E8ON/r9aAZS6InT25zOpMdvy0ImIIqBvF0Z1Qz1IT6pKEBxqMo9Q==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/polyfill": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-5.3.4.tgz",
"integrity": "sha512-bxk8bhrfQ9Y2rU/L0ss2gIeXwmMlOciw+B5yVUDVLqzjE4y8Fm2619L4qu9v51Z9a+8JbyVE5c1eT7HJgx0g0w==",
"dev": true,
"requires": {
"es6-promise-polyfill": "^1.2.0",
"object-assign": "^4.1.1"
}
},
"@pixi/prepare": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-5.3.4.tgz",
"integrity": "sha512-MVMvNTrNYQidWXd4LSkgv+eqTzHtSViADA+Tvnemy9QMuWqbTfxFn4UMhrBjQIfG9+hwdIFS14pfFKt/BLHNrw==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/graphics": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/text": "5.3.4",
"@pixi/ticker": "5.3.4"
}
},
"@pixi/runner": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.3.4.tgz",
"integrity": "sha512-iPWHVhv2js+NhDQNmePkHfic8SilBT7H/pzRjMqHqvafTdl8Y+4g+hdQDalZJNr3Ixl77QPAYlOKhegBujn2mQ==",
"dev": true
},
"@pixi/settings": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.3.4.tgz",
"integrity": "sha512-Jqj1NLtYODCqK8ZKVccUBAaBDkn7SQ6b7N15FwxbiSgfbvwpynSKr6WQTxqMq29h42MKsic6BJcQrlGEbDNz5w==",
"dev": true,
"requires": {
"ismobilejs": "^1.1.0"
}
},
"@pixi/sprite": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-5.3.4.tgz",
"integrity": "sha512-vO+GMJWnumnVzc2R7jGcLlUeIXIek+SDqVQyPDPJ5T8sWTgFhanHCrgpKfplZIu08X/zvIZQxPfd332R0waeog==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/sprite-animated": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-5.3.4.tgz",
"integrity": "sha512-HaTelbvm2xekw9b9GdYbupM2RZ/muRZvstkmSqMZhiIViZekzKPa5WQJwnqZzVBjCg735j09G8aF4H2NpNqF9g==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/ticker": "5.3.4"
}
},
"@pixi/sprite-tiling": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-5.3.4.tgz",
"integrity": "sha512-NMqpNuWEIic2n5EL/TrGmn1+bab4TwxcILnco4myvw9Sd/wLsaJx3XboegY7YCWCKhnl+Ax6cl8DMkk7OJkpJQ==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/spritesheet": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-5.3.4.tgz",
"integrity": "sha512-gfCqOMD2XJHw1bMXxXbuYPnBbCBUvbzMN7Pw2po7U5R6bsk7WEoG7Hp3HjAPyPQvg36v2Db6dcz0//ZNNqm+EQ==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/loaders": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/text": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/text/-/text-5.3.4.tgz",
"integrity": "sha512-kmdK1KLrWY8PHGIIXKVRQmik3gWquiYz6DB0jqabi3j0gVp6h+CVDje01N6Nl75ZCQ/PjaWafzQvURypfX73ng==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/text-bitmap": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-5.3.4.tgz",
"integrity": "sha512-uNJOYvy3sn0S5Bp6H113ZAmaQm68ojCXSuOBJzIMEV2cUuYLngW+7DqKOsHMMhNmcONs/OBq57SRrzDcr8WYdw==",
"dev": true,
"requires": {
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/loaders": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/mesh": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/text": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"@pixi/ticker": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.3.4.tgz",
"integrity": "sha512-PmCAstgyI6vLPXKZVFlo4Zornry21BwFiTOp1dBUW3sIMky9Wx2fajjyVHIridCY6yaazt6Xu37khZf5qRgASw==",
"dev": true,
"requires": {
"@pixi/settings": "5.3.4"
}
},
"@pixi/utils": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.3.4.tgz",
"integrity": "sha512-HjUWFfAmPPKX0BSq20GWY//Vm+gC9O+wcn9sXMqOItCuf0DDFwxoBrUVaHNNnEVhM1Djpz/+YijCijmGdZeddA==",
"dev": true,
"requires": {
"@pixi/constants": "5.3.4",
"@pixi/settings": "5.3.4",
"earcut": "^2.1.5",
"eventemitter3": "^3.1.0",
"url": "^0.11.0"
}
},
"@types/fs-extra": { "@types/fs-extra": {
"version": "9.0.6", "version": "9.0.6",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.6.tgz",
@ -119,6 +496,12 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/howler": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/howler/-/howler-2.2.1.tgz",
"integrity": "sha512-1MiSldngr+eAO4lDPtjzl4Nf2GmRh8VDHIpNBIkyd25L22JExVlI6w3fjSM7+FNc1e1WZAPNq7/flkw685byfg==",
"dev": true
},
"@types/jasmine": { "@types/jasmine": {
"version": "3.6.2", "version": "3.6.2",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.2.tgz", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.2.tgz",
@ -126,9 +509,9 @@
"dev": true "dev": true
}, },
"@types/jquery": { "@types/jquery": {
"version": "3.5.5", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.5.tgz", "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-6RXU9Xzpc6vxNrS6FPPapN1SxSHgQ336WC6Jj/N8q30OiaBZ00l1GBgeP7usjVZPivSkGUfL1z/WW6TX989M+w==", "integrity": "sha512-Tyctjh56U7eX2b9udu3wG853ASYP0uagChJcQJXLUXEU6C/JiW5qt5dl8ao01VRj1i5pgXPAf8f1mq4+FDLRQg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/sizzle": "*" "@types/sizzle": "*"
@ -1821,6 +2204,12 @@
"object.defaults": "^1.1.0" "object.defaults": "^1.1.0"
} }
}, },
"earcut": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.2.tgz",
"integrity": "sha512-eZoZPPJcUHnfRZ0PjLvx2qBordSiO8ofC3vt+qACLM95u+4DovnbYNpQtJh0DNsWj8RnxrQytD4WA8gj5cRIaQ==",
"dev": true
},
"ecc-jsbn": { "ecc-jsbn": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@ -1935,6 +2324,12 @@
"es6-symbol": "^3.1.1" "es6-symbol": "^3.1.1"
} }
}, },
"es6-promise-polyfill": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/es6-promise-polyfill/-/es6-promise-polyfill-1.2.0.tgz",
"integrity": "sha1-84kl8jyz4+jObNqP93T867sJDN4=",
"dev": true
},
"es6-symbol": { "es6-symbol": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
@ -2224,6 +2619,12 @@
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true "dev": true
}, },
"eventemitter3": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==",
"dev": true
},
"execa": { "execa": {
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
@ -2717,14 +3118,27 @@
"mime-types": "^2.1.12" "mime-types": "^2.1.12"
} }
}, },
"foundry-pc-types": { "foundry-vtt-types": {
"version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#ac45653fdec5fb935bf7db72889cb40cd6b80b20", "version": "github:kmoschcau/foundry-vtt-types#21f009f10de74856556ceadf71fb436089c663cc",
"from": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "from": "github:kmoschcau/foundry-vtt-types#foundry-0.7.9",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/jquery": "^3.5.1", "@types/howler": "2.2.1",
"@types/jquery": "3.5.1",
"@types/node": "^14.14.21",
"@types/socket.io-client": "^1.4.33", "@types/socket.io-client": "^1.4.33",
"@types/tinymce": "^4.5.24" "@types/tinymce": "^4.5.24",
"handlebars": "4.7.6",
"pixi.js": "5.3.4",
"utility-types": "^3.10.0"
},
"dependencies": {
"@types/node": {
"version": "14.14.22",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz",
"integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==",
"dev": true
}
} }
}, },
"fragment-cache": { "fragment-cache": {
@ -3277,6 +3691,40 @@
"glogg": "^1.0.0" "glogg": "^1.0.0"
} }
}, },
"handlebars": {
"version": "4.7.6",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz",
"integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==",
"dev": true,
"requires": {
"minimist": "^1.2.5",
"neo-async": "^2.6.0",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4",
"wordwrap": "^1.0.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"uglify-js": {
"version": "3.12.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.5.tgz",
"integrity": "sha512-SgpgScL4T7Hj/w/GexjnBHi3Ien9WS1Rpfg5y91WXMj9SY997ZCQU76mH4TpLwwfmMvoOU8wiaRkIf6NaH3mtg==",
"dev": true,
"optional": true
},
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
"dev": true
}
}
},
"har-schema": { "har-schema": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
@ -3776,6 +4224,12 @@
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true "dev": true
}, },
"ismobilejs": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz",
"integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==",
"dev": true
},
"isobject": { "isobject": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
@ -4551,6 +5005,12 @@
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true "dev": true
}, },
"mini-signals": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mini-signals/-/mini-signals-1.2.0.tgz",
"integrity": "sha1-RbCAE8X65RokqhqTXNMXye1yHXQ=",
"dev": true
},
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -4646,6 +5106,12 @@
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
"dev": true "dev": true
}, },
"neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
"next-tick": { "next-tick": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
@ -5072,6 +5538,12 @@
"integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
"dev": true "dev": true
}, },
"parse-uri": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/parse-uri/-/parse-uri-1.0.3.tgz",
"integrity": "sha512-upMnGxNcm+45So85HoguwZTVZI9u11i36DdxJfGF2HYWS2eh3TIx7+/tTi7qrEq15qzGkVhsKjesau+kCk48pA==",
"dev": true
},
"pascalcase": { "pascalcase": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
@ -5170,6 +5642,48 @@
"pinkie": "^2.0.0" "pinkie": "^2.0.0"
} }
}, },
"pixi.js": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-5.3.4.tgz",
"integrity": "sha512-CrAaQQRw+iTA75IEu57CEk6stFs587iWE3HwQG0rZL2ESW2uJvdsF/ieeS/hFk35QmlEsPRqmH1sf7t7FGtsyw==",
"dev": true,
"requires": {
"@pixi/accessibility": "5.3.4",
"@pixi/app": "5.3.4",
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/extract": "5.3.4",
"@pixi/filter-alpha": "5.3.4",
"@pixi/filter-blur": "5.3.4",
"@pixi/filter-color-matrix": "5.3.4",
"@pixi/filter-displacement": "5.3.4",
"@pixi/filter-fxaa": "5.3.4",
"@pixi/filter-noise": "5.3.4",
"@pixi/graphics": "5.3.4",
"@pixi/interaction": "5.3.4",
"@pixi/loaders": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/mesh": "5.3.4",
"@pixi/mesh-extras": "5.3.4",
"@pixi/mixin-cache-as-bitmap": "5.3.4",
"@pixi/mixin-get-child-by-name": "5.3.4",
"@pixi/mixin-get-global-position": "5.3.4",
"@pixi/particles": "5.3.4",
"@pixi/polyfill": "5.3.4",
"@pixi/prepare": "5.3.4",
"@pixi/runner": "5.3.4",
"@pixi/settings": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/sprite-animated": "5.3.4",
"@pixi/sprite-tiling": "5.3.4",
"@pixi/spritesheet": "5.3.4",
"@pixi/text": "5.3.4",
"@pixi/text-bitmap": "5.3.4",
"@pixi/ticker": "5.3.4",
"@pixi/utils": "5.3.4"
}
},
"pkg-dir": { "pkg-dir": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz",
@ -5348,6 +5862,12 @@
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true "dev": true
}, },
"querystring": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
"integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
"dev": true
},
"read-pkg": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
@ -5596,6 +6116,16 @@
"integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
"dev": true "dev": true
}, },
"resource-loader": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/resource-loader/-/resource-loader-3.0.1.tgz",
"integrity": "sha512-fBuCRbEHdLCI1eglzQhUv9Rrdcmqkydr1r6uHE2cYHvRBrcLXeSmbE/qI/urFt8rPr/IGxir3BUwM5kUK8XoyA==",
"dev": true,
"requires": {
"mini-signals": "^1.2.0",
"parse-uri": "^1.0.0"
}
},
"restore-cursor": { "restore-cursor": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
@ -6891,6 +7421,24 @@
"integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
"dev": true "dev": true
}, },
"url": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
"integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
"dev": true,
"requires": {
"punycode": "1.3.2",
"querystring": "0.2.0"
},
"dependencies": {
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
"dev": true
}
}
},
"use": { "use": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
@ -6903,6 +7451,12 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true "dev": true
}, },
"utility-types": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz",
"integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==",
"dev": true
},
"uuid": { "uuid": {
"version": "3.4.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",

View file

@ -35,7 +35,7 @@
"build:watch": "gulp watch", "build:watch": "gulp watch",
"link": "gulp link", "link": "gulp link",
"clean": "gulp clean && gulp link --clean", "clean": "gulp clean && gulp link --clean",
"update": "npm install --save-dev git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "update": "npm install --save-dev github:kmoschcau/foundry-vtt-types#foundry-0.7.9",
"updateManifest": "gulp updateManifest", "updateManifest": "gulp updateManifest",
"lint": "eslint 'src/**/*.ts' --cache", "lint": "eslint 'src/**/*.ts' --cache",
"lint:fix": "eslint 'src/**/*.ts' --cache --fix", "lint:fix": "eslint 'src/**/*.ts' --cache --fix",
@ -53,7 +53,7 @@
"eslint": "^7.18.0", "eslint": "^7.18.0",
"eslint-config-prettier": "^7.1.0", "eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
"foundry-pc-types": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "foundry-vtt-types": "github:kmoschcau/foundry-vtt-types#foundry-0.7.9",
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-git": "^2.10.1", "gulp-git": "^2.10.1",

View file

@ -1,6 +1,9 @@
import { ModifiableData, ResourceData, UsableResource } from "../common/common-data"; import { ModifiableData, ResourceData, UsableResource } from "../common/common-data";
import { DS4ItemData } from "../item/item-data";
export type DS4ActorDataType = DS4ActorDataCharacter | DS4ActorDataCreature; export type DS4ActorData = Actor.Data<DS4ActorDataType, DS4ItemData>;
type DS4ActorDataType = DS4ActorDataCharacter | DS4ActorDataCreature;
interface DS4ActorDataBase { interface DS4ActorDataBase {
attributes: DS4ActorDataAttributes; attributes: DS4ActorDataAttributes;

View file

@ -1,9 +1,9 @@
import { ModifiableData } from "../common/common-data"; import { ModifiableData } from "../common/common-data";
import { DS4Item } from "../item/item"; import { DS4Item } from "../item/item";
import { DS4Armor, DS4ItemDataType, DS4Shield, ItemType } from "../item/item-data"; import { DS4Armor, DS4Shield, ItemType } from "../item/item-data";
import { DS4ActorDataType } from "./actor-data"; import { DS4ActorData } from "./actor-data";
export class DS4Actor extends Actor<DS4ActorDataType, DS4ItemDataType, DS4Item> { export class DS4Actor extends Actor<DS4Item, DS4ActorData> {
/** @override */ /** @override */
prepareDerivedData(): void { prepareDerivedData(): void {
const data = this.data; const data = this.data;
@ -96,7 +96,7 @@ export class DS4Actor extends Actor<DS4ActorDataType, DS4ItemDataType, DS4Item>
* This only differs from the base implementation by also allowing negative values. * This only differs from the base implementation by also allowing negative values.
* @override * @override
*/ */
async modifyTokenAttribute(attribute: string, value: number, isDelta = false, isBar = true): Promise<DS4Actor> { async modifyTokenAttribute(attribute: string, value: number, isDelta = false, isBar = true): Promise<this> {
const current = getProperty(this.data.data, attribute); const current = getProperty(this.data.data, attribute);
// Determine the updates to make to the actor data // Determine the updates to make to the actor data

View file

@ -1,20 +1,39 @@
import { DS4Item } from "../../item/item"; import { DS4Item } from "../../item/item";
import { DS4ItemDataType, ItemType } from "../../item/item-data"; import { DS4ItemData, ItemType } from "../../item/item-data";
import { DS4Actor } from "../actor"; import { DS4Actor } from "../actor";
import { DS4ActorDataType } from "../actor-data";
/** /**
* Extend the basic ActorSheet with some very simple modifications * Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet} * @extends {ActorSheet}
*/ */
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4ItemDataType> { // TODO(types): provide proper types for all generic parameters
export class DS4ActorSheet extends ActorSheet<unknown, DS4Actor> {
// TODO(types): Improve mergeObject in upstream so that it isn't necessary to provide all parameters
/** @override */ /** @override */
static get defaultOptions(): FormApplicationOptions { static get defaultOptions(): BaseEntitySheet.Options {
return mergeObject(super.defaultOptions, { const superDefaultOptions = super.defaultOptions;
return mergeObject(superDefaultOptions, {
classes: ["ds4", "sheet", "actor"], classes: ["ds4", "sheet", "actor"],
width: 745, width: 745,
height: 600, height: 600,
scrollY: [".sheet-body"], scrollY: [".sheet-body"],
template: superDefaultOptions.template,
viewPermission: superDefaultOptions.viewPermission,
closeOnSubmit: superDefaultOptions.closeOnSubmit,
submitOnChange: superDefaultOptions.submitOnChange,
submitOnClose: superDefaultOptions.submitOnClose,
editable: superDefaultOptions.editable,
baseApplication: superDefaultOptions.baseApplication,
top: superDefaultOptions.top,
left: superDefaultOptions.left,
popOut: superDefaultOptions.popOut,
minimizable: superDefaultOptions.minimizable,
resizable: superDefaultOptions.resizable,
id: superDefaultOptions.id,
dragDrop: superDefaultOptions.dragDrop,
filters: superDefaultOptions.filters,
title: superDefaultOptions.title,
tabs: superDefaultOptions.tabs,
}); });
} }
@ -32,7 +51,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
* object itemsByType. * object itemsByType.
* @returns the data fed to the template of the actor sheet * @returns the data fed to the template of the actor sheet
*/ */
getData(): ActorSheetData<DS4ActorDataType, DS4Actor> { getData(): ActorSheet.Data<DS4Actor> {
const data = { const data = {
...super.getData(), ...super.getData(),
// Add the localization config to the data: // Add the localization config to the data:
@ -82,13 +101,12 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
* @param {JQuery.ClickEvent} event The originating click event * @param {JQuery.ClickEvent} event The originating click event
* @private * @private
*/ */
private _onItemCreate(event: JQuery.ClickEvent): Promise<Item> { private _onItemCreate(event: JQuery.ClickEvent): Promise<DS4ItemData> {
event.preventDefault(); event.preventDefault();
const header = event.currentTarget; const header = event.currentTarget;
// Get the type of item to create. // Get the type of item to create.
const type = header.dataset.type;
// Grab any data associated with this control. // Grab any data associated with this control.
const data = duplicate(header.dataset); const { type, ...data } = duplicate(header.dataset);
// Initialize a default name. // Initialize a default name.
const name = `New ${type.capitalize()}`; const name = `New ${type.capitalize()}`;
// Prepare the item object. // Prepare the item object.
@ -97,11 +115,9 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
type: type, type: type,
data: data, data: data,
}; };
// Remove the type from the dataset since it's in the itemData.type prop.
delete itemData.data.type;
// Finally, create the item! // Finally, create the item!
return this.actor.createOwnedItem(itemData); return this.actor.createOwnedItem(itemData as DS4ItemData); // TODO(types) Improve upstream typing of createOwnedItem. It is possible to leave parts out here.
} }
/** /**
@ -116,7 +132,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
console.log("Current target:", $(ev.currentTarget).get(0)["name"]); console.log("Current target:", $(ev.currentTarget).get(0)["name"]);
const el: HTMLFormElement = $(ev.currentTarget).get(0); const el: HTMLFormElement = $(ev.currentTarget).get(0);
const id = $(ev.currentTarget).parents(".item").data("itemId"); const id = $(ev.currentTarget).parents(".item").data("itemId");
const item = duplicate(this.actor.getOwnedItem(id)); // getOwnedItem is typed incorrectly, it actually returns a ItemData<DS4ItemDataType>, not an Item const item = (duplicate(this.actor.getOwnedItem(id)) as unknown) as DS4ItemData; // TODO(types): Possible get better type definition for duplicate into upstream
const property: string | undefined = $(ev.currentTarget).data("property"); const property: string | undefined = $(ev.currentTarget).data("property");
// Early return: // Early return:
@ -210,7 +226,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
/** @override */ /** @override */
async _onDropItem(event: DragEvent, data: Parameters<typeof DS4Item.fromDropData>[0]): Promise<unknown> { async _onDropItem(event: DragEvent, data: Parameters<typeof DS4Item.fromDropData>[0]): Promise<unknown> {
const item = await Item.fromDropData(data); const item = ((await Item.fromDropData(data)) as unknown) as DS4Item;
if (item && !this.actor.canOwnItemType(item.data.type as ItemType)) { if (item && !this.actor.canOwnItemType(item.data.type as ItemType)) {
ui.notifications.warn( ui.notifications.warn(
game.i18n.format("DS4.WarningActorCannotOwnItem", { game.i18n.format("DS4.WarningActorCannotOwnItem", {
@ -222,6 +238,6 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
); );
return false; return false;
} }
return super._onDropItem(event, data); return super["_onDropItem"](event, data); // TODO(types): Add _onDropItem to upstream
} }
} }

View file

@ -2,10 +2,30 @@ import { DS4ActorSheet } from "./actor-sheet";
export class DS4CharacterActorSheet extends DS4ActorSheet { export class DS4CharacterActorSheet extends DS4ActorSheet {
/** @override */ /** @override */
static get defaultOptions(): FormApplicationOptions { static get defaultOptions(): BaseEntitySheet.Options {
return mergeObject(super.defaultOptions, { const superDefaultOptions = super.defaultOptions;
return mergeObject(superDefaultOptions, {
classes: ["ds4", "sheet", "actor", "character"], classes: ["ds4", "sheet", "actor", "character"],
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }],
template: superDefaultOptions.template,
viewPermission: superDefaultOptions.viewPermission,
closeOnSubmit: superDefaultOptions.closeOnSubmit,
submitOnChange: superDefaultOptions.submitOnChange,
submitOnClose: superDefaultOptions.submitOnClose,
editable: superDefaultOptions.editable,
baseApplication: superDefaultOptions.baseApplication,
top: superDefaultOptions.top,
left: superDefaultOptions.left,
popOut: superDefaultOptions.popOut,
minimizable: superDefaultOptions.minimizable,
resizable: superDefaultOptions.resizable,
id: superDefaultOptions.id,
dragDrop: superDefaultOptions.dragDrop,
filters: superDefaultOptions.filters,
title: superDefaultOptions.title,
width: superDefaultOptions.width,
height: superDefaultOptions.height,
scrollY: superDefaultOptions.scrollY,
}); });
} }
} }

View file

@ -2,10 +2,30 @@ import { DS4ActorSheet } from "./actor-sheet";
export class DS4CreatureActorSheet extends DS4ActorSheet { export class DS4CreatureActorSheet extends DS4ActorSheet {
/** @override */ /** @override */
static get defaultOptions(): FormApplicationOptions { static get defaultOptions(): BaseEntitySheet.Options {
return mergeObject(super.defaultOptions, { const superDefaultOptions = super.defaultOptions;
return mergeObject(superDefaultOptions, {
classes: ["ds4", "sheet", "actor", "creature"], classes: ["ds4", "sheet", "actor", "creature"],
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }],
template: superDefaultOptions.template,
viewPermission: superDefaultOptions.viewPermission,
closeOnSubmit: superDefaultOptions.closeOnSubmit,
submitOnChange: superDefaultOptions.submitOnChange,
submitOnClose: superDefaultOptions.submitOnClose,
editable: superDefaultOptions.editable,
baseApplication: superDefaultOptions.baseApplication,
top: superDefaultOptions.top,
left: superDefaultOptions.left,
popOut: superDefaultOptions.popOut,
minimizable: superDefaultOptions.minimizable,
resizable: superDefaultOptions.resizable,
id: superDefaultOptions.id,
dragDrop: superDefaultOptions.dragDrop,
filters: superDefaultOptions.filters,
title: superDefaultOptions.title,
width: superDefaultOptions.width,
height: superDefaultOptions.height,
scrollY: superDefaultOptions.scrollY,
}); });
} }
} }

View file

@ -13,7 +13,7 @@ import { migration } from "./migrations";
Hooks.once("init", async function () { Hooks.once("init", async function () {
console.log(`DS4 | Initializing the DS4 Game System\n${DS4.ASCII}`); console.log(`DS4 | Initializing the DS4 Game System\n${DS4.ASCII}`);
game.ds4 = { game["ds4"] = {
DS4Actor, DS4Actor,
DS4Item, DS4Item,
DS4, DS4,

View file

@ -3,7 +3,9 @@ import { DS4 } from "../config";
export type ItemType = keyof typeof DS4.itemTypes; export type ItemType = keyof typeof DS4.itemTypes;
export type DS4ItemDataType = export type DS4ItemData = Item.Data<DS4ItemDataType>;
type DS4ItemDataType =
| DS4Weapon | DS4Weapon
| DS4Armor | DS4Armor
| DS4Shield | DS4Shield

View file

@ -1,19 +1,37 @@
import { DS4Item } from "./item"; import { DS4Item } from "./item";
import { DS4ItemDataType, isDS4ItemDataTypePhysical } from "./item-data"; import { isDS4ItemDataTypePhysical } from "./item-data";
/** /**
* Extend the basic ItemSheet with some very simple modifications * Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet} * @extends {ItemSheet}
*/ */
export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> { // TODO(types): provide proper types for all generic parameters
export class DS4ItemSheet extends ItemSheet<unknown, DS4Item> {
/** @override */ /** @override */
static get defaultOptions(): FormApplicationOptions { static get defaultOptions(): BaseEntitySheet.Options {
return mergeObject(super.defaultOptions, { const superDefaultOptions = super.defaultOptions;
return mergeObject(superDefaultOptions, {
width: 530, width: 530,
height: 400, height: 400,
classes: ["ds4", "sheet", "item"], classes: ["ds4", "sheet", "item"],
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
scrollY: [".sheet-body"], scrollY: [".sheet-body"],
template: superDefaultOptions.template,
viewPermission: superDefaultOptions.viewPermission,
closeOnSubmit: superDefaultOptions.closeOnSubmit,
submitOnChange: superDefaultOptions.submitOnChange,
submitOnClose: superDefaultOptions.submitOnClose,
editable: superDefaultOptions.editable,
baseApplication: superDefaultOptions.baseApplication,
top: superDefaultOptions.top,
left: superDefaultOptions.left,
popOut: superDefaultOptions.popOut,
minimizable: superDefaultOptions.minimizable,
resizable: superDefaultOptions.resizable,
id: superDefaultOptions.id,
dragDrop: superDefaultOptions.dragDrop,
filters: superDefaultOptions.filters,
title: superDefaultOptions.title,
}); });
} }
@ -26,7 +44,7 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
/* -------------------------------------------- */ /* -------------------------------------------- */
/** @override */ /** @override */
getData(): ItemSheetData<DS4ItemDataType, DS4Item> { getData(): ItemSheet.Data<DS4Item> {
const data = { const data = {
...super.getData(), ...super.getData(),
config: CONFIG.DS4, config: CONFIG.DS4,
@ -41,11 +59,11 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
/* -------------------------------------------- */ /* -------------------------------------------- */
/** @override */ /** @override */
setPosition(options: ApplicationPosition = {}): ApplicationPosition { setPosition(options: Partial<Application.Position> = {}): Application.Position {
const position = super.setPosition(options); const position = super.setPosition(options);
if ("find" in this.element) { if ("find" in this.element) {
const sheetBody = this.element.find(".sheet-body"); const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192; const bodyHeight = (position.height as number) - 192; // TODO: remove type cast once https://github.com/kmoschcau/foundry-vtt-types/pull/214 is merged
sheetBody.css("height", bodyHeight); sheetBody.css("height", bodyHeight);
} else { } else {
console.log("Failure setting position."); console.log("Failure setting position.");
@ -81,7 +99,7 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
case "create": case "create":
return this._createActiveEffect(); return this._createActiveEffect();
case "edit": case "edit":
const effect = this.item.effects.get(li.data("effectId")); const effect = this.item["effects"].get(li.data("effectId")); // TODO replace with item.effect once https://github.com/kmoschcau/foundry-vtt-types/pull/216 is merged
return effect.sheet.render(true); return effect.sheet.render(true);
case "delete": { case "delete": {
return this.item.deleteEmbeddedEntity("ActiveEffect", li.data("effectId")); return this.item.deleteEmbeddedEntity("ActiveEffect", li.data("effectId"));

View file

@ -1,12 +1,10 @@
import { DS4Actor } from "../actor/actor"; import { DS4ItemData, DS4Talent } from "./item-data";
import { DS4ActorDataType } from "../actor/actor-data";
import { DS4ItemDataType, DS4Talent } from "./item-data";
/** /**
* Extend the basic Item with some very simple modifications. * Extend the basic Item with some very simple modifications.
* @extends {Item} * @extends {Item}
*/ */
export class DS4Item extends Item<DS4ItemDataType, DS4ActorDataType, DS4Actor> { export class DS4Item extends Item<DS4ItemData> {
/** /**
* Augment the basic Item data model with additional dynamic data. * Augment the basic Item data model with additional dynamic data.
*/ */

View file

@ -130,41 +130,38 @@ async function askGmModifier(
const renderedHtml = await renderTemplate(usedTemplate, templateData); const renderedHtml = await renderTemplate(usedTemplate, templateData);
const dialogPromise = new Promise<HTMLFormElement>((resolve) => { const dialogPromise = new Promise<HTMLFormElement>((resolve) => {
new Dialog( new Dialog({
{ title: usedTitle,
title: usedTitle, close: () => {
close: () => { // Don't do anything
// Don't do anything
},
content: renderedHtml,
buttons: {
ok: {
label: game.i18n.localize("DS4.RollDialogOkButton"),
callback: (html: HTMLElement | JQuery) => {
if (!("jquery" in html)) {
throw new Error(
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
exType: "JQuery",
realType: "HTMLElement",
}),
);
} else {
const innerForm = html[0].querySelector("form");
resolve(innerForm);
}
},
},
cancel: {
label: game.i18n.localize("DS4.RollDialogCancelButton"),
callback: () => {
// Don't do anything
},
},
},
default: "ok",
}, },
{}, content: renderedHtml,
).render(true); buttons: {
ok: {
label: game.i18n.localize("DS4.RollDialogOkButton"),
callback: (html: HTMLElement | JQuery) => {
if (!("jquery" in html)) {
throw new Error(
game.i18n.format("DS4.ErrorUnexpectedHtmlType", {
exType: "JQuery",
realType: "HTMLElement",
}),
);
} else {
const innerForm = html[0].querySelector("form");
resolve(innerForm);
}
},
},
cancel: {
label: game.i18n.localize("DS4.RollDialogCancelButton"),
callback: () => {
// Don't do anything
},
},
},
default: "ok",
}).render(true);
}); });
const dialogForm = await dialogPromise; const dialogForm = await dialogPromise;
return parseDialogFormData(dialogForm, targetValue); return parseDialogFormData(dialogForm, targetValue);

View file

@ -2,7 +2,8 @@
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2017",
"lib": ["DOM", "ES6", "ES2017"], "lib": ["DOM", "ES6", "ES2017"],
"types": ["foundry-pc-types"], "types": ["foundry-vtt-types"],
"esModuleInterop": true "esModuleInterop": true,
"skipLibCheck": true // TODO(types): remove once https://github.com/kmoschcau/foundry-vtt-types/issues/217 is resolved
} }
} }