@foxar/foxarkit-types 1.0.0
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 +44 -0
- package/index.d.ts +12 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @foxar/foxarkit-types
|
|
2
|
+
|
|
3
|
+
TypeScript definitions for [FoxarKit](https://https://github.com/FoxarXR/FoxarKit) WASM exports.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @foxar/foxarkit-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with pnpm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @foxar/foxarkit-types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { FoxarExports } from '@foxar/foxarkit-types'
|
|
21
|
+
|
|
22
|
+
async function loadFoxarKit() {
|
|
23
|
+
const wasmModule = await WebAssembly.instantiateStreaming(
|
|
24
|
+
fetch('/foxarkit.wasm'),
|
|
25
|
+
{ /* imports */ }
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const exports = wasmModule.instance.exports as FoxarExports
|
|
29
|
+
|
|
30
|
+
// Type-safe WASM calls
|
|
31
|
+
const result = exports.fxr_add(2, 3)
|
|
32
|
+
console.log(result) // 5
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Auto-generated
|
|
37
|
+
|
|
38
|
+
This package is automatically generated from the FoxarKit source code. Do not edit manually.
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
Proprietary
|
|
43
|
+
All rights reserved
|
|
44
|
+
© Foxar
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Auto-generated from FoxarKit WASM exports
|
|
2
|
+
// DO NOT EDIT MANUALLY
|
|
3
|
+
// Generated: 2025-11-28T12:40:12Z
|
|
4
|
+
|
|
5
|
+
export type FoxarExports = {
|
|
6
|
+
memory: WebAssembly.Memory
|
|
7
|
+
fxr_add(lhs: number, rhs: number): number
|
|
8
|
+
write_byte(pointer: number, value: number): void
|
|
9
|
+
allocate(size: number): number
|
|
10
|
+
deallocate(pointer: number, size: number): void
|
|
11
|
+
concatenate(s1: number, s2: number): number
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@foxar/foxarkit-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript definitions for FoxarKit WASM exports",
|
|
5
|
+
"main": "index.d.ts",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.d.ts"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/FoxarXR/foxarkit-types.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"foxar",
|
|
16
|
+
"wasm",
|
|
17
|
+
"webassembly",
|
|
18
|
+
"typescript",
|
|
19
|
+
"types"
|
|
20
|
+
],
|
|
21
|
+
"author": "Foxar",
|
|
22
|
+
"license": "Proprietary",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
}
|
|
27
|
+
}
|