summaryrefslogtreecommitdiff
path: root/meta/3rd/Defold/library/html5.lua
diff options
context:
space:
mode:
authorSalavat <salavat.rakhmanov@gmail.com>2022-11-03 14:17:57 +0600
committerSalavat <salavat.rakhmanov@gmail.com>2022-11-03 14:17:57 +0600
commit42c22fb2f411901a5a09e812dcf1a34f414e4e19 (patch)
tree70b3a4e79781fd761b761dc8d964a17b120b1aa4 /meta/3rd/Defold/library/html5.lua
parent213f5176ff3125feab1e743ef57abba0e18a44a5 (diff)
downloadlua-language-server-42c22fb2f411901a5a09e812dcf1a34f414e4e19.zip
Defold engine meta
Diffstat (limited to 'meta/3rd/Defold/library/html5.lua')
-rw-r--r--meta/3rd/Defold/library/html5.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/3rd/Defold/library/html5.lua b/meta/3rd/Defold/library/html5.lua
new file mode 100644
index 00000000..e87568a9
--- /dev/null
+++ b/meta/3rd/Defold/library/html5.lua
@@ -0,0 +1,23 @@
+---HTML5 API documentation
+---HTML5 platform specific functions.
+--- The following functions are only available on HTML5 builds, the html5.* Lua namespace will not be available on other platforms.
+---@class html5
+html5 = {}
+---Executes the supplied string as JavaScript inside the browser.
+---A call to this function is blocking, the result is returned as-is, as a string.
+---(Internally this will execute the string using the eval() JavaScript function.)
+---@param code string # Javascript code to run
+---@return string # result as string
+function html5.run(code) end
+
+---Set a JavaScript interaction listener callaback from lua that will be
+---invoked when a user interacts with the web page by clicking, touching or typing.
+---The callback can then call DOM restricted actions like requesting a pointer lock,
+---or start playing sounds the first time the callback is invoked.
+---@param callback fun(self: object) # The interaction callback. Pass an empty function or nil if you no longer wish to receive callbacks.
+function html5.set_interaction_listener(callback) end
+
+
+
+
+return html5 \ No newline at end of file