19 lines
523 B
Rust
19 lines
523 B
Rust
|
|
use wasm_bindgen::prelude::*;
|
||
|
|
|
||
|
|
#[wasm_bindgen(module = "/js/editor.js")]
|
||
|
|
extern "C" {
|
||
|
|
#[wasm_bindgen(catch)]
|
||
|
|
pub async fn editor_mount(
|
||
|
|
container: &web_sys::HtmlElement,
|
||
|
|
status: &web_sys::HtmlElement,
|
||
|
|
src: &str,
|
||
|
|
vim: bool,
|
||
|
|
on_apply: &JsValue,
|
||
|
|
) -> Result<(), JsValue>;
|
||
|
|
pub fn editor_focus();
|
||
|
|
pub fn editor_value() -> String;
|
||
|
|
#[wasm_bindgen(catch)]
|
||
|
|
pub async fn editor_set_vim(on: bool) -> Result<(), JsValue>;
|
||
|
|
pub fn editor_show_errors(text: &str);
|
||
|
|
}
|