@hazae41/stdbob 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@hazae41/stdbob",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "description": "Standard libraries for Bobine WebAssembly VM",
6
6
  "repository": "github:hazae41/stdbob",
7
7
  "author": "hazae41",
@@ -1,5 +1,4 @@
1
1
  import { textref } from "../texts/mod"
2
- import { wrapref } from "../wraps/mod"
3
2
 
4
3
  export type blobref = externref
5
4
 
@@ -109,10 +108,10 @@ export namespace blobs {
109
108
  export declare function encode<T>(value: T): blobref
110
109
 
111
110
  /**
112
- * Decode the given blob into a value of type T (assuming it was encoded from a value of type T) in a in a wrapref or null if it failed
111
+ * Decode the given blob into a value of type T (assuming it was encoded from a value of type T)
113
112
  */
114
113
  // @ts-ignore: decorator
115
114
  @external("blobs", "decode")
116
- export declare function decode(blob: blobref): wrapref
115
+ export declare function decode<T>(blob: blobref): T
117
116
 
118
117
  }
@@ -23,7 +23,7 @@ export namespace modules {
23
23
  export declare function load(module: textref): blobref
24
24
 
25
25
  /**
26
- * Call the given method of the given module with the given parameters then return the result in a wrapref or null if it failed
26
+ * Call the given method of the given module with the given parameters then return the result in a wrapref
27
27
  */
28
28
  // @ts-ignore: decorator
29
29
  @external("modules", "call")
@@ -1,20 +1,21 @@
1
+
1
2
  /**
2
- * Convert between externrefs and local i32 indices (for use in data structures)
3
+ * Convert between values and local i32 indices (for use in data structures)
3
4
  */
4
5
  export namespace pointers {
5
6
 
6
7
  /**
7
- * Convert an externref to an i32 index
8
+ * Convert a value to an i32 index
8
9
  */
9
10
  // @ts-ignore: decorator
10
11
  @external("pointers", "numerize")
11
- export declare function numerize(ref: externref): i32
12
+ export declare function numerize<T>(value: T): i32
12
13
 
13
14
  /**
14
- * Convert an i32 index back to an externref
15
+ * Convert an i32 index back to a value
15
16
  */
16
17
  // @ts-ignore: decorator
17
18
  @external("pointers", "denumerize")
18
- export declare function denumerize(index: i32): externref
19
+ export declare function denumerize<T>(index: i32): T
19
20
 
20
21
  }
@@ -85,7 +85,7 @@ export namespace tuples {
85
85
  export declare function length(tuple: tupleref): i32
86
86
 
87
87
  /**
88
- * Get the value at the given index in the given tuple into a wrapref or null if not found
88
+ * Get the value at the given index in the given tuple in a wrapref or null if not found
89
89
  */
90
90
  // @ts-ignore: decorator
91
91
  @external("tuples", "get")