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>;