From bee19eb461d74e58599d8aa7ae24ea381ba7ce2a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 25 May 2026 16:47:45 +0000 Subject: [PATCH] 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> --- src/api/js/PUBLISHED_README.md | 2 +- src/api/js/src/low-level/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/js/PUBLISHED_README.md b/src/api/js/PUBLISHED_README.md index c096bbe41..3ceb9122c 100644 --- a/src/api/js/PUBLISHED_README.md +++ b/src/api/js/PUBLISHED_README.md @@ -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'; diff --git a/src/api/js/src/low-level/index.ts b/src/api/js/src/low-level/index.ts index 25330c494..f4924eee5 100644 --- a/src/api/js/src/low-level/index.ts +++ b/src/api/js/src/low-level/index.ts @@ -1,5 +1,8 @@ export * from './types.__GENERATED__'; export * from './wrapper.__GENERATED__'; -export type Z3ModuleOverrides = Record; +export type Z3ModuleOverrides = { + locateFile?: (path: string, prefix: string) => string; + [key: string]: unknown; +}; export type Z3Core = Awaited>['Z3']; export type Z3LowLevel = Awaited>;