mirror of
https://github.com/Z3Prover/z3
synced 2026-05-26 11:56:21 +00:00
docs: clarify deno wasm locateFile usage
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/3070f139-a412-4e40-8446-bd569f9ffa55 Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
a30faacba1
commit
bee19eb461
2 changed files with 5 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ const {
|
|||
|
||||
This package has different initialization for browser and node. Your bundler and node should choose good version automatically, but you can import the one you need manually - `const { init } = require('z3-solver/node');` or `const { init } = require('z3-solver/browser');`.
|
||||
|
||||
The `init` function also accepts an optional Emscripten module overrides object. This is useful in runtimes such as Deno where you may want to provide a wasm load path explicitly instead of relying on filesystem reads. For example:
|
||||
The `init` function also accepts an optional Emscripten module overrides object. This is useful in runtimes such as Deno where you may want to provide a wasm load path explicitly instead of relying on filesystem reads. In Deno 2.1+, `import.meta.resolve(...)` returns a string synchronously, so it can be used directly in `locateFile`. For example:
|
||||
|
||||
```typescript
|
||||
import { init } from 'npm:z3-solver';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
export * from './types.__GENERATED__';
|
||||
export * from './wrapper.__GENERATED__';
|
||||
export type Z3ModuleOverrides = Record<string, unknown>;
|
||||
export type Z3ModuleOverrides = {
|
||||
locateFile?: (path: string, prefix: string) => string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
export type Z3Core = Awaited<ReturnType<(typeof import('./wrapper.__GENERATED__'))['init']>>['Z3'];
|
||||
export type Z3LowLevel = Awaited<ReturnType<(typeof import('./wrapper.__GENERATED__'))['init']>>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue