You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
[HTML5] Add function signatures to JS libraries.
This commit is contained in:
@@ -135,6 +135,7 @@ const GodotWebSocket = {
|
||||
},
|
||||
},
|
||||
|
||||
godot_js_websocket_create__sig: 'iiiiiiii',
|
||||
godot_js_websocket_create: function (p_ref, p_url, p_proto, p_on_open, p_on_message, p_on_error, p_on_close) {
|
||||
const on_open = GodotRuntime.get_func(p_on_open).bind(null, p_ref);
|
||||
const on_message = GodotRuntime.get_func(p_on_message).bind(null, p_ref);
|
||||
@@ -156,6 +157,7 @@ const GodotWebSocket = {
|
||||
return GodotWebSocket.create(socket, on_open, on_message, on_error, on_close);
|
||||
},
|
||||
|
||||
godot_js_websocket_send__sig: 'iiiii',
|
||||
godot_js_websocket_send: function (p_id, p_buf, p_buf_len, p_raw) {
|
||||
const bytes_array = new Uint8Array(p_buf_len);
|
||||
let i = 0;
|
||||
@@ -169,12 +171,14 @@ const GodotWebSocket = {
|
||||
return GodotWebSocket.send(p_id, out);
|
||||
},
|
||||
|
||||
godot_js_websocket_close__sig: 'viii',
|
||||
godot_js_websocket_close: function (p_id, p_code, p_reason) {
|
||||
const code = p_code;
|
||||
const reason = GodotRuntime.parseString(p_reason);
|
||||
GodotWebSocket.close(p_id, code, reason);
|
||||
},
|
||||
|
||||
godot_js_websocket_destroy__sig: 'vi',
|
||||
godot_js_websocket_destroy: function (p_id) {
|
||||
GodotWebSocket.destroy(p_id);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user