@kent-tokyo/chematic 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1321,6 +1321,25 @@ export function maxmin_picks_ecfp4_json(smiles_json: string, n: number): string;
1321
1321
  */
1322
1322
  export function mcs_smiles_json(smiles_json: string): string;
1323
1323
 
1324
+ /**
1325
+ * Full `McsConfig` + `McsOutcome`-aware MCS search.
1326
+ *
1327
+ * `smiles_json` — JSON array of at least 2 SMILES strings.
1328
+ * `config_json` — a JSON object with any subset of `McsConfig`'s fields
1329
+ * (camelCase keys, all optional, defaulting to `McsConfig::default()`):
1330
+ * `matchBonds`, `minAtoms`, `timeoutMs`, `ringMatchesRingOnly`,
1331
+ * `completeRingsOnly`, `atomCompare` (`"elements"` | `"any_heavy_atom"` |
1332
+ * `"any"`), `bondCompare` (`"order_or_aromatic"` | `"any"`),
1333
+ * `matchChiralTag`, `matchCharge`, `matchIsotope`, `maximizeBonds`.
1334
+ *
1335
+ * Returns a JSON object `{"smiles": string|null, "wasTimedOut": bool}` --
1336
+ * `smiles` is `null` when there is no common substructure; `wasTimedOut` is
1337
+ * `true` if `timeoutMs` was reached before the search finished exhaustively
1338
+ * (the returned `smiles`, if any, is then the best result found so far, not
1339
+ * proven optimal).
1340
+ */
1341
+ export function mcs_smiles_json_with_config(smiles_json: string, config_json: string): string;
1342
+
1324
1343
  /**
1325
1344
  * MCS with ring-awareness constraints.
1326
1345
  *
@@ -2627,6 +2646,7 @@ export interface InitOutput {
2627
2646
  readonly match_smarts_smiles: (a: number, b: number, c: number, d: number) => [number, number, number, number];
2628
2647
  readonly maxmin_picks_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
2629
2648
  readonly mcs_smiles_json: (a: number, b: number) => [number, number, number, number];
2649
+ readonly mcs_smiles_json_with_config: (a: number, b: number, c: number, d: number) => [number, number, number, number];
2630
2650
  readonly mcs_smiles_json_with_ring_config: (a: number, b: number, c: number, d: number) => [number, number, number, number];
2631
2651
  readonly mhfp_hashes_json: (a: number) => [number, number];
2632
2652
  readonly mhfplshhandle_add_smiles: (a: number, b: number, c: number) => [number, number, number];
package/chematic_wasm.js CHANGED
@@ -3179,6 +3179,49 @@ export function mcs_smiles_json(smiles_json) {
3179
3179
  }
3180
3180
  }
3181
3181
 
3182
+ /**
3183
+ * Full `McsConfig` + `McsOutcome`-aware MCS search.
3184
+ *
3185
+ * `smiles_json` — JSON array of at least 2 SMILES strings.
3186
+ * `config_json` — a JSON object with any subset of `McsConfig`'s fields
3187
+ * (camelCase keys, all optional, defaulting to `McsConfig::default()`):
3188
+ * `matchBonds`, `minAtoms`, `timeoutMs`, `ringMatchesRingOnly`,
3189
+ * `completeRingsOnly`, `atomCompare` (`"elements"` | `"any_heavy_atom"` |
3190
+ * `"any"`), `bondCompare` (`"order_or_aromatic"` | `"any"`),
3191
+ * `matchChiralTag`, `matchCharge`, `matchIsotope`, `maximizeBonds`.
3192
+ *
3193
+ * Returns a JSON object `{"smiles": string|null, "wasTimedOut": bool}` --
3194
+ * `smiles` is `null` when there is no common substructure; `wasTimedOut` is
3195
+ * `true` if `timeoutMs` was reached before the search finished exhaustively
3196
+ * (the returned `smiles`, if any, is then the best result found so far, not
3197
+ * proven optimal).
3198
+ * @param {string} smiles_json
3199
+ * @param {string} config_json
3200
+ * @returns {string}
3201
+ */
3202
+ export function mcs_smiles_json_with_config(smiles_json, config_json) {
3203
+ let deferred4_0;
3204
+ let deferred4_1;
3205
+ try {
3206
+ const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3207
+ const len0 = WASM_VECTOR_LEN;
3208
+ const ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3209
+ const len1 = WASM_VECTOR_LEN;
3210
+ const ret = wasm.mcs_smiles_json_with_config(ptr0, len0, ptr1, len1);
3211
+ var ptr3 = ret[0];
3212
+ var len3 = ret[1];
3213
+ if (ret[3]) {
3214
+ ptr3 = 0; len3 = 0;
3215
+ throw takeFromExternrefTable0(ret[2]);
3216
+ }
3217
+ deferred4_0 = ptr3;
3218
+ deferred4_1 = len3;
3219
+ return getStringFromWasm0(ptr3, len3);
3220
+ } finally {
3221
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3222
+ }
3223
+ }
3224
+
3182
3225
  /**
3183
3226
  * MCS with ring-awareness constraints.
3184
3227
  *
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "kent-tokyo <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
8
- "version": "0.22.0",
8
+ "version": "0.23.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",