1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-28 06:27:47 +00:00

Updated to explicitly set method parameter types

This commit is contained in:
boxgaming 2024-08-13 11:32:07 -05:00
parent 451e9485e6
commit ad0e2a2097
3 changed files with 17 additions and 17 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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