Define the js wasm-editor interface (#31)

This commit is contained in:
TrueDoctor
2021-03-21 19:32:56 +01:00
committed by Keavon Chambers
parent 1b8c71d2b3
commit d254916430
10 changed files with 75 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
mod utils;
mod viewport;
mod window;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
}
#[wasm_bindgen(start)]
pub fn init() {
utils::set_panic_hook();
alert("Hello, Graphite!");
}
/// Send events
#[wasm_bindgen]
pub fn handle_event(event_name: String) {
// TODO: add payload
todo!()
}