@hazae41/stdbob 0.0.10 → 0.0.12

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.0.10",
4
+ "version": "0.0.12",
5
5
  "description": "Standard libraries for Bobine WebAssembly VM",
6
6
  "repository": "github:hazae41/stdbob",
7
7
  "author": "hazae41",
@@ -5,14 +5,6 @@ export type bigintref = externref
5
5
 
6
6
  export namespace bigints {
7
7
 
8
- // @ts-ignore: decorator
9
- @external("bigints", "identity")
10
- export declare function from(bigint: i64): bigintref
11
-
12
- // @ts-ignore: decorator
13
- @external("bigints", "identity")
14
- export declare function into(bigint: bigintref): i64
15
-
16
8
  // @ts-ignore: decorator
17
9
  @external("bigints", "zero")
18
10
  export declare function zero(): bigintref
@@ -100,6 +92,7 @@ export namespace bigints {
100
92
  // @ts-ignore: decorator
101
93
  @external("bigints", "to_base16")
102
94
  export declare function toBase16(bigint: bigintref): textref
95
+
103
96
  // @ts-ignore: decorator
104
97
  @external("bigints", "from_base10")
105
98
  export declare function fromBase10(text: textref): bigintref
@@ -108,4 +101,12 @@ export namespace bigints {
108
101
  @external("bigints", "to_base10")
109
102
  export declare function toBase10(bigint: bigintref): textref
110
103
 
104
+ // @ts-ignore: decorator
105
+ @external("bigints", "identity")
106
+ export declare function fromInt64(bigint: i64): bigintref
107
+
108
+ // @ts-ignore: decorator
109
+ @external("bigints", "identity")
110
+ export declare function toInt64(bigint: bigintref): i64
111
+
111
112
  }
@@ -23,7 +23,7 @@ export namespace blobs {
23
23
  export function load(blob: blobref): ArrayBuffer {
24
24
  const bytes = new Uint8Array(length(blob))
25
25
 
26
- $load(blob, bytes.dataStart)
26
+ $load(blob, <i32>bytes.dataStart)
27
27
 
28
28
  return bytes.buffer
29
29
  }
@@ -4,7 +4,7 @@ export type textref = externref
4
4
 
5
5
  export namespace texts {
6
6
 
7
- export function from(string: string): textref {
7
+ export function fromString(string: string): textref {
8
8
  const utf8 = String.UTF8.encode(string)
9
9
 
10
10
  const blob = blobs.save(utf8)
@@ -13,7 +13,7 @@ export namespace texts {
13
13
  return text
14
14
  }
15
15
 
16
- export function into(text: textref): string {
16
+ export function toString(text: textref): string {
17
17
  const blob = toUtf8(text)
18
18
  const utf8 = blobs.load(blob)
19
19