UNPKG

frontend-hamroun

Version:

A lightweight frontend JavaScript framework with React-like syntax

37 lines 1.28 kB
/** * Go WebAssembly Integration Utilities * * This module provides tools for loading and interacting with Go WASM modules * in browser and server environments. */ export interface GoWasmInstance { instance: WebAssembly.Instance; module: WebAssembly.Module; exports: any; functions: Record<string, Function>; } export interface GoWasmOptions { importObject?: WebAssembly.Imports; goWasmPath?: string; loadGo?: boolean; onLoad?: (instance: GoWasmInstance) => void; debug?: boolean; } /** * Load a Go WASM module from a URL */ export declare function loadGoWasm(wasmUrl: string, options?: GoWasmOptions): Promise<GoWasmInstance>; /** * Create a TypeScript-friendly wrapper for Go WASM functions */ export declare function createTypedWasmFunction<T extends (...args: any[]) => any>(instance: GoWasmInstance, functionName: string): T; /** * Helper to convert JavaScript values to Go-compatible formats */ export declare const goValues: { stringToGo: (instance: GoWasmInstance, str: string) => number; stringFromGo: (instance: GoWasmInstance, ptr: number) => string; objectToGo: (instance: GoWasmInstance, obj: any) => number; objectFromGo: (instance: GoWasmInstance, ptr: number) => any; }; //# sourceMappingURL=wasm.d.ts.map