Use @types/web instead of TS-provided "dom" types
parent
8073dc43c7
commit
b0201a63d1
|
@ -26,6 +26,7 @@
|
|||
"xml2js": "0.4.23"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/web": "=0.0.32",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.2",
|
||||
"@typescript-eslint/parser": "^4.29.2",
|
||||
"eslint": "^7.32.0",
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"tslib": "^2.3.1",
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"@types/debounce-promise": "^3.1.4",
|
||||
"@types/highcharts": "=4.2.57",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"@types/yaireo__tagify": "^4.7",
|
||||
"highcharts": "=4.2.5",
|
||||
"prop-types": "^15.7.2",
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"devDependencies": {
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"include": ["src"],
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"include": ["src"],
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
"@types/cash": "8.0.0",
|
||||
"@types/dom-screen-wake-lock": "1.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"exclude": [],
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"types": ["lichess", "cash", "dom-screen-wake-lock"]
|
||||
"types": ["lichess", "web", "cash", "dom-screen-wake-lock"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -48,7 +48,7 @@ export default function (token: string) {
|
|||
console.warn('JSON Object for Speech Keywords seems incomplete. Using English default.');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Invalid JSON Object for Speech Keywords. Using English default. ' + Error(error).message);
|
||||
console.error('Invalid JSON Object for Speech Keywords. Using English default. ' + error);
|
||||
}
|
||||
|
||||
//Lichess Integration with Board API
|
||||
|
@ -250,7 +250,7 @@ export default function (token: string) {
|
|||
connectToGameStream(data.game.id);
|
||||
} catch (error) {
|
||||
//This will trigger if connectToGameStream fails
|
||||
console.error('connectToEventStream - Failed to connect to game stream. ' + Error(error).message);
|
||||
console.error('connectToEventStream - Failed to connect to game stream. ' + error);
|
||||
}
|
||||
} else if (data.type == 'challenge') {
|
||||
//Challenge received
|
||||
|
@ -262,7 +262,7 @@ export default function (token: string) {
|
|||
console.warn('connectToEventStream - ' + data.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('connectToEventStream - Unable to parse JSON or Unexpected error. ' + Error(error).message);
|
||||
console.error('connectToEventStream - Unable to parse JSON or Unexpected error. ' + error);
|
||||
}
|
||||
} else {
|
||||
//Signal that some empty message arrived. This is normal to keep the connection alive.
|
||||
|
@ -374,7 +374,7 @@ export default function (token: string) {
|
|||
console.log('connectToGameStream - ' + data.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('connectToGameStream - No valid game data or Unexpected error. ' + Error(error).message);
|
||||
console.error('connectToGameStream - No valid game data or Unexpected error. ' + error);
|
||||
}
|
||||
} else {
|
||||
//Signal that some empty message arrived
|
||||
|
@ -540,7 +540,7 @@ export default function (token: string) {
|
|||
if (verbose) console.log(board(chess.board));
|
||||
if (verbose) console.log(chess.turn + "'s turn");
|
||||
} catch (error) {
|
||||
console.error(`initializeChessBoard - Error: ${error.message}`);
|
||||
console.error(`initializeChessBoard - Error: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,7 +593,7 @@ export default function (token: string) {
|
|||
if (verbose) console.log(chess.turn + "'s turn");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`updateChessBoard - Error: ${error.message}`);
|
||||
console.error(`updateChessBoard - Error: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1137,7 +1137,7 @@ export default function (token: string) {
|
|||
try {
|
||||
extendedSanMove = extendedSanMove.replace(keywordsBase[i], ' ' + keywords[keywordsBase[i]].toLowerCase() + ' ');
|
||||
} catch (error) {
|
||||
console.error(`raplaceKeywords - Error replacing keyword. ${keywordsBase[i]} . ${Error(error).message}`);
|
||||
console.error(`raplaceKeywords - Error replacing keyword. ${keywordsBase[i]} . ${error}`);
|
||||
}
|
||||
}
|
||||
return extendedSanMove;
|
||||
|
@ -1215,7 +1215,7 @@ export default function (token: string) {
|
|||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('compareMoves - ' + Error(err).message);
|
||||
console.warn('compareMoves - ' + err);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"@types/cash": "8.0.0",
|
||||
"@types/highcharts": "=4.2.57",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"highcharts": "=4.2.5",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"paths": {
|
||||
"numeral": ["./@types/numeral"]
|
||||
},
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"paths": {
|
||||
"chessground": ["@types/chessground"]
|
||||
},
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
},
|
||||
"extends": "../tsconfig.base.json"
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/debounce-promise": "^3.1.4",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"devDependencies": {
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"exclude": [],
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"@types/cash": "8.0.0",
|
||||
"@types/chart.js": "^2.9.29",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"@types/debounce-promise": "^3.1.4",
|
||||
"@types/fnando__sparkline": "^0.3.2",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"@types/yaireo__tagify": "^4.7",
|
||||
"@types/zxcvbn": "^4.4.0",
|
||||
"chessground": "^8.1.7",
|
||||
|
|
|
@ -162,7 +162,7 @@ export default class StrongSocket {
|
|||
let stack: string;
|
||||
try {
|
||||
stack = new Error().stack!.split('\n').join(' / ').replace(/\s+/g, ' ');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
stack = `${e.message} ${navigator.userAgent}`;
|
||||
}
|
||||
if (!stack.includes('round.nvui')) setTimeout(() => this.send('rep', { n: `soc: ${message} ${stack}` }), 10000);
|
||||
|
@ -257,7 +257,7 @@ export default class StrongSocket {
|
|||
}
|
||||
};
|
||||
|
||||
debug = (msg: string, always = false) => {
|
||||
debug = (msg: unknown, always = false) => {
|
||||
if (always || this.options.debug) console.debug(msg);
|
||||
};
|
||||
|
||||
|
@ -278,7 +278,7 @@ export default class StrongSocket {
|
|||
}
|
||||
};
|
||||
|
||||
onError = (e: Event) => {
|
||||
onError = (e: unknown) => {
|
||||
this.options.debug = true;
|
||||
this.debug('error: ' + JSON.stringify(e));
|
||||
this.tryOtherUrl = true;
|
||||
|
|
|
@ -137,7 +137,7 @@ lichess.load.then(() => {
|
|||
}, 1000);
|
||||
|
||||
// prevent zoom when keyboard shows on iOS
|
||||
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
|
||||
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && 'MSStream' in window) {
|
||||
const el = document.querySelector('meta[name=viewport]') as HTMLElement;
|
||||
el.setAttribute('content', el.getAttribute('content') + ',maximum-scale=1.0');
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"@build/rollupProject": "2.0.0",
|
||||
"@types/cash": "8.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["lichess", "cash"]
|
||||
"types": ["lichess", "web", "cash"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"devDependencies": {
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"rollup": "^2.56.2",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/lichess": "2.0.0",
|
||||
"@types/web": "=0.0.32",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"moduleResolution": "node",
|
||||
"target": "ES2017",
|
||||
"module": "esnext",
|
||||
"lib": ["DOM", "ES2017", "DOM.iterable"],
|
||||
"types": ["lichess"]
|
||||
"lib": ["ES2017"],
|
||||
"types": ["lichess", "web"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,6 +287,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
|
||||
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
|
||||
|
||||
"@types/web@=0.0.32":
|
||||
version "0.0.32"
|
||||
resolved "https://registry.yarnpkg.com/@types/web/-/web-0.0.32.tgz#f0fd2a26f49719fe999a6a7edc7a37d13b288bec"
|
||||
integrity sha512-P6r3FT1Ta4ClRVQylpanWN25tYn9fVb68b1eA2thEr5CxjxKJBZMCMXy+di+p3cHVZ0xiqKKLE2cr6iKdgDY2w==
|
||||
|
||||
"@types/webrtc@^0.0.27":
|
||||
version "0.0.27"
|
||||
resolved "https://registry.yarnpkg.com/@types/webrtc/-/webrtc-0.0.27.tgz#cf9118fa0ac54e530f0ee16c45b8e34df70ef47d"
|
||||
|
|
Loading…
Reference in New Issue