@danielsimonjr/mathts-wasm 0.3.3 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ npm run asbuild
30
30
  The published entry is AssemblyScript-generated glue in `build/mathts.js` (see
31
31
  `package.json` `exports["."]`). Import named functions directly:
32
32
 
33
- ```typescript
33
+ ```typescript node
34
34
  import { add_f64, sqrt_f64, sin_f64 } from '@danielsimonjr/mathts-wasm';
35
35
 
36
36
  console.log(add_f64(2, 3)); // 5
@@ -1,5 +1,9 @@
1
+ /** `WebAssembly.Memory` when the project has that type, else an object with its `buffer`. */
2
+ export type WasmMemory = typeof globalThis extends { WebAssembly: { Memory: { prototype: infer Instance } } }
3
+ ? Instance
4
+ : { readonly buffer: ArrayBufferLike };
1
5
  /** Exported memory */
2
- export declare const memory: WebAssembly.Memory;
6
+ export declare const memory: WasmMemory;
3
7
  // Exported runtime interface
4
8
  export declare function __new(size: number, id: number): number;
5
9
  export declare function __pin(ptr: number): number;
Binary file