wasmbind_monaco/
lib.rs

1use wasm_bindgen::prelude::*;
2use web_sys::*;
3
4#[wasm_bindgen(module = "/src/monaco.min.js")]
5extern "C" {
6    #[wasm_bindgen(typescript_type = "object")]
7    pub type IStandaloneCodeEditor;
8    #[wasm_bindgen(js_name = create_editor)]
9    pub fn create_editor(slot: &HtmlElement, language: String, code: String) -> IStandaloneCodeEditor;
10    #[wasm_bindgen(js_name = create_editor)]
11    pub fn get_text(editor: &IStandaloneCodeEditor) -> String;
12    #[wasm_bindgen(js_name = create_editor)]
13    pub fn set_text(editor: &IStandaloneCodeEditor, text: String);
14}