Fix new JS verification errors and force specific TSC version
The new TSC compiler does stricter checking on the JS documentation strings. All documentation strings have been updated to pass with the current version (7.0.2) In addition, the version of the TSC compiler used during the github action will be fixed to 7.0.2, so that we don't get these type of sudden errors again in the future. Unfortunately this means we need to periodically update this manually.
This commit is contained in:
@@ -31,7 +31,7 @@ class CollectionsCache {
|
||||
this.server_features = null;
|
||||
/** @type {?XMLHttpRequest} */ this.collections_req = null;
|
||||
/** @type {?XMLHttpRequest} */ this.shares_req = null;
|
||||
/** @type {?Array<{ onerror: function(string):void, displayData: function(Array<import("../api/sharing.js").Share>):void }>} */
|
||||
/** @type {Array<{ onerror: (error: string) => void, displayData: (shares: Array<import("../api/sharing.js").Share>) => void }> | null} */
|
||||
this._sharing_callbacks = null;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ class CollectionsCache {
|
||||
* @param {string} user
|
||||
* @param {?string} password
|
||||
* @param {import("../models/collection.js").Collection} principal_collection
|
||||
* @param {function(string):void} onerror
|
||||
* @param {function(Array<import("../models/collection.js").Collection>, Array<import("../api/sharing.js").Share>, boolean):void} displayData
|
||||
* @param {(error: string) => void} onerror
|
||||
* @param {(collections: Array<import("../models/collection.js").Collection>, shares: Array<import("../api/sharing.js").Share>, loaded: boolean) => void} displayData
|
||||
*/
|
||||
getChildCollections(user, password, principal_collection, onerror, displayData) {
|
||||
if (this.child_collections !== null && this.incoming_shares !== null) {
|
||||
@@ -105,8 +105,8 @@ class CollectionsCache {
|
||||
/**
|
||||
* @param {string} user
|
||||
* @param {?string} password
|
||||
* @param {function(string):void} onerror
|
||||
* @param {function(Array<import("../api/sharing.js").Share>):void} displayData
|
||||
* @param {(error: string) => void} onerror
|
||||
* @param {(shares: Array<import("../api/sharing.js").Share>) => void} displayData
|
||||
*/
|
||||
getSharingList(user, password, onerror, displayData) {
|
||||
if (this.incoming_shares !== null) {
|
||||
@@ -140,8 +140,8 @@ class CollectionsCache {
|
||||
/**
|
||||
* @param {string} user
|
||||
* @param {?string} password
|
||||
* @param {function(string):void} onerror
|
||||
* @param {function(import("../api/sharing.js").ServerFeatures):void} displayData
|
||||
* @param {(error: string) => void} onerror
|
||||
* @param {(features: import("../api/sharing.js").ServerFeatures) => void} displayData
|
||||
*/
|
||||
getServerFeatures(user, password, onerror, displayData) {
|
||||
if (this.server_features !== null) {
|
||||
|
||||
@@ -30,13 +30,13 @@ export class FormValidator {
|
||||
*/
|
||||
constructor(error_handler) {
|
||||
this.error_handler = error_handler;
|
||||
/** @type {Array<{field: HTMLInputElement, validation_method: function(): ?string}>} */
|
||||
/** @type {Array<{field: HTMLInputElement, validation_method: () => string | null}>} */
|
||||
this.validation_methods = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLInputElement} field
|
||||
* @param {function(): ?string} validation_method
|
||||
* @param {() => string | null} validation_method
|
||||
*/
|
||||
addValidator(field, validation_method) {
|
||||
this.validation_methods.push({ field, validation_method });
|
||||
@@ -67,7 +67,7 @@ export class FormValidator {
|
||||
* Validates that the input is not empty.
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} field_name
|
||||
* @returns{function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_non_empty(input, field_name) {
|
||||
return () => {
|
||||
@@ -83,7 +83,7 @@ export function validate_non_empty(input, field_name) {
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} target
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_not_empty_or_equals(input, target, field_name) {
|
||||
return () => {
|
||||
@@ -102,7 +102,7 @@ export function validate_not_empty_or_equals(input, target, field_name) {
|
||||
* Validates that the input is a valid HREF.
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_href(input, field_name) {
|
||||
return () => {
|
||||
@@ -124,7 +124,7 @@ export function validate_href(input, field_name) {
|
||||
* Validates that the input is a valid color.
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_color(input, field_name) {
|
||||
return () => {
|
||||
@@ -144,7 +144,7 @@ export function validate_color(input, field_name) {
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} target
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_equals(input, target, field_name) {
|
||||
return () => {
|
||||
@@ -160,7 +160,7 @@ export function validate_equals(input, target, field_name) {
|
||||
* Validates that at least one file is selected in a file input.
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_files(input, field_name) {
|
||||
return () => {
|
||||
@@ -175,7 +175,7 @@ export function validate_files(input, field_name) {
|
||||
* Validates that the input is a valid integer (if not empty).
|
||||
* @param {HTMLInputElement} input
|
||||
* @param {string} field_name
|
||||
* @returns {function(): ?string}
|
||||
* @returns {() => string | null}
|
||||
*/
|
||||
export function validate_integer(input, field_name) {
|
||||
return () => {
|
||||
|
||||
@@ -156,7 +156,7 @@ export function get_element(node, selector) {
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {number} max
|
||||
* @returns {str}
|
||||
* @returns {string}
|
||||
*/
|
||||
export function trim_to_max(str, max) {
|
||||
if (str.length > max - 2) {
|
||||
|
||||
Reference in New Issue
Block a user