/* tslint:disable */ /* eslint-disable */ /** * Audit a pasted/uploaded route export (WASM entry point) -- the browser * counterpart to `renkin audit-route`, calling the identical * `bridge::build_audit_route_report` pipeline so a route audited in the * playground gets exactly the same pass/fail/partial verdict the CLI would * produce for the same input, not a separately-maintained copy. * * # Arguments * * `content` - Route export JSON text (RENKIN `--format json` output, * or an AiZynthFinder single-route/batch export). Plain * JSON only -- unlike the CLI, this has no gzip support; * a browser paste/upload never needs it. * * `format` - `"auto" | "renkin" | "aizynthfinder"`, same vocabulary * as the CLI's `--format` flag. * * `stock_text` - Optional `.smi`-style stock listing (one SMILES per * line, `#`-comments allowed), or `""` for "no stock to * check against". * * Returns a JSON string: either the `AuditRouteReport` shape (same as * `renkin audit-route --output json`) or `{"error": "..."}` on a bad * input (malformed JSON, unrecognized format, ...). */ export function audit_route(content: string, format: string, stock_text: string): string; /** * Same as [`audit_route`], plus `policy` (v0.29.0 Audit Policy Profiles): * `"informational" | "standard" | "strict"`, same vocabulary as the CLI's * `--policy` flag -- controls only how each route's `status` is derived * from findings already collected, never which findings are detected or * reported. A distinct function name rather than a 4th parameter on * `audit_route`, so a caller on a pre-v0.29.0 build gets a real "no such * export" `TypeError` instead of a silently-ignored argument -- the same * reasoning `find_routes_v2` already established in this codebase. * `audit_route` itself is now a thin `"standard"` wrapper around this. */ export function audit_route_v2(content: string, format: string, stock_text: string, policy: string): string; /** * Static capabilities of this WASM build (browser edition), as a JSON * string -- real counts read from the same compiled-in data `find_routes` * itself searches against, not a hardcoded UI string that can drift from * what the engine actually has loaded. */ export function capabilities(): string; /** * Find retrosynthetic routes for a target molecule (WASM entry point). * * Returns a JSON string with the retrosynthesis result. * * # Arguments * * `target` - Target molecule SMILES * * `depth` - Maximum retrosynthesis depth * * `max_routes` - Maximum number of routes * * `beam_width` - Beam search width; 0 = unlimited A* * * # Example (JavaScript) * ```js * import init, { find_routes } from '@renkin/wasm'; * await init(); * const result = JSON.parse(find_routes("CC(=O)Oc1ccccc1C(=O)O", 3, 5, 0)); * console.log(result.routes_found); * ``` */ export function find_routes(target: string, depth: number, max_routes: number, beam_width: number): string; /** * Find retrosynthetic routes with element filtering (WASM entry point). * * Same as [`find_routes`] plus `avoid_elements`/`require_elements`: comma- * separated element symbols, identical format and conversion * (`chem_env::elem_symbols_to_mask`) as the CLI's own `--avoid-elements`/ * `--require-elements` flags, so browser filtering behaves exactly like * the CLI's, not a separately-maintained copy. A distinct function name * rather than optional/extra parameters on `find_routes`, so a caller on * an old build gets a real "no such export" `TypeError` instead of a * silently-ignored argument -- this playground's own JS previously relied * on `try { 6-arg call } catch { 4-arg call }` to bridge this gap, which * meant `avoid_elements`/`require_elements` silently never took effect * against any WASM build that predates this function. */ export function find_routes_v2(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string): string; /** * Same as [`find_routes_v2`], plus `spectator_bond_policy` * (`docs/design/spectator-bond-fail-closed-gating-v0.md`): `"off"` * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the * CLI's `--spectator-bond-policy` flag and the Python binding's * `spectator_bond_policy` kwarg. `"gated"` can change which candidates * (and therefore which `routes`) come back -- v1 scope only: rules with * no `#` in their SMIRKS, others stay diagnostics-only regardless of this * setting. A distinct function name rather than a 5th parameter on * `find_routes_v2`, matching that function's own stated reasoning (a * caller on an older build gets a real "no such export" `TypeError` * instead of a silently-ignored argument). Findings/gated-out records * themselves aren't surfaced in this output yet -- WASM has no * `search_diagnostics`-equivalent block at all today, for any * `CrowdOutDiagnostics` field, not just this one; only the policy control * itself (and its effect on `routes`) is in scope here. */ export function find_routes_v3(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string): string; /** * Same as [`find_routes_v3`], plus `beam_diversity_policy`/ * `beam_diversity_slots` (`docs/design/diversity-reserved-beam-v0.md`): * `"off"` (default) | `"diagnostics_only"` | `"active"`, same vocabulary * as the CLI's `--beam-diversity-policy` flag and the Python binding's * `beam_diversity_policy` kwarg. `"active"` can change which candidates * (and therefore which `routes`) come back, same caveat as * `spectator_bond_policy`'s own `"gated"`. A distinct function name * rather than extending `find_routes_v3`'s signature, matching that * function's own stated reasoning. `beam_diversity_stats` isn't surfaced * in this output either, for the same reason `spectator_bond`'s findings * aren't -- WASM has no `search_diagnostics`-equivalent block at all * today, for any `CrowdOutDiagnostics` field; only the policy control * itself (and its effect on `routes`) is in scope here. */ export function find_routes_v4(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string; /** * Same as [`find_routes_v4`], plus `element_accounting_policy` * (`docs/design/candidate-time-element-accounting-gate-v0.md`): `"off"` * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the * CLI's `--element-accounting-policy` flag and the Python binding's * `element_accounting_policy` kwarg -- an independent axis from * `spectator_bond_policy`, never folded together. `"gated"` can change * which candidates (and therefore which `routes`) come back, same caveat * as `spectator_bond_policy`'s own `"gated"`. A distinct function name * rather than extending `find_routes_v4`'s signature, matching that * function's own stated reasoning. `element_accounting_gated_out` isn't * surfaced in this output either, for the same reason `spectator_bond`'s * findings aren't -- WASM has no `search_diagnostics`-equivalent block at * all today, for any `CrowdOutDiagnostics` field; only the policy control * itself (and its effect on `routes`) is in scope here. */ export function find_routes_v5(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, element_accounting_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string; /** * Same as [`find_routes_v5`], plus bounded candidate-level diagnostics. * `candidate_trace_limit` is an explicit collection cap; `0` collects no * records while still returning the aggregate `search_diagnostics` block. * The diagnostics are read-only and do not affect route selection. A new * export preserves the fail-loud compatibility behavior of the earlier * versioned WASM functions. */ export function find_routes_v6(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, element_accounting_policy: string, beam_diversity_policy: string, beam_diversity_slots: number, candidate_trace_limit: number): string; /** * Return the crate version string. */ export function version(): string; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly audit_route: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number]; readonly audit_route_v2: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number]; readonly capabilities: () => [number, number]; readonly find_routes: (a: number, b: number, c: number, d: number, e: number) => [number, number]; readonly find_routes_v2: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number]; readonly find_routes_v3: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number]; readonly find_routes_v4: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => [number, number]; readonly find_routes_v5: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => [number, number]; readonly find_routes_v6: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => [number, number]; readonly version: () => [number, number]; readonly __wbindgen_externrefs: WebAssembly.Table; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_free: (a: number, b: number, c: number) => void; readonly __wbindgen_start: () => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;