{"_id":"@acheul/ahoi-js","_rev":"2-fa77b0bb1b3752720ad076c29531fed8","name":"@acheul/ahoi-js","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.1":{"name":"@acheul/ahoi-js","version":"0.1.1","keywords":["wasm","rust","reactive","solid","react","vue","svelte","state"],"license":"MIT","_id":"@acheul/ahoi-js@0.1.1","maintainers":[{"name":"acheul","email":"acheul@naver.com"}],"homepage":"https://github.com/acheul/ahoi#readme","bugs":{"url":"https://github.com/acheul/ahoi/issues"},"dist":{"shasum":"657bbe1500cc4bf91a73f5e60a2f611af8f77db7","tarball":"https://registry.npmjs.org/@acheul/ahoi-js/-/ahoi-js-0.1.1.tgz","fileCount":18,"integrity":"sha512-9Jt+s4sSxbee0y0i0iYr4OgMKXYdUwJiziQ9FX2oQDdRda1rP5ABUpx5sAJK54YRHjfWxHXNvTF9yaFa50APFw==","signatures":[{"sig":"MEUCIDR//W0kQyGkEPJrC42SWBMwBeNH0RTfnsmZNr1bF3fLAiEA1CkPXziv8erU8lyajo4S2pYGIfDQwp55Mqd+hcIRAO4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71987},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./vue":{"types":"./dist/vue.d.ts","import":"./dist/vue.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./solid":{"types":"./dist/solid.d.ts","import":"./dist/solid.js"},"./svelte":{"types":"./dist/svelte.d.ts","import":"./dist/svelte.js"}},"gitHead":"6bb9e59d4a87ba3f65d9fce44f532b80c97a4b31","scripts":{"test":"tsc -p tsconfig.tests.json","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"acheul","email":"acheul@naver.com"},"repository":{"url":"git+https://github.com/acheul/ahoi.git","type":"git"},"_npmVersion":"10.9.0","description":"JS bridge for ahoi — reactive state management from Rust to JS","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^3.5.0","react":"^19.0.0","svelte":"^5.0.0","solid-js":"^1.9.0","typescript":"^5.6.0","@types/react":"^19.0.0"},"peerDependencies":{"vue":">=3.4","react":">=18","svelte":">=4","solid-js":">=1.8"},"peerDependenciesMeta":{"vue":{"optional":true},"react":{"optional":true},"svelte":{"optional":true},"solid-js":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ahoi-js_0.1.1_1785758618019_0.18606479329015602","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@acheul/ahoi-js","version":"0.2.0","description":"JS bridge for ahoi — reactive state management from Rust to JS","license":"MIT","repository":{"type":"git","url":"git+https://github.com/acheul/ahoi.git"},"keywords":["wasm","rust","reactive","solid","react","vue","svelte","state"],"type":"module","sideEffects":false,"publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./solid":{"types":"./dist/solid.d.ts","import":"./dist/solid.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./vue":{"types":"./dist/vue.d.ts","import":"./dist/vue.js"},"./svelte":{"types":"./dist/svelte.d.ts","import":"./dist/svelte.js"}},"scripts":{"build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","test:types":"tsc -p tsconfig.tests.json","test:runtime":"node tests/storage.test.mjs","test":"pnpm test:types && pnpm build && pnpm test:runtime","prepublishOnly":"pnpm build"},"peerDependencies":{"react":">=18","solid-js":">=1.8","svelte":">=4","vue":">=3.4"},"peerDependenciesMeta":{"react":{"optional":true},"solid-js":{"optional":true},"svelte":{"optional":true},"vue":{"optional":true}},"devDependencies":{"@types/react":"^19.0.0","react":"^19.0.0","solid-js":"^1.9.0","svelte":"^5.0.0","typescript":"^5.6.0","vue":"^3.5.0"},"gitHead":"c53e51f668a0e2025a8b068474389eb846d69c00","_id":"@acheul/ahoi-js@0.2.0","bugs":{"url":"https://github.com/acheul/ahoi/issues"},"homepage":"https://github.com/acheul/ahoi#readme","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-vzcEGXWfqEeqJgBgoH0bxCgCMLfzOEloJWlGirHBw2dZVOBZ9mGXWBV9Oq8lLZX4KHDRC60G6w8tZg1p+FgHng==","shasum":"3843900901774c5c352c2d8deb44c2274cb916e3","tarball":"https://registry.npmjs.org/@acheul/ahoi-js/-/ahoi-js-0.2.0.tgz","fileCount":18,"unpackedSize":76936,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCRh6oDo7IpmWkNKIY9Q6ysJ7GJFieSqOlnFcePQ2ICPgIhAIYKnv1OoymoJS5vl8mYFPEwnFpCYY096wOJVVNMrxYW"}]},"_npmUser":{"name":"acheul","email":"acheul@naver.com"},"directories":{},"maintainers":[{"name":"acheul","email":"acheul@naver.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ahoi-js_0.2.0_1788421340206_0.2623835971746806"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-03T12:03:37.742Z","modified":"2026-09-03T07:42:20.507Z","0.1.1":"2026-08-03T12:03:38.166Z","0.2.0":"2026-09-03T07:42:20.351Z"},"bugs":{"url":"https://github.com/acheul/ahoi/issues"},"license":"MIT","homepage":"https://github.com/acheul/ahoi#readme","keywords":["wasm","rust","reactive","solid","react","vue","svelte","state"],"repository":{"type":"git","url":"git+https://github.com/acheul/ahoi.git"},"description":"JS bridge for ahoi — reactive state management from Rust to JS","maintainers":[{"name":"acheul","email":"acheul@naver.com"}],"readme":"# @acheul/ahoi-js\n\nJS bridge for [**ahoi**](https://github.com/acheul/ahoi) — a fine-grained\nreactive state engine written in Rust. Rust owns the state and reactivity;\nyour JS framework owns rendering.\n\nThis package is the JS half of the bridge. You also need the\n[`ahoi`](https://crates.io/crates/ahoi) crate on the Rust side.\n\n```sh\nnpm i @acheul/ahoi-js\n```\n\n## Adapters\n\nEach adapter is a subpath of this package, and its framework is an **optional\npeer dependency** — you only install what you use.\n\n| Import                   | Provides                                                           |\n| ------------------------ | ------------------------------------------------------------------ |\n| `@acheul/ahoi-js/solid`  | `PierProvider`, `usePier()` → `.hail` / `.readHail` / `.tell`      |\n| `@acheul/ahoi-js/react`  | `PierProvider`, `useHail`, `useReadHail`, `useTell`                |\n| `@acheul/ahoi-js/vue`    | `PierProvider`, `useHail` (writable ref), `useReadHail`, `useTell` |\n| `@acheul/ahoi-js/svelte` | `providePier`, `useHail` (store), `useReadHail`, `useTell`         |\n| `@acheul/ahoi-js`        | `AhoiStorage` — the framework-agnostic core, for anything else     |\n\nUsing **Preact**? Use `@acheul/ahoi-js/react` and alias `react`/`react-dom` to\n`preact/compat`, as with any React library.\n\n## Usage\n\nWire the wasm exports once:\n\n```ts\n// bridge.ts\nimport wasmInit, {\n  abi_version,\n  clear,\n  hail,\n  pier,\n  tell,\n  write,\n} from \"../pkg/my_app\";\nimport { createAhoi } from \"@acheul/ahoi-js/solid\";\nimport type { Pier } from \"./bindings/Pier\";\nimport type { Hail } from \"./bindings/Hail\";\nimport type { Tell } from \"./bindings/Tell\";\nimport type { HailRets, TellRets } from \"./bindings/Rets\";\n\nawait wasmInit();\n\nexport const { PierProvider, usePier } = createAhoi<\n  Pier,\n  Hail,\n  Tell,\n  HailRets,\n  TellRets\n>({\n  _enrol_pier: pier,\n  _enrol_hail: (p, k) => hail(p, k) as [number, any],\n  _clear_sphere: clear,\n  _write_hail: write,\n  _tell: tell,\n  _abi_version: abi_version,\n});\n```\n\nThen use it (SolidJS shown):\n\n```tsx\nconst pier = usePier();\nconst [count, setCount] = pier.hail(\"Count\"); // () => number\nconst doubled = pier.readHail(\"Doubled\"); // () => number\npier.tell(\"Increase\"); // number\n```\n\nKeys are plain wire values (`\"Count\"`, `{ Item: 3 }`) — no constructors. Their\nreturn types come from the `Rets` maps that `#[derive(Rets)]` generates on the\nRust side, so results are typed without ahoi having to be a TypeScript\nconverter: export your key and data types with whatever you prefer (ts-rs,\nTsify, …).\n\n## Versioning\n\nThe crate and this package agree on an `ABI_VERSION`, checked when the bridge\nstarts. Keep the `ahoi` crate and `@acheul/ahoi-js` versions aligned; a mismatch fails\nimmediately with a clear message.\n\n## Docs\n\nFull documentation, the Rust-side quickstart, and runnable playgrounds for all\nfour frameworks live in the [main repository](https://github.com/acheul/ahoi).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}