--target bundler generates static WASM ESM imports that only work through a bundler (vite-plugin-wasm). --target web generates fetch-based WASM loading via import.meta.url which browsers handle natively. - Change wasm-pack build target from bundler to web - Call wasmModule.default() (init) after import in maybeLoadWasm - Restore rollupOptions.external so WASM stays a separate fetch - Removes the need for vite-plugin-wasm in any consumer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
65 lines
3.7 KiB
TypeScript
65 lines
3.7 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
|
|
export function buttplug_activate_env_logger(_max_level: string): void;
|
|
|
|
export function buttplug_client_send_json_message(server_ptr: number, buf: Uint8Array, callback: Function): void;
|
|
|
|
export function buttplug_create_embedded_wasm_server(callback: Function): number;
|
|
|
|
export function buttplug_free_embedded_wasm_server(ptr: number): void;
|
|
|
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
|
|
export interface InitOutput {
|
|
readonly memory: WebAssembly.Memory;
|
|
readonly create_test_dcm: (a: number, b: number) => void;
|
|
readonly buttplug_activate_env_logger: (a: number, b: number) => void;
|
|
readonly buttplug_client_send_json_message: (a: number, b: number, c: number, d: any) => void;
|
|
readonly buttplug_create_embedded_wasm_server: (a: any) => number;
|
|
readonly buttplug_free_embedded_wasm_server: (a: number) => void;
|
|
readonly wasm_bindgen__closure__destroy__h72b504abf7ea70fd: (a: number, b: number) => void;
|
|
readonly wasm_bindgen__closure__destroy__ha3c8e2c9b0cf79cd: (a: number, b: number) => void;
|
|
readonly wasm_bindgen__closure__destroy__h0f95d90d24796def: (a: number, b: number) => void;
|
|
readonly wasm_bindgen__convert__closures_____invoke__hcd253b168dd40e38: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1_3: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1_4: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1_5: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1_6: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h0628356d4885b6d1_9: (a: number, b: number, c: any) => [number, number];
|
|
readonly wasm_bindgen__convert__closures_____invoke__h996ec8878d3e4243: (a: number, b: number, c: any) => void;
|
|
readonly wasm_bindgen__convert__closures_____invoke__h996ec8878d3e4243_8: (a: number, b: number, c: any) => void;
|
|
readonly wasm_bindgen__convert__closures_____invoke__h20343c2d1e7cb4cd: (a: number, b: number) => void;
|
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
readonly __externref_table_alloc: () => number;
|
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
readonly __externref_table_dealloc: (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>;
|