codemirror_sys/
doc.rs

1use wasm_bindgen::prelude::*;
2use web_sys::Element;
3
4use crate::Editor;
5
6#[wasm_bindgen]
7extern "C" {
8
9    #[derive(Debug)]
10    pub type Doc;
11
12    #[derive(Debug)]
13    pub type LineHandle;
14
15    #[wasm_bindgen(method, js_name = getEditor)]
16    pub fn get_editor(this: &Doc) -> Editor;
17
18    #[wasm_bindgen(method, js_name = getValue)]
19    pub fn get_value(this: &Doc) -> JsValue;
20
21    #[wasm_bindgen(method, js_name = setValue)]
22    pub fn set_value(this: &Doc, text: &JsValue);
23
24    #[wasm_bindgen(method, js_name = setGutterMarker)]
25    pub fn set_gutter_marker(this: &Doc, line: &JsValue, gutter_id: &str) -> LineHandle;
26
27    #[wasm_bindgen(method, js_name = setGutterMarker)]
28    pub fn set_gutter_marker_with_element(
29        this: &Doc,
30        line: &JsValue,
31        gutter_id: &str,
32        value: &Element,
33    ) -> LineHandle;
34
35    #[wasm_bindgen(method, js_name = clearGutter)]
36    pub fn clear_gutter(this: &Doc, gutter_id: &str);
37}