3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 13:58:45 +00:00
z3/src/api/js
Olaf Tomalka 7fdcbbaee9
Add high level bindings for js (#6048)
* [Draft] Added unfinished code for high level bindings for js

* * Rewrote structure of js api files
* Added more high level apis

* Minor fixes

* Fixed wasm github action

* Fix JS test

* Removed ContextOptions type

* * Added Ints to JS Api
* Added tests to JS Api

* Added run-time checks for contexts

* Removed default contexts

* Merged Context and createContext so that the api behaves the sames as in other constructors

* Added a test for Solver

* Added Reals

* Added classes for IntVals and RealVals

* Added abillity to specify logic for solver

* Try to make CI tests not fail

* Changed APIs after a round of review

* Fix test

* Added BitVectors

* Made sort into getter

* Added initial JS docs

* Added more coercible types

* Removed done TODOs
2022-06-14 09:55:58 -07:00
..
examples/low-level Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
scripts Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
src Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
.nvmrc Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
.prettierrc.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
jest.config.js Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
package-lock.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
package.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
PUBLISHED_README.md Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
README.md Add WebAssembly/TypeScript bindings (#5762) 2022-01-09 17:16:38 -08:00
tsconfig.build.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
tsconfig.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00
typedoc.json Add high level bindings for js (#6048) 2022-06-14 09:55:58 -07:00

TypeScript Bindings

This directory contains JavaScript code to automatically derive TypeScript bindings for the C API, which are published on npm as z3-solver.

The readme for the bindings themselves is located in PUBLISHED_README.md.

Building

You'll need to have emscripten set up, along with all of its dependencies. The easiest way to do that is with emsdk.

Then run npm i to install dependencies, npm run build-ts to build the TypeScript wrapper, and npm run build-wasm to build the wasm artifact.

Tests

Current tests are very minimal: test-ts-api.ts contains a couple real cases translated very mechanically from this file.