use js_sys::{Array, Function, Object};
use wasm_bindgen::{prelude::*, JsCast};
use web_sys::{HtmlElement, KeyboardEvent, MouseEvent, Worker};
pub mod editor;
pub mod languages;
pub type GetWorkerFn = dyn FnMut(String, String) -> Worker;
pub type GetWorkerUrlFn = dyn FnMut(String, String) -> String;
impl Default for Environment {
fn default() -> Self {
Object::new().unchecked_into()
}
}
#[cfg_attr(debug_assertions, wasm_bindgen(module = "/js/debug/editor.js"))]
#[cfg_attr(not(debug_assertions), wasm_bindgen(module = "/js/release/editor.js"))]
extern "C" {
#[derive(Debug)]
pub type Emitter;
#[wasm_bindgen(constructor, js_class = "Emitter")]
pub fn new() -> Emitter;
#[wasm_bindgen(method, js_class = "Emitter", js_name = "event", getter = event)]
pub fn event(this: &Emitter) -> Function;
#[wasm_bindgen(method, js_class = "Emitter", js_name = "fire")]
pub fn fire(this: &Emitter, event: &JsValue);
#[wasm_bindgen(method, js_class = "Emitter", js_name = "dispose")]
pub fn dispose(this: &Emitter);
#[derive(Debug)]
pub type CancellationTokenSource;
#[wasm_bindgen(constructor, js_class = "CancellationTokenSource")]
pub fn new(parent: &CancellationToken) -> CancellationTokenSource;
#[wasm_bindgen(method, js_class = "CancellationTokenSource", js_name = "token", getter = token)]
pub fn token(this: &CancellationTokenSource) -> CancellationToken;
#[wasm_bindgen(method, js_class = "CancellationTokenSource", js_name = "cancel")]
pub fn cancel(this: &CancellationTokenSource);
#[wasm_bindgen(method, js_class = "CancellationTokenSource", js_name = "dispose")]
pub fn dispose(this: &CancellationTokenSource, cancel: bool);
#[derive(Debug)]
#[wasm_bindgen(extends = UriComponents)]
pub type Uri;
#[wasm_bindgen(js_class = "Uri", js_name = "isUri", static_method_of = Uri)]
pub fn is_uri(thing: &JsValue) -> bool;
#[wasm_bindgen(method, js_class = "Uri", js_name = "scheme", getter = scheme)]
pub fn scheme(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "authority", getter = authority)]
pub fn authority(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "path", getter = path)]
pub fn path(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "query", getter = query)]
pub fn query(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "fragment", getter = fragment)]
pub fn fragment(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "fsPath", getter = fsPath)]
pub fn fs_path(this: &Uri) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "with")]
pub fn with(this: &Uri, change: &Object) -> Uri;
#[wasm_bindgen(js_class = "Uri", js_name = "parse", static_method_of = Uri)]
pub fn parse(value: &str, _strict: bool) -> Uri;
#[wasm_bindgen(js_class = "Uri", js_name = "file", static_method_of = Uri)]
pub fn file(path: &str) -> Uri;
#[wasm_bindgen(js_class = "Uri", js_name = "from", static_method_of = Uri)]
pub fn from(components: &Object) -> Uri;
#[wasm_bindgen(method, js_class = "Uri", js_name = "toString")]
pub fn to_string(this: &Uri, skip_encoding: bool) -> String;
#[wasm_bindgen(method, js_class = "Uri", js_name = "toJSON")]
pub fn to_json(this: &Uri) -> UriComponents;
#[wasm_bindgen(js_class = "Uri", js_name = "revive", static_method_of = Uri)]
pub fn revive(data: &UriComponents) -> Uri;
#[wasm_bindgen(js_class = "Uri", js_name = "revive", static_method_of = Uri)]
pub fn revive_option(data: Option<&UriComponents>) -> Option<Uri>;
#[derive(Debug)]
pub type KeyMod;
#[wasm_bindgen(static_method_of = KeyMod, js_class = "KeyMod", js_name = "CtrlCmd", getter = CtrlCmd)]
pub fn ctrl_cmd() -> f64;
#[wasm_bindgen(static_method_of = KeyMod, js_class = "KeyMod", js_name = "Shift", getter = Shift)]
pub fn shift() -> f64;
#[wasm_bindgen(static_method_of = KeyMod, js_class = "KeyMod", js_name = "Alt", getter = Alt)]
pub fn alt() -> f64;
#[wasm_bindgen(static_method_of = KeyMod, js_class = "KeyMod", js_name = "WinCtrl", getter = WinCtrl)]
pub fn win_ctrl() -> f64;
#[wasm_bindgen(js_class = "KeyMod", js_name = "chord", static_method_of = KeyMod)]
pub fn chord(first_part: f64, second_part: f64) -> f64;
#[derive(Debug)]
pub type Position;
#[wasm_bindgen(method, js_class = "Position", js_name = "lineNumber", getter = lineNumber)]
pub fn line_number(this: &Position) -> f64;
#[wasm_bindgen(method, js_class = "Position", js_name = "column", getter = column)]
pub fn column(this: &Position) -> f64;
#[wasm_bindgen(constructor, js_class = "Position")]
pub fn new(line_number: f64, column: f64) -> Position;
#[wasm_bindgen(method, js_class = "Position", js_name = "with")]
pub fn with(this: &Position, new_line_number: f64, new_column: f64) -> Position;
#[wasm_bindgen(method, js_class = "Position", js_name = "delta")]
pub fn delta(this: &Position, delta_line_number: f64, delta_column: f64) -> Position;
#[wasm_bindgen(method, js_class = "Position", js_name = "equals")]
pub fn equals(this: &Position, other: &IPosition) -> bool;
#[wasm_bindgen(js_class = "Position", js_name = "equals", static_method_of = Position)]
pub fn equals_static(a: Option<&IPosition>, b: Option<&IPosition>) -> bool;
#[wasm_bindgen(method, js_class = "Position", js_name = "isBefore")]
pub fn is_before(this: &Position, other: &IPosition) -> bool;
#[wasm_bindgen(js_class = "Position", js_name = "isBefore", static_method_of = Position)]
pub fn is_before_static(a: &IPosition, b: &IPosition) -> bool;
#[wasm_bindgen(method, js_class = "Position", js_name = "isBeforeOrEqual")]
pub fn is_before_or_equal(this: &Position, other: &IPosition) -> bool;
#[wasm_bindgen(js_class = "Position", js_name = "isBeforeOrEqual", static_method_of = Position)]
pub fn is_before_or_equal_static(a: &IPosition, b: &IPosition) -> bool;
#[wasm_bindgen(js_class = "Position", js_name = "compare", static_method_of = Position)]
pub fn compare(a: &IPosition, b: &IPosition) -> f64;
#[wasm_bindgen(method, js_class = "Position", js_name = "clone")]
pub fn clone(this: &Position) -> Position;
#[wasm_bindgen(method, js_class = "Position", js_name = "toString")]
pub fn to_string(this: &Position) -> String;
#[wasm_bindgen(js_class = "Position", js_name = "lift", static_method_of = Position)]
pub fn lift(pos: &IPosition) -> Position;
#[wasm_bindgen(js_class = "Position", js_name = "isIPosition", static_method_of = Position)]
pub fn is_iposition(obj: &JsValue) -> bool;
#[derive(Debug)]
pub type Range;
#[wasm_bindgen(method, js_class = "Range", js_name = "startLineNumber", getter = startLineNumber)]
pub fn start_line_number(this: &Range) -> f64;
#[wasm_bindgen(method, js_class = "Range", js_name = "startColumn", getter = startColumn)]
pub fn start_column(this: &Range) -> f64;
#[wasm_bindgen(method, js_class = "Range", js_name = "endLineNumber", getter = endLineNumber)]
pub fn end_line_number(this: &Range) -> f64;
#[wasm_bindgen(method, js_class = "Range", js_name = "endColumn", getter = endColumn)]
pub fn end_column(this: &Range) -> f64;
#[wasm_bindgen(constructor, js_class = "Range")]
pub fn new(
start_line_number: f64,
start_column: f64,
end_line_number: f64,
end_column: f64,
) -> Range;
#[wasm_bindgen(method, js_class = "Range", js_name = "isEmpty")]
pub fn is_empty(this: &Range) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "isEmpty", static_method_of = Range)]
pub fn is_empty_static(range: &IRange) -> bool;
#[wasm_bindgen(method, js_class = "Range", js_name = "containsPosition")]
pub fn contains_position(this: &Range, position: &IPosition) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "containsPosition", static_method_of = Range)]
pub fn contains_position_static(range: &IRange, position: &IPosition) -> bool;
#[wasm_bindgen(method, js_class = "Range", js_name = "containsRange")]
pub fn contains_range(this: &Range, range: &IRange) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "containsRange", static_method_of = Range)]
pub fn contains_range_static(range: &IRange, other_range: &IRange) -> bool;
#[wasm_bindgen(method, js_class = "Range", js_name = "strictContainsRange")]
pub fn strict_contains_range(this: &Range, range: &IRange) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "strictContainsRange", static_method_of = Range)]
pub fn strict_contains_range_static(range: &IRange, other_range: &IRange) -> bool;
#[wasm_bindgen(method, js_class = "Range", js_name = "plusRange")]
pub fn plus_range(this: &Range, range: &IRange) -> Range;
#[wasm_bindgen(js_class = "Range", js_name = "plusRange", static_method_of = Range)]
pub fn plus_range_static(a: &IRange, b: &IRange) -> Range;
#[wasm_bindgen(method, js_class = "Range", js_name = "intersectRanges")]
pub fn intersect_ranges(this: &Range, range: &IRange) -> Option<Range>;
#[wasm_bindgen(js_class = "Range", js_name = "intersectRanges", static_method_of = Range)]
pub fn intersect_ranges_static(a: &IRange, b: &IRange) -> Option<Range>;
#[wasm_bindgen(method, js_class = "Range", js_name = "equalsRange")]
pub fn equals_range(this: &Range, other: Option<&IRange>) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "equalsRange", static_method_of = Range)]
pub fn equals_range_static(a: Option<&IRange>, b: Option<&IRange>) -> bool;
#[wasm_bindgen(method, js_class = "Range", js_name = "getEndPosition")]
pub fn get_end_position(this: &Range) -> Position;
#[wasm_bindgen(method, js_class = "Range", js_name = "getStartPosition")]
pub fn get_start_position(this: &Range) -> Position;
#[wasm_bindgen(method, js_class = "Range", js_name = "toString")]
pub fn to_string(this: &Range) -> String;
#[wasm_bindgen(method, js_class = "Range", js_name = "setEndPosition")]
pub fn set_end_position(this: &Range, end_line_number: f64, end_column: f64) -> Range;
#[wasm_bindgen(method, js_class = "Range", js_name = "setStartPosition")]
pub fn set_start_position(this: &Range, start_line_number: f64, start_column: f64) -> Range;
#[wasm_bindgen(method, js_class = "Range", js_name = "collapseToStart")]
pub fn collapse_to_start(this: &Range) -> Range;
#[wasm_bindgen(js_class = "Range", js_name = "collapseToStart", static_method_of = Range)]
pub fn collapse_to_start_static(range: &IRange) -> Range;
#[wasm_bindgen(js_class = "Range", js_name = "fromPositions", static_method_of = Range)]
pub fn from_positions(start: &IPosition, end: &IPosition) -> Range;
#[wasm_bindgen(js_class = "Range", js_name = "lift", static_method_of = Range)]
pub fn lift(range: &IRange) -> Range;
#[wasm_bindgen(js_class = "Range", js_name = "isIRange", static_method_of = Range)]
pub fn is_irange(obj: &JsValue) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "areIntersectingOrTouching", static_method_of = Range)]
pub fn are_intersecting_or_touching(a: &IRange, b: &IRange) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "areIntersecting", static_method_of = Range)]
pub fn are_intersecting(a: &IRange, b: &IRange) -> bool;
#[wasm_bindgen(js_class = "Range", js_name = "compareRangesUsingStarts", static_method_of = Range)]
pub fn compare_ranges_using_starts(a: Option<&IRange>, b: Option<&IRange>) -> f64;
#[wasm_bindgen(js_class = "Range", js_name = "compareRangesUsingEnds", static_method_of = Range)]
pub fn compare_ranges_using_ends(a: &IRange, b: &IRange) -> f64;
#[wasm_bindgen(js_class = "Range", js_name = "spansMultipleLines", static_method_of = Range)]
pub fn spans_multiple_lines(range: &IRange) -> bool;
#[derive(Debug)]
#[wasm_bindgen(extends = Range)]
pub type Selection;
#[wasm_bindgen(method, js_class = "Selection", js_name = "selectionStartLineNumber", getter = selectionStartLineNumber)]
pub fn selection_start_line_number(this: &Selection) -> f64;
#[wasm_bindgen(method, js_class = "Selection", js_name = "selectionStartColumn", getter = selectionStartColumn)]
pub fn selection_start_column(this: &Selection) -> f64;
#[wasm_bindgen(method, js_class = "Selection", js_name = "positionLineNumber", getter = positionLineNumber)]
pub fn position_line_number(this: &Selection) -> f64;
#[wasm_bindgen(method, js_class = "Selection", js_name = "positionColumn", getter = positionColumn)]
pub fn position_column(this: &Selection) -> f64;
#[wasm_bindgen(constructor, js_class = "Selection")]
pub fn new(
selection_start_line_number: f64,
selection_start_column: f64,
position_line_number: f64,
position_column: f64,
) -> Selection;
#[wasm_bindgen(method, js_class = "Selection", js_name = "toString")]
pub fn to_string(this: &Selection) -> String;
#[wasm_bindgen(method, js_class = "Selection", js_name = "equalsSelection")]
pub fn equals_selection(this: &Selection, other: &ISelection) -> bool;
#[wasm_bindgen(js_class = "Selection", js_name = "selectionsEqual", static_method_of = Selection)]
pub fn selections_equal(a: &ISelection, b: &ISelection) -> bool;
#[wasm_bindgen(method, js_class = "Selection", js_name = "getDirection")]
pub fn get_direction(this: &Selection) -> SelectionDirection;
#[wasm_bindgen(method, js_class = "Selection", js_name = "setEndPosition")]
pub fn set_end_position(this: &Selection, end_line_number: f64, end_column: f64) -> Selection;
#[wasm_bindgen(method, js_class = "Selection", js_name = "getPosition")]
pub fn get_position(this: &Selection) -> Position;
#[wasm_bindgen(method, js_class = "Selection", js_name = "setStartPosition")]
pub fn set_start_position(
this: &Selection,
start_line_number: f64,
start_column: f64,
) -> Selection;
#[wasm_bindgen(js_class = "Selection", js_name = "fromPositions", static_method_of = Selection)]
pub fn from_positions(start: &IPosition, end: &IPosition) -> Selection;
#[wasm_bindgen(js_class = "Selection", js_name = "liftSelection", static_method_of = Selection)]
pub fn lift_selection(sel: &ISelection) -> Selection;
#[wasm_bindgen(js_class = "Selection", js_name = "selectionsArrEqual", static_method_of = Selection)]
pub fn selections_arr_equal(a: &Array, b: &Array) -> bool;
#[wasm_bindgen(js_class = "Selection", js_name = "isISelection", static_method_of = Selection)]
pub fn is_iselection(obj: &JsValue) -> bool;
#[wasm_bindgen(js_class = "Selection", js_name = "createWithDirection", static_method_of = Selection)]
pub fn create_with_direction(
start_line_number: f64,
start_column: f64,
end_line_number: f64,
end_column: f64,
direction: SelectionDirection,
) -> Selection;
#[derive(Debug)]
pub type Token;
#[wasm_bindgen(method, js_class = "Token", js_name = "offset", getter = offset)]
pub fn offset(this: &Token) -> f64;
#[wasm_bindgen(method, js_class = "Token", js_name = "type", getter = type)]
pub fn type_(this: &Token) -> String;
#[wasm_bindgen(method, js_class = "Token", js_name = "language", getter = language)]
pub fn language(this: &Token) -> String;
#[wasm_bindgen(constructor, js_class = "Token")]
pub fn new(offset: f64, type_: &str, language: &str) -> Token;
#[wasm_bindgen(method, js_class = "Token", js_name = "toString")]
pub fn to_string(this: &Token) -> String;
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type Environment;
#[wasm_bindgen(method, js_class = "Environment", js_name = "baseUrl", getter = baseUrl)]
pub fn base_url(this: &Environment) -> Option<String>;
#[wasm_bindgen(method, js_class = "Environment", js_name = "baseUrl", setter = baseUrl)]
pub fn set_base_url(this: &Environment, val: Option<&str>);
#[wasm_bindgen(method, js_class = "Environment", js_name = "getWorker", getter = getWorker)]
pub fn get_worker(this: &Environment) -> Option<Function>;
#[wasm_bindgen(method, js_class = "Environment", js_name = "getWorker", setter = getWorker)]
pub fn set_get_worker(this: &Environment, val: Option<&Function>);
#[wasm_bindgen(method, js_class = "Environment", js_name = "getWorkerUrl", getter = getWorkerUrl)]
pub fn get_worker_url(this: &Environment) -> Option<Function>;
#[wasm_bindgen(method, js_class = "Environment", js_name = "getWorkerUrl", setter = getWorkerUrl)]
pub fn set_get_worker_url(this: &Environment, val: Option<&Function>);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IDisposable;
#[wasm_bindgen(method, js_class = "IDisposable", js_name = "dispose")]
pub fn dispose(this: &IDisposable);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type CancellationToken;
#[wasm_bindgen(method, js_class = "CancellationToken", js_name = "isCancellationRequested", getter = isCancellationRequested)]
pub fn is_cancellation_requested(this: &CancellationToken) -> bool;
#[wasm_bindgen(method, js_class = "CancellationToken", js_name = "onCancellationRequested", getter = onCancellationRequested)]
pub fn on_cancellation_requested(this: &CancellationToken) -> Function;
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type UriComponents;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "scheme", getter = scheme)]
pub fn scheme(this: &UriComponents) -> String;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "scheme", setter = scheme)]
pub fn set_scheme(this: &UriComponents, val: &str);
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "authority", getter = authority)]
pub fn authority(this: &UriComponents) -> String;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "authority", setter = authority)]
pub fn set_authority(this: &UriComponents, val: &str);
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "path", getter = path)]
pub fn path(this: &UriComponents) -> String;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "path", setter = path)]
pub fn set_path(this: &UriComponents, val: &str);
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "query", getter = query)]
pub fn query(this: &UriComponents) -> String;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "query", setter = query)]
pub fn set_query(this: &UriComponents, val: &str);
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "fragment", getter = fragment)]
pub fn fragment(this: &UriComponents) -> String;
#[wasm_bindgen(method, js_class = "UriComponents", js_name = "fragment", setter = fragment)]
pub fn set_fragment(this: &UriComponents, val: &str);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IMarkdownString;
#[wasm_bindgen(method, js_class = "IMarkdownString", js_name = "value", getter = value)]
pub fn value(this: &IMarkdownString) -> String;
#[wasm_bindgen(method, js_class = "IMarkdownString", js_name = "isTrusted", getter = isTrusted)]
pub fn is_trusted(this: &IMarkdownString) -> Option<bool>;
#[wasm_bindgen(method, js_class = "IMarkdownString", js_name = "supportThemeIcons", getter = supportThemeIcons)]
pub fn support_theme_icons(this: &IMarkdownString) -> Option<bool>;
#[wasm_bindgen(method, js_class = "IMarkdownString", js_name = "uris", getter = uris)]
pub fn uris(this: &IMarkdownString) -> Option<Object>;
#[wasm_bindgen(method, js_class = "IMarkdownString", js_name = "uris", setter = uris)]
pub fn set_uris(this: &IMarkdownString, val: Option<&Object>);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IKeyboardEvent;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "browserEvent", getter = browserEvent)]
pub fn browser_event(this: &IKeyboardEvent) -> KeyboardEvent;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "target", getter = target)]
pub fn target(this: &IKeyboardEvent) -> HtmlElement;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "ctrlKey", getter = ctrlKey)]
pub fn ctrl_key(this: &IKeyboardEvent) -> bool;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "shiftKey", getter = shiftKey)]
pub fn shift_key(this: &IKeyboardEvent) -> bool;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "altKey", getter = altKey)]
pub fn alt_key(this: &IKeyboardEvent) -> bool;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "metaKey", getter = metaKey)]
pub fn meta_key(this: &IKeyboardEvent) -> bool;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "keyCode", getter = keyCode)]
pub fn key_code(this: &IKeyboardEvent) -> KeyCode;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "code", getter = code)]
pub fn code(this: &IKeyboardEvent) -> String;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "equals")]
pub fn equals(this: &IKeyboardEvent, keybinding: f64) -> bool;
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "preventDefault")]
pub fn prevent_default(this: &IKeyboardEvent);
#[wasm_bindgen(method, js_class = "IKeyboardEvent", js_name = "stopPropagation")]
pub fn stop_propagation(this: &IKeyboardEvent);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IMouseEvent;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "browserEvent", getter = browserEvent)]
pub fn browser_event(this: &IMouseEvent) -> MouseEvent;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "leftButton", getter = leftButton)]
pub fn left_button(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "middleButton", getter = middleButton)]
pub fn middle_button(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "rightButton", getter = rightButton)]
pub fn right_button(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "buttons", getter = buttons)]
pub fn buttons(this: &IMouseEvent) -> f64;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "target", getter = target)]
pub fn target(this: &IMouseEvent) -> HtmlElement;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "detail", getter = detail)]
pub fn detail(this: &IMouseEvent) -> f64;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "posx", getter = posx)]
pub fn posx(this: &IMouseEvent) -> f64;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "posy", getter = posy)]
pub fn posy(this: &IMouseEvent) -> f64;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "ctrlKey", getter = ctrlKey)]
pub fn ctrl_key(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "shiftKey", getter = shiftKey)]
pub fn shift_key(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "altKey", getter = altKey)]
pub fn alt_key(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "metaKey", getter = metaKey)]
pub fn meta_key(this: &IMouseEvent) -> bool;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "timestamp", getter = timestamp)]
pub fn timestamp(this: &IMouseEvent) -> f64;
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "preventDefault")]
pub fn prevent_default(this: &IMouseEvent);
#[wasm_bindgen(method, js_class = "IMouseEvent", js_name = "stopPropagation")]
pub fn stop_propagation(this: &IMouseEvent);
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IScrollEvent;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollTop", getter = scrollTop)]
pub fn scroll_top(this: &IScrollEvent) -> f64;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollLeft", getter = scrollLeft)]
pub fn scroll_left(this: &IScrollEvent) -> f64;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollWidth", getter = scrollWidth)]
pub fn scroll_width(this: &IScrollEvent) -> f64;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollHeight", getter = scrollHeight)]
pub fn scroll_height(this: &IScrollEvent) -> f64;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollTopChanged", getter = scrollTopChanged)]
pub fn scroll_top_changed(this: &IScrollEvent) -> bool;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollLeftChanged", getter = scrollLeftChanged)]
pub fn scroll_left_changed(this: &IScrollEvent) -> bool;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollWidthChanged", getter = scrollWidthChanged)]
pub fn scroll_width_changed(this: &IScrollEvent) -> bool;
#[wasm_bindgen(method, js_class = "IScrollEvent", js_name = "scrollHeightChanged", getter = scrollHeightChanged)]
pub fn scroll_height_changed(this: &IScrollEvent) -> bool;
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IPosition;
#[wasm_bindgen(method, js_class = "IPosition", js_name = "lineNumber", getter = lineNumber)]
pub fn line_number(this: &IPosition) -> f64;
#[wasm_bindgen(method, js_class = "IPosition", js_name = "column", getter = column)]
pub fn column(this: &IPosition) -> f64;
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type IRange;
#[wasm_bindgen(method, js_class = "IRange", js_name = "startLineNumber", getter = startLineNumber)]
pub fn start_line_number(this: &IRange) -> f64;
#[wasm_bindgen(method, js_class = "IRange", js_name = "startColumn", getter = startColumn)]
pub fn start_column(this: &IRange) -> f64;
#[wasm_bindgen(method, js_class = "IRange", js_name = "endLineNumber", getter = endLineNumber)]
pub fn end_line_number(this: &IRange) -> f64;
#[wasm_bindgen(method, js_class = "IRange", js_name = "endColumn", getter = endColumn)]
pub fn end_column(this: &IRange) -> f64;
}
#[wasm_bindgen]
extern "C" {
#[derive(Debug)]
#[wasm_bindgen(extends = Object)]
pub type ISelection;
#[wasm_bindgen(method, js_class = "ISelection", js_name = "selectionStartLineNumber", getter = selectionStartLineNumber)]
pub fn selection_start_line_number(this: &ISelection) -> f64;
#[wasm_bindgen(method, js_class = "ISelection", js_name = "selectionStartColumn", getter = selectionStartColumn)]
pub fn selection_start_column(this: &ISelection) -> f64;
#[wasm_bindgen(method, js_class = "ISelection", js_name = "positionLineNumber", getter = positionLineNumber)]
pub fn position_line_number(this: &ISelection) -> f64;
#[wasm_bindgen(method, js_class = "ISelection", js_name = "positionColumn", getter = positionColumn)]
pub fn position_column(this: &ISelection) -> f64;
}
int_enum! {
pub enum MarkerTag {
Unnecessary = 1,
Deprecated = 2,
}
}
int_enum! {
pub enum MarkerSeverity {
Hint = 1,
Info = 2,
Warning = 4,
Error = 8,
}
}
int_enum! {
pub enum KeyCode {
Unknown = 0,
Backspace = 1,
Tab = 2,
Enter = 3,
Shift = 4,
Ctrl = 5,
Alt = 6,
Pausebreak = 7,
Capslock = 8,
Escape = 9,
Space = 10,
Pageup = 11,
Pagedown = 12,
End = 13,
Home = 14,
Leftarrow = 15,
Uparrow = 16,
Rightarrow = 17,
Downarrow = 18,
Insert = 19,
Delete = 20,
Key0 = 21,
Key1 = 22,
Key2 = 23,
Key3 = 24,
Key4 = 25,
Key5 = 26,
Key6 = 27,
Key7 = 28,
Key8 = 29,
Key9 = 30,
KeyA = 31,
KeyB = 32,
KeyC = 33,
KeyD = 34,
KeyE = 35,
KeyF = 36,
KeyG = 37,
KeyH = 38,
KeyI = 39,
KeyJ = 40,
KeyK = 41,
KeyL = 42,
KeyM = 43,
KeyN = 44,
KeyO = 45,
KeyP = 46,
KeyQ = 47,
KeyR = 48,
KeyS = 49,
KeyT = 50,
KeyU = 51,
KeyV = 52,
KeyW = 53,
KeyX = 54,
KeyY = 55,
KeyZ = 56,
Meta = 57,
Contextmenu = 58,
F1 = 59,
F2 = 60,
F3 = 61,
F4 = 62,
F5 = 63,
F6 = 64,
F7 = 65,
F8 = 66,
F9 = 67,
F10 = 68,
F11 = 69,
F12 = 70,
F13 = 71,
F14 = 72,
F15 = 73,
F16 = 74,
F17 = 75,
F18 = 76,
F19 = 77,
Numlock = 78,
Scrolllock = 79,
UsSemicolon = 80,
UsEqual = 81,
UsComma = 82,
UsMinus = 83,
UsDot = 84,
UsSlash = 85,
UsBacktick = 86,
UsOpenSquareBracket = 87,
UsBackslash = 88,
UsCloseSquareBracket = 89,
UsQuote = 90,
Oem8 = 91,
Oem102 = 92,
Numpad0 = 93,
Numpad1 = 94,
Numpad2 = 95,
Numpad3 = 96,
Numpad4 = 97,
Numpad5 = 98,
Numpad6 = 99,
Numpad7 = 100,
Numpad8 = 101,
Numpad9 = 102,
NumpadMultiply = 103,
NumpadAdd = 104,
NumpadSeparator = 105,
NumpadSubtract = 106,
NumpadDecimal = 107,
NumpadDivide = 108,
KeyInComposition = 109,
AbntC1 = 110,
AbntC2 = 111,
MaxValue = 112,
}
}
int_enum! {
pub enum SelectionDirection {
Ltr = 0,
Rtl = 1,
}
}