Skip to content

Commit

Permalink
v3.4.19
Browse files Browse the repository at this point in the history
  • Loading branch information
gruppler committed Aug 29, 2024
2 parents bdd02ec + 93cf3d3 commit d0d7fa4
Show file tree
Hide file tree
Showing 31 changed files with 4,176 additions and 2,134 deletions.
2 changes: 1 addition & 1 deletion embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<body>
<iframe
id="ninja"
src="http://localhost:8080/"
src="http://localhost:8080/&showControls=false&showPlayButton=false&showPTN=true&showText=true&showBoardPrefsBtn=true"
width="100%"
height="600px"
style="width: 100%; height: 600px; max-height: 100vh"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ptn-ninja",
"version": "3.4.18",
"version": "3.4.19",
"description": "An editor and viewer for Portable Tak Notation",
"productName": "PTN Ninja",
"author": "Craig Laparo <gruppler+github@gmail.com>",
Expand Down
674 changes: 674 additions & 0 deletions public/tiltak-wasm/LICENSE

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/tiltak-wasm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "tiltak-wasm",
"version": "0.0.5",
"license": "GPL-3.0-only",
"files": [
"tiltak_wasm_bg.wasm",
"tiltak_wasm.js",
"tiltak_wasm.d.ts"
],
"browser": "tiltak_wasm.js",
"types": "tiltak_wasm.d.ts"
}
19 changes: 19 additions & 0 deletions public/tiltak-wasm/tiltak.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
importScripts("./tiltak_wasm.js");

const { start_engine } = wasm_bindgen;

function init_wasm_in_worker() {
return wasm_bindgen("./tiltak_wasm_bg.wasm").then(() => {
const callback = start_engine((result) => {
self.postMessage(result);
});

callback("tei");

self.onmessage = ({ data }) => {
callback(data);
};
});
}

init_wasm_in_worker();
37 changes: 37 additions & 0 deletions public/tiltak-wasm/tiltak_wasm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
declare namespace wasm_bindgen {
/* tslint:disable */
/* eslint-disable */
/**
* Start the engine, which will run asynschronously in the background until it crashes
*
* @param {function(string): void} output_callback - Callback that receives tei output line by line
* @return {function(string): void} - Send one line of tei input to the engine
*/
export function start_engine(output_callback: Function): any;

}

declare type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

declare interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly start_engine: (a: number) => number;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h22cc4d5ac9747ad9: (a: number, b: number, c: number, d: number) => void;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd894afd280c5d257: (a: number, b: number, c: number) => void;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h035c2a7c04ebf686: (a: number, b: number, c: number, d: number) => void;
}

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
declare function wasm_bindgen (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit d0d7fa4

Please sign in to comment.