From ad0e2a2097cd116ab160d01199d4a0b027d6acc7 Mon Sep 17 00:00:00 2001 From: boxgaming <75969133+boxgaming@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:32:07 -0500 Subject: [PATCH] Updated to explicitly set method parameter types --- lib/io/fs.bas | 2 +- lib/web/dom.bas | 20 ++++++++++---------- lib/web/storage.bas | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/io/fs.bas b/lib/io/fs.bas index ee64ca6..1490ef5 100644 --- a/lib/io/fs.bas +++ b/lib/io/fs.bas @@ -62,7 +62,7 @@ Sub DownloadFile(filepath As String) $End If End Sub -Sub UploadFile(destpath As String, filter As String, fnCallback) +Sub UploadFile(destpath As String, filter As String, fnCallback As Object) $If Javascript Then var vfs = QB.vfs(); var parentDir = null; diff --git a/lib/web/dom.bas b/lib/web/dom.bas index 02568a2..4baa94b 100644 --- a/lib/web/dom.bas +++ b/lib/web/dom.bas @@ -21,19 +21,19 @@ $If Javascript Then } $End If -Sub Alert (text) +Sub Alert (text As String) $If Javascript Then alert(text); $End If End Sub -Function Confirm (text) +Function Confirm (text As String) $If Javascript Then Confirm = confirm(text) ? -1 : 0; $End If End Function -Sub Add (e, parent, beforeElement) +Sub Add (e As Object, parent As Object, beforeElement As Object) $If Javascript Then if (typeof e == "string") { e = document.getElementById(e); @@ -57,7 +57,7 @@ Sub Add (e, parent, beforeElement) $End If End Sub -Function Create (etype, parent, content, eid, beforeElement) +Function Create (etype As String, parent As Object, content As String, eid As String, beforeElement As Object) $If Javascript Then var e = document.createElement(etype); if (eid != undefined && eid != "") { @@ -80,12 +80,12 @@ Function Create (etype, parent, content, eid, beforeElement) $End If End Function -Sub Create (etype, parent, content, eid, beforeElement) +Sub Create (etype As String, parent As Object, content As String, eid As String, beforeElement As Object) Dim e e = Create(etype, parent, content, eid, beforeElement) End Sub -Sub Event (target, eventType, callbackFn) +Sub Event (target As Object, eventType As String, callbackFn As Object) $If Javascript Then if (typeof target == "string") { target = document.getElementById(target); @@ -108,19 +108,19 @@ Function Container $End If End Function -Function Get (eid) +Function Get (eid As String) $If Javascript Then Get = document.getElementById(eid); $End If End Function -Function GetImage (imageId) +Function GetImage (imageId As Integer) $If Javascript Then GetImage = QB.getImage(imageId); $End If End Function -Sub Remove (e) +Sub Remove (e As Object) $If Javascript Then if (typeof e == "string") { e = document.getElementById(e); @@ -131,7 +131,7 @@ Sub Remove (e) $End If End Sub -Function Prompt (text, defaultValue) +Function Prompt (text As String, defaultValue As String) Dim result As String $If Javascript Then result = prompt(text, defaultValue); diff --git a/lib/web/storage.bas b/lib/web/storage.bas index 7b7c82e..626bdb0 100644 --- a/lib/web/storage.bas +++ b/lib/web/storage.bas @@ -10,13 +10,13 @@ $If Javascript Then } $End If -Sub Clear (stype) +Sub Clear (stype As String) $If Javascript Then _storage(stype).clear(); $End If End Sub -Function Get (key, stype) +Function Get (key As String, stype As String) $If Javascript Then var result = _storage(stype).getItem(key); if (result == null) { result = ""; } @@ -24,25 +24,25 @@ Function Get (key, stype) $End If End Function -Function Key (idx, stype) +Function Key (idx As Integer, stype As String) $If Javascript Then Key = _storage(stype).key(idx); $End If End Function -Function Length (stype) +Function Length (stype As String) $If Javascript Then Length = _storage(stype).length; $End If End Function -Sub Set (key, value, stype) +Sub Set (key As String, value As String, stype As String) $If Javascript Then _storage(stype).setItem(key, value); $End If End Sub -Sub Remove (key, stype) +Sub Remove (key As String, stype As String) $If Javascript Then _storage(stype).removeItem(key); $End If