codemirror_sys/
editor.rs

1use wasm_bindgen::prelude::*;
2use web_sys::HtmlTextAreaElement;
3
4use crate::Doc;
5
6#[wasm_bindgen]
7extern "C" {
8
9    #[derive(Debug)]
10    #[wasm_bindgen(extends = Doc)]
11    pub type Editor;
12
13    #[wasm_bindgen(method, js_name = getDoc)]
14    pub fn get_doc(this: &Editor) -> Doc;
15
16    #[wasm_bindgen(method)]
17    pub fn save(this: &Editor);
18
19    #[wasm_bindgen(js_name = fromTextArea, js_namespace = CodeMirror)]
20    pub fn from_text_area(text_area: &HtmlTextAreaElement, options: &JsValue) -> Editor;
21
22    #[wasm_bindgen(method, js_name = on)]
23    pub fn on(this: &Editor, event_name: &str, callback: &JsValue);
24
25}