Update wasm's runtime.js

This commit is contained in:
gingerBill
2024-09-20 11:15:47 +01:00
parent b116e8ff55
commit 02884207d5
2 changed files with 124 additions and 45 deletions
+17
View File
@@ -8,9 +8,15 @@ foreign dom_lib {
get_element_value_f64 :: proc(id: string) -> f64 ---
set_element_value_f64 :: proc(id: string, value: f64) ---
get_element_key_f64 :: proc(id: string, key: string) -> f64 ---
set_element_key_f64 :: proc(id: string, key: string, value: f64) ---
set_element_value_string :: proc(id: string, value: string) ---
get_element_value_string_length :: proc(id: string) -> int ---
set_element_key_string :: proc(id: string, key: string, value: string) ---
get_element_key_string_length :: proc(id: string, key: string, ) -> int ---
device_pixel_ratio :: proc() -> f64 ---
window_set_scroll :: proc(x, y: f64) ---
@@ -24,10 +30,21 @@ get_element_value_string :: proc "contextless" (id: string, buf: []byte) -> stri
}
n := _get_element_value_string(id, buf)
return string(buf[:n])
}
get_element_key_string :: proc "contextless" (id: string, key: string, buf: []byte) -> string {
@(default_calling_convention="contextless")
foreign dom_lib {
@(link_name="get_element_key_string")
_get_element_key_string :: proc(id: string, key: string, buf: []byte) -> int ---
}
n := _get_element_key_string(id, key, buf)
return string(buf[:n])
}
get_element_min_max :: proc "contextless" (id: string) -> (min, max: f64) {
@(default_calling_convention="contextless")
foreign dom_lib {