Update typescript to latest (v4.5.5)

Vector's tsc version is currently reporting errors that the latest
typescript version doesn't report and vice versa. Upgrade to the latest
version to avoid these discrepancies.

Additionally:

Fix tsc errors that are now reported by updated version

Bug: T297614
Change-Id: I0eb67bcc1a5ce214fcf2d6f6433a5de3a845b6a6
This commit is contained in:
Nicholas Ray 2022-01-24 15:46:47 -07:00
parent 26835ad0ce
commit 76eb7caa2f
6 changed files with 17669 additions and 25 deletions

17677
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@
"pre-commit": "1.2.2",
"stylelint-config-wikimedia": "0.11.1",
"svgo": "2.3.1",
"typescript": "3.8.3",
"typescript": "4.5.5",
"vue": "2.6.11"
}
}

View File

@ -1,5 +1,6 @@
/** See Vector\Hooks::getVectorResourceLoaderConfig */
interface VectorResourceLoaderVirtualConfig {
wgVectorSearchHost: string;
/**
* The name of the ResourceLoader module that contains search.
*/

View File

@ -16,7 +16,9 @@ var /** @type {VectorResourceLoaderVirtualConfig} */
CAN_TEST_SEARCH = !!(
window.performance &&
/* eslint-disable compat/compat */
// @ts-ignore
performance.mark &&
// @ts-ignore
performance.measure &&
performance.getEntriesByName ),
/* eslint-enable compat/compat */

View File

@ -1,4 +1,4 @@
/* global FetchEndEvent, SuggestionClickEvent, SubmitEvent */
/* global FetchEndEvent, SuggestionClickEvent, SearchSubmitEvent */
/** @module Instrumentation */
/**
@ -13,10 +13,14 @@ var INPUT_LOCATION_MOVED = 'header-moved',
// mediawiki.searchSuggest performance. Marks and Measures will only be
// recorded on the Vector skin and only if browser supported.
shouldTestSearchPerformance = !!( window.performance &&
// @ts-ignore
window.requestAnimationFrame &&
/* eslint-disable compat/compat */
// @ts-ignore
performance.mark &&
// @ts-ignore
performance.measure &&
// @ts-ignore
performance.getEntriesByName &&
performance.clearMarks ),
/* eslint-enable compat/compat */
@ -88,7 +92,7 @@ function onFetchEnd( event ) {
}
/**
* @param {SuggestionClickEvent|SubmitEvent} event
* @param {SuggestionClickEvent|SearchSubmitEvent} event
*/
function onSuggestionClick( event ) {
mw.track( 'mediawiki.searchSuggest', {

View File

@ -11,7 +11,7 @@
*/
/**
* @typedef {SuggestionClickEvent} SubmitEvent
* @typedef {SuggestionClickEvent} SearchSubmitEvent
*/
/* exported SuggestionClickEvent, SubmitEvent, FetchEndEvent */
/* exported SuggestionClickEvent, SuggestionSubmitEvent, FetchEndEvent */