wasm¶
In [ ]:
open rust
open rust_operators
rexie¶
In [ ]:
nominal rexie =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"rexie::Rexie\")>]\n#endif\ntype rexie_Rexie = class end"
$'' : $'rexie_Rexie'
)
rexie_store¶
In [ ]:
nominal rexie_store =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"rexie::Store\")>]\n#endif\ntype rexie_Store = class end"
$'' : $'rexie_Store'
)
rexie_transaction¶
In [ ]:
nominal rexie_transaction =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"rexie::Transaction\")>]\n#endif\ntype rexie_Transaction = class end"
$'' : $'rexie_Transaction'
)
rexie_error¶
In [ ]:
nominal rexie_error =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"rexie::Error\")>]\n#endif\ntype rexie_Error = class end"
$'' : $'rexie_Error'
)
js_value¶
In [ ]:
nominal js_value =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"wasm_bindgen::JsValue\")>]\n#endif\ntype wasm_bindgen_JsValue = class end"
$'' : $'wasm_bindgen_JsValue'
)
closure¶
In [ ]:
nominal closure t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"wasm_bindgen::closure::Closure<$0>\")>]\n#endif\ntype wasm_bindgen_closure_Closure<'T> = class end"
$'' : $'wasm_bindgen_closure_Closure<`t>'
)
js_function¶
In [ ]:
nominal js_function =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"js_sys::Function\")>]\n#endif\ntype js_sys_Function = class end"
$'' : $'js_sys_Function'
)
window¶
In [ ]:
nominal window =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"web_sys::Window\")>]\n#endif\ntype web_sys_Window = class end"
$'' : $'web_sys_Window'
)
document¶
In [ ]:
nominal document =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"web_sys::Document\")>]\n#endif\ntype web_sys_Document = class end"
$'' : $'web_sys_Document'
)
html_element¶
In [ ]:
nominal html_element =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"web_sys::HtmlElement\")>]\n#endif\ntype web_sys_HtmlElement = class end"
$'' : $'web_sys_HtmlElement'
)
storage¶
In [ ]:
nominal storage =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"web_sys::Storage\")>]\n#endif\ntype web_sys_Storage = class end"
$'' : $'web_sys_Storage'
)
closure_wrap¶
In [ ]:
inl closure_wrap forall t. (x : rust.box t) : closure t =
inl x = join x
!\($'"wasm_bindgen::closure::Closure::wrap(!x)"')
closure_forget¶
In [ ]:
inl closure_forget forall t. (closure : closure t) =
!\($'"!closure.forget()"') : ()
closure_as_ref¶
In [ ]:
inl closure_as_ref forall t. (closure : closure t) : rust.ref js_value =
!\($'"wasm_bindgen::closure::Closure::as_ref(&!closure)"')
unchecked_ref¶
In [ ]:
inl unchecked_ref (ref : rust.ref js_value) : rust.ref js_function =
!\($'"wasm_bindgen::JsCast::unchecked_ref(!ref)"')
set_inner_html¶
In [ ]:
inl set_inner_html (html : string) (el : html_element) =
inl html = join html
inl html = html |> sm'.as_str
inl el = join el
!\\(html, $'"!el.set_inner_html($0)"')
from_js_value¶
In [ ]:
inl from_js_value (value : js_value) : resultm.result' (optionm'.option' sm'.json_value) sm'.std_string =
inl value = join value
!\($'"serde_wasm_bindgen::from_value(!value)"')
|> resultm.map_error' fun (x : sm'.serde_wasm_bindgen_error) => x |> sm'.format'