Skip to content

Commit

Permalink
add boolean app
Browse files Browse the repository at this point in the history
  • Loading branch information
NailxSharipov committed Nov 15, 2024
1 parent 6965d36 commit 9335250
Show file tree
Hide file tree
Showing 26 changed files with 58,370 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs-gen/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Demo](./overlay/stars_demo.md)
- [Stars Rotation](./overlay/stars_demo.md)
- [Shapes Editor](./overlay/shapes_editor.md)
- [Boolean Editor](./overlay/boolean_editor.md)
- [Performance Comparison](./overlay/performance/performance.md)
- [Documentation](./overlay/stars_demo.md)
- [Filling Rules](./overlay/filling_rules/filling_rules.md)
Expand Down
16 changes: 16 additions & 0 deletions docs-gen/src/js/overlay_editor/editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import init, {WebApp} from './overlay_editor.js';

async function run() {
await init();
console.log('wasm module loaded');

const booleanData = await fetch('./tests_boolean.json').then((res) => res.text());
const stringData = await fetch('./tests_string.json').then((res) => res.text());
console.log('json files loaded');

const app = new WebApp();
console.log('WebApp starting');
app.start(booleanData, stringData);
}

run();
54 changes: 54 additions & 0 deletions docs-gen/src/js/overlay_editor/overlay_editor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
export class WebApp {
free(): void;
constructor();
/**
* @param {string} boolean_data
* @param {string} string_data
*/
start(boolean_data: string, string_data: string): void;
}

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

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_webapp_free: (a: number, b: number) => void;
readonly webapp_create: () => number;
readonly webapp_start: (a: number, b: number, c: number, d: number, e: number) => void;
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 __wbindgen_export_3: WebAssembly.Table;
readonly closure649_externref_shim: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdbe415c98a85d670: (a: number, b: number) => void;
readonly closure662_externref_shim: (a: number, b: number, c: number, d: number) => void;
readonly closure1299_externref_shim: (a: number, b: number, c: number) => void;
readonly closure1516_externref_shim: (a: number, b: number, c: number) => void;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
* 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>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit 9335250

Please sign in to comment.