From 190f64548b562d0086e98445153e6ec96a47a275 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 27 Dec 2023 10:09:49 +0100 Subject: [PATCH] Fix some random type annotations. --- www/js/remoteglot.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 039db0e..5947591 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -5,7 +5,7 @@ * Version of this script. If the server returns a version larger than * this, it is a sign we should reload to upgrade ourselves. * - * @type {Number} + * @type {number} * @const * @private */ let SCRIPT_VERSION = 2023122700; @@ -80,6 +80,14 @@ let occupied_by_arrows = []; * TODO: This is a mess, and we should probably just let update_refutation_lines() * decide anew every time instead of storing the state here in multiple global * variables. + * + * @type {Array.<{ + * score: Array, + * depth: string, + * pv: Array., + * move: string + * }>} + * @private */ let refutation_lines = []; @@ -171,11 +179,12 @@ let display_fen = null; * toplay: string, * scores: Array<{first_move: number, score: Object}>, * start_display_move_num: number - * }} DisplayLine + * }} * * "start_display_move_num" is the (half-)move number to start displaying the PV at. * "score" is also evaluated at this point. */ +var DisplayLine; /** All PVs that we currently know of. * @@ -210,7 +219,7 @@ let current_analysis_xhr = null; * The current timer to fire off a request to get main analysis (not history), * if any, so that we can abort it. * - * @type {?Number} + * @type {?number} * @private */ let current_analysis_request_timer = null; @@ -235,7 +244,7 @@ let current_hash_xhr = null; * The current timer to display hash probe information (it could be waiting on the * board to stop animating), if any, so that we can abort it. * - * @type {?Number} + * @type {?number} * @private */ let current_hash_display_timer = null; @@ -697,7 +706,7 @@ function thousands(x) { /** * @param {!string} start_fen * @param {Array.} pv - * @param {Array<{ first_move: integer, score: Object }>} scores + * @param {Array<{ first_move: number, score: Object }>} scores * @param {number} start_display_move_num * @param {number=} opt_limit * @param {boolean=} opt_showlast @@ -1634,7 +1643,7 @@ function update_clock() { } /** - * @param {Number} remaining_ms + * @param {number} remaining_ms * @param {boolean} show_seconds */ function format_clock(remaining_ms, show_seconds) { @@ -1660,7 +1669,7 @@ function format_clock(remaining_ms, show_seconds) { } /** - * @param {Number} x + * @param {number} x */ function format_2d(x) { if (x >= 10) { @@ -1672,7 +1681,7 @@ function format_2d(x) { /** * @param {string} move - * @param {Number} move_num Move number of this move. + * @param {number} move_num Move number of this move. * @param {boolean} white_to_play Whether white is to play this move. */ function format_move_with_number(move, move_num, white_to_play) { @@ -1688,7 +1697,7 @@ function format_move_with_number(move, move_num, white_to_play) { /** * @param {string} move - * @param {Number} halfmove_num Half-move number that is to be played, + * @param {number} halfmove_num Half-move number that is to be played, * starting from 0. */ function format_halfmove_with_number(move, halfmove_num) { @@ -1700,7 +1709,7 @@ function format_halfmove_with_number(move, halfmove_num) { /** * @param {Object} data - * @param {Number} halfmove_num + * @param {number} halfmove_num */ function format_tooltip(data, halfmove_num) { if (data['score_history'][halfmove_num + 1] || -- 2.39.2