@yabgu_gm/tensionscript 0.10.0 → 0.11.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "imports": {
3
- "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.10.0/dist/assemblyscript.js",
4
- "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.10.0/dist/asc.js",
3
+ "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.1/dist/assemblyscript.js",
4
+ "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.1/dist/asc.js",
5
5
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@131.0.0-nightly.20260721/index.js",
6
6
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
7
7
  }
package/dist/web.js CHANGED
@@ -1,8 +1,8 @@
1
- var TENSIONSCRIPT_VERSION = "0.10.0";
1
+ var TENSIONSCRIPT_VERSION = "0.11.1";
2
2
  var TENSIONSCRIPT_IMPORTMAP = {
3
3
  "imports": {
4
- "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.10.0/dist/assemblyscript.js",
5
- "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.10.0/dist/asc.js",
4
+ "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.1/dist/assemblyscript.js",
5
+ "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.1/dist/asc.js",
6
6
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@131.0.0-nightly.20260721/index.js",
7
7
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
8
8
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "tensionscript",
9
9
  "wasm"
10
10
  ],
11
- "version": "0.10.0",
11
+ "version": "0.11.1",
12
12
  "author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
13
13
  "license": "Apache-2.0",
14
14
  "homepage": "https://github.com/Yabgu/Tension",
@@ -174,6 +174,21 @@ export declare function alignof<T>(): usize; // | u32 / u64
174
174
  @builtin
175
175
  export declare function offsetof<T>(fieldName?: string): usize; // | u32 / u64
176
176
 
177
+ /**
178
+ * Copies an `@inline struct` value's leaves into memory at `dest`, one store
179
+ * per leaf at `dest + offsetof(leaf)`.
180
+ *
181
+ * The value must be **SROA-tracked**: a local of the value, or a path into one
182
+ * (`copyInto(at, outer.inner)`). There is no value expression to evaluate — an
183
+ * inline value has no representation and no address — which is why
184
+ * `changetype<usize>(value)` stays refused: the address it would return belongs
185
+ * to a temp nobody tracks. `copyInto` names the destination instead, so the
186
+ * copy is explicit and the bytes land where the caller chose.
187
+ */
188
+ // @ts-ignore: decorator
189
+ @builtin
190
+ export declare function copyInto(dest: usize, value: any): void;
191
+
177
192
  /**
178
193
  * The ABI name of a field: its `@abi.alias("…")` if the declaration has one,
179
194
  * else the field's TypeScript name. Compile-time, like `offsetof`.
@@ -214,6 +214,8 @@ declare function offsetof<T>(): usize;
214
214
  declare function offsetof<T>(fieldName: keyof T | string): usize;
215
215
  /** Determines the offset of the specified field within the given class type. Returns the class type's end offset if field name has been omitted. Compiles to a constant. */
216
216
  declare function offsetof<T>(fieldName?: string): usize;
217
+ /** Copies an `@inline struct` value's leaves into memory at `dest`, one store per leaf at `dest + offsetof(leaf)`. The value must be held in a local (or a path into one); an inline value has no address to lend, which is why `changetype<usize>(value)` stays refused. */
218
+ declare function copyInto(dest: usize, value: any): void;
217
219
  /** Determines the ABI name of the specified field: its `@abi.alias` if declared, else the field's TypeScript name. Compiles to a constant. */
218
220
  declare function abiNameOf<T>(fieldName: string): string;
219
221
  /** Determines the name of a given type. */