@kent-tokyo/chematic 0.43.0 → 0.45.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.
@@ -667,6 +667,17 @@ export function compare_molecules_json(smiles1: string, smiles2: string): string
667
667
  */
668
668
  export function conformer_ensemble_json(mol: MolHandle, n: number, rmsd_threshold: number): string;
669
669
 
670
+ /**
671
+ * Convert between common topology-bearing molecular formats.
672
+ *
673
+ * This is the WASM counterpart of Python's `convert_format`. It supports
674
+ * SMILES, MOL/SDF, MOL V3000, MOL2, CML, ChemicalJSON, MolJSON, and CDXML.
675
+ * Coordinates and format-specific metadata are intentionally not carried
676
+ * across this topology-only bridge; use the format-specific coordinate APIs
677
+ * when those fields must be preserved.
678
+ */
679
+ export function convert_common_format(text: string, input_format: string, output_format: string): string;
680
+
670
681
  /**
671
682
  * Return the CPK color (CSS hex string) for the given element symbol.
672
683
  *
@@ -2618,6 +2629,7 @@ export interface InitOutput {
2618
2629
  readonly conformerhandle_mol: (a: number) => number;
2619
2630
  readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
2620
2631
  readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
2632
+ readonly convert_common_format: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
2621
2633
  readonly cpk_color: (a: number, b: number) => [number, number];
2622
2634
  readonly cube_grid_json: (a: number, b: number) => [number, number, number, number];
2623
2635
  readonly cube_shape_u32: (a: number, b: number) => [number, number, number];
package/chematic_wasm.js CHANGED
@@ -1604,6 +1604,44 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
1604
1604
  }
1605
1605
  }
1606
1606
 
1607
+ /**
1608
+ * Convert between common topology-bearing molecular formats.
1609
+ *
1610
+ * This is the WASM counterpart of Python's `convert_format`. It supports
1611
+ * SMILES, MOL/SDF, MOL V3000, MOL2, CML, ChemicalJSON, MolJSON, and CDXML.
1612
+ * Coordinates and format-specific metadata are intentionally not carried
1613
+ * across this topology-only bridge; use the format-specific coordinate APIs
1614
+ * when those fields must be preserved.
1615
+ * @param {string} text
1616
+ * @param {string} input_format
1617
+ * @param {string} output_format
1618
+ * @returns {string}
1619
+ */
1620
+ export function convert_common_format(text, input_format, output_format) {
1621
+ let deferred5_0;
1622
+ let deferred5_1;
1623
+ try {
1624
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1625
+ const len0 = WASM_VECTOR_LEN;
1626
+ const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1627
+ const len1 = WASM_VECTOR_LEN;
1628
+ const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1629
+ const len2 = WASM_VECTOR_LEN;
1630
+ const ret = wasm.convert_common_format(ptr0, len0, ptr1, len1, ptr2, len2);
1631
+ var ptr4 = ret[0];
1632
+ var len4 = ret[1];
1633
+ if (ret[3]) {
1634
+ ptr4 = 0; len4 = 0;
1635
+ throw takeFromExternrefTable0(ret[2]);
1636
+ }
1637
+ deferred5_0 = ptr4;
1638
+ deferred5_1 = len4;
1639
+ return getStringFromWasm0(ptr4, len4);
1640
+ } finally {
1641
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1642
+ }
1643
+ }
1644
+
1607
1645
  /**
1608
1646
  * Return the CPK color (CSS hex string) for the given element symbol.
1609
1647
  *
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.43.0",
8
+ "version": "0.45.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",