mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Fix undefined behavior in the editor wasm bridge (#414)
* removed possible undifined behavior * changed naming of Editor -> JsEditorHandle * fix rust formatting Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { createJsDispatcher } from "@/dispatcher/js-dispatcher";
|
||||
import { JsMessageType } from "@/dispatcher/js-messages";
|
||||
|
||||
export type WasmInstance = typeof import("@/../wasm/pkg");
|
||||
export type RustEditorInstance = InstanceType<WasmInstance["Editor"]>;
|
||||
export type RustEditorInstance = InstanceType<WasmInstance["JsEditorHandle"]>;
|
||||
|
||||
let wasmImport: WasmInstance | null = null;
|
||||
export async function initWasm() {
|
||||
@@ -65,7 +65,7 @@ export function createEditorState() {
|
||||
dispatcher.handleJsMessage(messageType, data, rawWasm, instance);
|
||||
};
|
||||
|
||||
const instance = new rawWasm.Editor(rustCallback);
|
||||
const instance = new rawWasm.JsEditorHandle(rustCallback);
|
||||
|
||||
return {
|
||||
dispatcher,
|
||||
|
||||
Reference in New Issue
Block a user