1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use wasm_bindgen::prelude::*;
use web_sys::*;

#[wasm_bindgen(module = "/src/monaco.min.js")]
extern "C" {
    #[wasm_bindgen(typescript_type = "object")]
    pub type IStandaloneCodeEditor;
    #[wasm_bindgen(js_name = create_editor)]
    pub fn create_editor(slot: &HtmlElement, language: String, code: String) -> IStandaloneCodeEditor;
    #[wasm_bindgen(js_name = create_editor)]
    pub fn get_text(editor: &IStandaloneCodeEditor) -> String;
    #[wasm_bindgen(js_name = create_editor)]
    pub fn set_text(editor: &IStandaloneCodeEditor, text: String);
}