Fix errors TS2367 and TS2405 reported by TypeScript

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-04-21 16:41:59 -03:00
parent a493cbdf84
commit c0ac1b178d
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
5 changed files with 10 additions and 15 deletions

18
js/global.d.ts vendored
View File

@ -1,15 +1,9 @@
// libraries/classes/Controllers/JavaScriptMessagesController.php
declare var Messages: { [p: string]: string };
// templates/javascript/variables.twig
declare var firstDayOfCalendar: string;
declare var themeImagePath: string;
declare var mysqlDocTemplate: string;
declare var maxInputVars: number;
declare function sprintf(format: string, ...values: (string|number)[]): string;
interface Window {
Messages: { [p: string]: string };
maxInputVars: number;
mysqlDocTemplate: string;
themeImagePath: string;
firstDayOfCalendar: string;
ol: any;
opera: any;
zxcvbnts: any;
@ -17,6 +11,8 @@ interface Window {
u2f: any;
drawOpenLayers: () => any;
variableNames: string[];
sprintf(format: string, ...values: (string|number)[]): string;
}
interface JQuery {

View File

@ -682,7 +682,7 @@ const queryFrom = function () {
var parts = [];
var tArray = [];
tArray = window.fromArray;
var K = 0;
var K: any = 0;
var k;
var key;
var key2;

View File

@ -1129,7 +1129,7 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
var timeFormat = 'HH:mm:ss';
// check for decimal places of seconds
if ((Number($td.attr('data-decimals')) > 0) && ($td.attr('data-type').indexOf('time') !== -1)) {
if (datetimeValue && datetimeValue.indexOf('.') === false) {
if (datetimeValue && datetimeValue.indexOf('.') === -1) {
datetimeValue += '.';
}

View File

@ -10,6 +10,7 @@ export default function checkNumberOfFields () {
return false;
}
// @ts-ignore
if (false === window.maxInputVars) {
return false;
}

View File

@ -12,8 +12,6 @@ const publicPath = path.resolve(__dirname, 'public');
const typeScriptErrorsToIgnore = [
2322, // TS2322: Type '%s' is not assignable to type '%s'.
2345, // TS2345: Argument of type '%s' is not assignable to parameter of type '%s'.
2367, // TS2367: This comparison appears to be unintentional because the types '%s' and '%s' have no overlap.
2405, // TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
2538, // TS2538: Type '%s' cannot be used as an index type.
2769, // TS2769: No overload matches this call.
5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.