@thi.ng/wasm-api-dom
Advanced tools
Comparing version 0.11.1 to 0.11.2
14
api.d.ts
import type { WasmExports } from "@thi.ng/wasm-api"; | ||
export * from "./generated/api.js"; | ||
export interface DOMExports extends WasmExports { | ||
export interface WasmDomExports extends WasmExports { | ||
_dom_init(): void; | ||
@@ -11,3 +11,3 @@ _dom_callListener(listenerID: number, event: number): void; | ||
} | ||
export interface DOMImports extends WebAssembly.ModuleImports { | ||
export interface WasmDomImports extends WebAssembly.ModuleImports { | ||
/** | ||
@@ -37,3 +37,3 @@ * Queries the browser's current `window` object and writes results to given | ||
* (or implicitly via ancestors) removed via | ||
* {@link DOMImports.removeElement}. | ||
* {@link WasmDomImports.removeElement}. | ||
* | ||
@@ -49,5 +49,5 @@ * @param optsAddr | ||
* WASM-side event listeners (i.e. those registered via | ||
* {@link DOMImports._addListener}) attached to the element or anywhere in | ||
* {@link WasmDomImports._addListener}) attached to the element or anywhere in | ||
* its sub-tree. These must be manually removed via | ||
* {@link DOMImports._removeListener} prior to calling this function. | ||
* {@link WasmDomImports._removeListener} prior to calling this function. | ||
* | ||
@@ -60,3 +60,3 @@ * @param elementID | ||
* according to the given opts. Returns unique ID handle for new element, | ||
* see {@link DOMImports.createElement} for details. | ||
* see {@link WasmDomImports.createElement} for details. | ||
* | ||
@@ -115,3 +115,3 @@ * @param optsAddr | ||
/** | ||
* Similar to {@link DOMImports._getStringAttrib}, reads a string attribute | ||
* Similar to {@link WasmDomImports._getStringAttrib}, reads a string attribute | ||
* value from DOM element and allocates memory for it. Writes | ||
@@ -118,0 +118,0 @@ * `[pointer,length]` tuple to `sliceAddr` (using the global allocator |
# Change Log | ||
- **Last updated**: 2022-11-28T13:36:49Z | ||
- **Last updated**: 2022-11-30T22:27:37Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,11 @@ | ||
### [0.11.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-dom@0.11.2) (2022-11-30) | ||
#### ♻️ Refactoring | ||
- rename types/imports ([#368](https://github.com/thi-ng/umbrella/issues/368)) ([650f59c](https://github.com/thi-ng/umbrella/commit/650f59c)) | ||
- rename exports/imports interfaces => WasmDomExports/Imports | ||
- update/rename zig imports | ||
- update readme | ||
## [0.11.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-dom@0.11.0) (2022-11-24) | ||
@@ -14,0 +23,0 @@ |
10
dom.d.ts
import type { NumOrString } from "@thi.ng/api"; | ||
import { IWasmAPI, ReadonlyWasmString, WasmBridge, WasmType } from "@thi.ng/wasm-api"; | ||
import { ObjectIndex } from "@thi.ng/wasm-api/object-index"; | ||
import { CreateElementOpts, DOMExports, DOMImports, Event as WasmEvent } from "./api.js"; | ||
import { CreateElementOpts, Event as WasmEvent, WasmDomExports, WasmDomImports } from "./api.js"; | ||
/** @internal */ | ||
@@ -12,5 +12,5 @@ interface WasmListener { | ||
} | ||
export declare class WasmDom implements IWasmAPI<DOMExports> { | ||
export declare class WasmDom implements IWasmAPI<WasmDomExports> { | ||
static readonly id = "dom"; | ||
parent: WasmBridge<DOMExports>; | ||
parent: WasmBridge<WasmDomExports>; | ||
$Event: WasmType<WasmEvent>; | ||
@@ -23,4 +23,4 @@ $CreateElementOpts: WasmType<CreateElementOpts>; | ||
get id(): string; | ||
init(parent: WasmBridge<DOMExports>): Promise<boolean>; | ||
getImports(): DOMImports; | ||
init(parent: WasmBridge<WasmDomExports>): Promise<boolean>; | ||
getImports(): WasmDomImports; | ||
protected initElement(elementID: number, el: Element, opts: Pick<Readonly<CreateElementOpts>, "attribs" | "class" | "id" | "index" | "parent"> & Partial<{ | ||
@@ -27,0 +27,0 @@ html: ReadonlyWasmString; |
/** | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-24T11:00:00.761Z | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-30T15:23:27.747Z | ||
* DO NOT EDIT! | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-24T11:00:00.761Z | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-30T15:23:27.747Z | ||
* DO NOT EDIT! | ||
@@ -4,0 +4,0 @@ */ |
{ | ||
"name": "@thi.ng/wasm-api-dom", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Browser DOM bridge API for hybrid TypeScript & WASM (Zig) applications", | ||
@@ -38,12 +38,12 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/adapt-dpi": "^2.2.2", | ||
"@thi.ng/api": "^8.5.0", | ||
"@thi.ng/errors": "^2.2.4", | ||
"@thi.ng/prefixes": "^2.1.13", | ||
"@thi.ng/wasm-api": "^1.1.0", | ||
"@thi.ng/wasm-api-bindgen": "^0.2.1" | ||
"@thi.ng/adapt-dpi": "^2.2.3", | ||
"@thi.ng/api": "^8.5.1", | ||
"@thi.ng/errors": "^2.2.5", | ||
"@thi.ng/prefixes": "^2.1.14", | ||
"@thi.ng/wasm-api": "^1.1.1", | ||
"@thi.ng/wasm-api-bindgen": "^0.2.2" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.33.5", | ||
"@thi.ng/testament": "^0.3.5", | ||
"@thi.ng/testament": "^0.3.6", | ||
"rimraf": "^3.0.2", | ||
@@ -100,3 +100,3 @@ "tools": "^0.0.1", | ||
}, | ||
"gitHead": "75ec32ff7f1b7b5e72e7a04ace24732cd5d6c774\n" | ||
"gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n" | ||
} |
@@ -65,4 +65,4 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
const std = @import("std"); | ||
const wasm = @import("wasmapi"); | ||
const dom = @import("dom"); | ||
const wasm = @import("wasm-api"); | ||
const dom = @import("wasm-api-dom"); | ||
@@ -123,3 +123,3 @@ // expose thi.ng/wasm-api core API (incl. panic handler & allocation fns) | ||
```zig | ||
const dom = @import("dom"); | ||
const dom = @import("wasm-api-dom"); | ||
@@ -216,4 +216,4 @@ const Attrib = dom.Attrib; | ||
```zig | ||
const wasm = @import("wasmapi"); | ||
const dom = @import("dom"); | ||
const wasm = @import("wasm-api"); | ||
const dom = @import("wasm-api-dom"); | ||
@@ -294,3 +294,3 @@ /// Simple click counter component | ||
Package sizes (gzipped, pre-treeshake): ESM: 4.63 KB | ||
Package sizes (brotli'd, pre-treeshake): ESM: 4.10 KB | ||
@@ -317,2 +317,3 @@ ## Dependencies | ||
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-canvas.png" width="240"/> | Zig-based DOM creation & canvas drawing app | [Demo](https://demo.thi.ng/umbrella/zig-canvas/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-canvas) | | ||
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-cellular.jpg" width="240"/> | Zig-based 2D multi-behavior cellular automata | [Demo](https://demo.thi.ng/umbrella/zig-cellular/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-cellular) | | ||
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-counter.png" width="240"/> | Simple Zig/WASM click counter DOM component | [Demo](https://demo.thi.ng/umbrella/zig-counter/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-counter) | | ||
@@ -319,0 +320,0 @@ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-todo-list.png" width="240"/> | Zig-based To-Do list, DOM creation, local storage task persistence | [Demo](https://demo.thi.ng/umbrella/zig-todo-list/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-todo-list) | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120447
353
Updated@thi.ng/adapt-dpi@^2.2.3
Updated@thi.ng/api@^8.5.1
Updated@thi.ng/errors@^2.2.5
Updated@thi.ng/prefixes@^2.1.14
Updated@thi.ng/wasm-api@^1.1.1