Skip to content

Commit

Permalink
fix types for requestIdleCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Jun 24, 2022
1 parent d659425 commit 48a694f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@types/jest": "^28.1.3",
"@types/node": "^14.14.31",
"@types/node-fetch": "^2.5.8",
"@types/requestidlecallback": "^0.3.4",
"ajv": "^8",
"babel-jest": "^28.1.1",
"fuzzysort": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/types/item/spawnLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function offsetMapgen(mapgen: raw.Mapgen, x: number, y: number): raw.Mapgen {
const requestIdleCallback: typeof window.requestIdleCallback =
"requestIdleCallback" in window
? window.requestIdleCallback
: function (cb: IdleRequestCallback): number {
: function (cb: (deadline: IdleDeadline) => void): number {
var start = Date.now();
return setTimeout(function () {
cb({
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,11 @@
resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.6.tgz#f830323c88172e66826d0bde413498b61054b5a6"
integrity sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==

"@types/requestidlecallback@^0.3.4":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@types/requestidlecallback/-/requestidlecallback-0.3.4.tgz#819e22b8994cf547e1f17f9cb79805a5a3bb1db5"
integrity sha512-aTSyiZuRemRLTQkJPb25L7A4/eR2Teo5l4yJ1V6P3+MFxEZckTDkNKNtr/V1zEOMzS6H8DgxF22U6jPAPrzQvw==

"@types/[email protected]":
version "1.17.1"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
Expand Down

0 comments on commit 48a694f

Please sign in to comment.