Skip to content

Commit

Permalink
refactor(wasm-api): regenerate typescript sources
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Nov 9, 2024
1 parent 49d1bc5 commit 9055e0e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
9 changes: 6 additions & 3 deletions packages/wasm-api-canvas/src/generated/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by @thi.ng/wasm-api-bindgen at 2024-08-17T14:24:42.580Z
* Generated by @thi.ng/wasm-api-bindgen at 2024-11-09T16:15:12.500Z
* DO NOT EDIT!
*/

Expand All @@ -8,6 +8,9 @@ import { Pointer, WasmStringPtr, type IWasmMemoryAccess, type MemorySlice, type
// @ts-ignore
import { __array, __instanceArray, __slice32, __primslice32 } from "@thi.ng/wasm-api/memory";

// @ts-ignore possibly unused
const __str = (mem: IWasmMemoryAccess, base: number, isConst = true) => new WasmStringPtr(mem, base, isConst);

export enum LineCap {
butt,
round,
Expand Down Expand Up @@ -101,7 +104,7 @@ export interface GradientColorStop extends WasmTypeBase {
/**
* CSS color string associated with this stop
*/
color: WasmStringPtr;
readonly color: WasmStringPtr;
}

export const $GradientColorStop: WasmTypeConstructor<GradientColorStop> = (mem) => ({
Expand Down Expand Up @@ -130,7 +133,7 @@ export const $GradientColorStop: WasmTypeConstructor<GradientColorStop> = (mem)
mem.f32[base >>> 2] = x;
},
get color(): WasmStringPtr {
return $color || ($color = new WasmStringPtr(mem, (base + 4), true));
return $color || ($color = __str(mem, (base + 4)));
},
};
}
Expand Down
27 changes: 15 additions & 12 deletions packages/wasm-api-dom/src/generated/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by @thi.ng/wasm-api-bindgen at 2024-08-17T15:49:39.193Z
* Generated by @thi.ng/wasm-api-bindgen at 2024-11-09T16:15:11.536Z
* DO NOT EDIT!
*/

Expand All @@ -8,6 +8,9 @@ import { Pointer, WasmStringPtr, type IWasmMemoryAccess, type MemorySlice, type
// @ts-ignore
import { __array, __instanceArray, __slice32, __primslice32 } from "@thi.ng/wasm-api/memory";

// @ts-ignore possibly unused
const __str = (mem: IWasmMemoryAccess, base: number, isConst = true) => new WasmStringPtr(mem, base, isConst);

export enum EventType {
UNKOWN = -1,
DRAG,
Expand Down Expand Up @@ -311,7 +314,7 @@ export const $InputEvent: WasmTypeConstructor<InputEvent> = (mem) => ({
return mem.u8.subarray(base, base + 12);
},
get value(): WasmStringPtr {
return $value || ($value = new WasmStringPtr(mem, base, true));
return $value || ($value = __str(mem, base));
},
get len(): number {
return mem.u32[(base + 4) >>> 2];
Expand Down Expand Up @@ -1198,22 +1201,22 @@ export const $CreateElementOpts: WasmTypeConstructor<CreateElementOpts> = (mem)
return mem.u8.subarray(base, base + 48);
},
get tag(): WasmStringPtr {
return $tag || ($tag = new WasmStringPtr(mem, base, true));
return $tag || ($tag = __str(mem, base));
},
get ns(): WasmStringPtr {
return $ns || ($ns = new WasmStringPtr(mem, (base + 4), true));
return $ns || ($ns = __str(mem, (base + 4)));
},
get id(): WasmStringPtr {
return $id || ($id = new WasmStringPtr(mem, (base + 8), true));
return $id || ($id = __str(mem, (base + 8)));
},
get class(): WasmStringPtr {
return $class || ($class = new WasmStringPtr(mem, (base + 12), true));
return $class || ($class = __str(mem, (base + 12)));
},
get text(): WasmStringPtr {
return $text || ($text = new WasmStringPtr(mem, (base + 16), true));
return $text || ($text = __str(mem, (base + 16)));
},
get html(): WasmStringPtr {
return $html || ($html = new WasmStringPtr(mem, (base + 20), true));
return $html || ($html = __str(mem, (base + 20)));
},
get parent(): number {
return mem.i32[(base + 24) >>> 2];
Expand Down Expand Up @@ -1314,10 +1317,10 @@ export const $CreateCanvasOpts: WasmTypeConstructor<CreateCanvasOpts> = (mem) =>
return mem.u16[(base + 2) >>> 1];
},
get id(): WasmStringPtr {
return $id || ($id = new WasmStringPtr(mem, (base + 4), true));
return $id || ($id = __str(mem, (base + 4)));
},
get class(): WasmStringPtr {
return $class || ($class = new WasmStringPtr(mem, (base + 8), true));
return $class || ($class = __str(mem, (base + 8)));
},
get parent(): number {
return mem.i32[(base + 12) >>> 2];
Expand Down Expand Up @@ -1364,7 +1367,7 @@ export const $Attrib: WasmTypeConstructor<Attrib> = (mem) => ({
return mem.u8.subarray(base, base + 24);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get value(): AttribValue {
return $AttribValue(mem).instance((base + 8));
Expand Down Expand Up @@ -1418,7 +1421,7 @@ export const $AttribValue: WasmTypeConstructor<AttribValue> = (mem) => ({
return mem.f64[base >>> 3];
},
get str(): WasmStringPtr {
return $str || ($str = new WasmStringPtr(mem, base, true));
return $str || ($str = __str(mem, base));
},
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/wasm-api-schedule/src/generated/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Generated by @thi.ng/wasm-api-bindgen at 2024-08-16T09:18:10.788Z
* Generated by @thi.ng/wasm-api-bindgen at 2024-11-09T16:15:11.637Z
* DO NOT EDIT!
*/

// @ts-ignore possibly includes unused imports
import { Pointer, WasmStringPtr, type MemorySlice, type WasmTypeBase, type WasmTypeConstructor } from "@thi.ng/wasm-api";
import { Pointer, WasmStringPtr, type IWasmMemoryAccess, type MemorySlice, type MemoryView, type WasmType, type WasmTypeBase, type WasmTypeConstructor } from "@thi.ng/wasm-api";

export enum ScheduleType {
/**
Expand Down
19 changes: 11 additions & 8 deletions packages/wasm-api-webgl/src/generated/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by @thi.ng/wasm-api-bindgen at 2024-08-17T16:17:33.284Z
* Generated by @thi.ng/wasm-api-bindgen at 2024-11-09T16:15:12.608Z
* DO NOT EDIT!
*/

Expand All @@ -8,6 +8,9 @@ import { Pointer, WasmStringPtr, type IWasmMemoryAccess, type MemorySlice, type
// @ts-ignore
import { __array, __instanceArray, __slice32, __primslice32 } from "@thi.ng/wasm-api/memory";

// @ts-ignore possibly unused
const __str = (mem: IWasmMemoryAccess, base: number, isConst = true) => new WasmStringPtr(mem, base, isConst);

import type { GLType as ModelAttribType } from "@thi.ng/api";
// @ts-ignore possibly includes unused imports
import type { DrawMode, TextureFilter, TextureFormat, TextureRepeat, TextureTarget, TextureType } from "@thi.ng/webgl";
Expand Down Expand Up @@ -144,10 +147,10 @@ export const $ShaderSpec: WasmTypeConstructor<ShaderSpec> = (mem) => ({
return mem.u8.subarray(base, base + 32);
},
get vs(): WasmStringPtr {
return $vs || ($vs = new WasmStringPtr(mem, base, true));
return $vs || ($vs = __str(mem, base));
},
get fs(): WasmStringPtr {
return $fs || ($fs = new WasmStringPtr(mem, (base + 4), true));
return $fs || ($fs = __str(mem, (base + 4)));
},
get attribs(): ShaderAttribSpec[] {
return __slice32(mem, $ShaderAttribSpec, (base + 8));
Expand Down Expand Up @@ -187,7 +190,7 @@ export const $ShaderAttribSpec: WasmTypeConstructor<ShaderAttribSpec> = (mem) =>
return mem.u8.subarray(base, base + 8);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get type(): ShaderAttribType {
return mem.u8[(base + 4)];
Expand Down Expand Up @@ -221,7 +224,7 @@ export const $ShaderVaryingSpec: WasmTypeConstructor<ShaderVaryingSpec> = (mem)
return mem.u8.subarray(base, base + 8);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get type(): ShaderAttribType {
return mem.u8[(base + 4)];
Expand Down Expand Up @@ -256,7 +259,7 @@ export const $ShaderUniformSpec: WasmTypeConstructor<ShaderUniformSpec> = (mem)
return mem.u8.subarray(base, base + 32);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get type(): UniformType {
return mem.u8[(base + 4)];
Expand Down Expand Up @@ -384,7 +387,7 @@ export const $ModelAttribSpec: WasmTypeConstructor<ModelAttribSpec> = (mem) => (
return mem.u8.subarray(base, base + 28);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get data(): ModelAttribData {
return $ModelAttribData(mem).instance((base + 4));
Expand Down Expand Up @@ -548,7 +551,7 @@ export const $ModelUniform: WasmTypeConstructor<ModelUniform> = (mem) => ({
return mem.u8.subarray(base, base + 32);
},
get name(): WasmStringPtr {
return $name || ($name = new WasmStringPtr(mem, base, true));
return $name || ($name = __str(mem, base));
},
get type(): UniformType {
return mem.u8[(base + 4)];
Expand Down

0 comments on commit 9055e0e

Please sign in to comment.