Skip to content

WASM Reference

@molcrafts/molrs ships its TypeScript declarations in the package itself: molrs.d.ts, generated by wasm-bindgen from the Rust doc comments of the molrs-wasm crate. Editors and tsc pick them up from the installed package, so hover documentation and signatures match the version you installed.

To read them from a source checkout, build the package with the same flags as release publishing and open molrs-wasm/pkg/molrs.d.ts:

cd molrs-wasm
wasm-pack build --release --target bundler --scope molcrafts --out-name molrs

The generated pkg/ directory is not committed.

Main exports

Area Exports
Data model Frame, Block (get, view, copy, set, dtype, shape, nrows), Box
SMILES and 3D parseSMILES → SmilesIR (toFrame), generate3D
File formats XYZReader, PDBReader, GROReader, LAMMPSReader, LAMMPSTrajReader, MOL2Reader, SDFReader, CIFReader, POSCARReader, DCDReader, TRRReader, XTCReader, …; writeFrame / writeFrameBytes
Record files (*.mrec) readMrecFrame, readMrecFrameFromZip, mrecSections, TrajectoryReader (fromZip, fromStore)
Neighbors and analysis NeighborList, Neighbors, RDF, MSD, Cluster, and the Wasm* analysis classes
Force fields UFFTypifier, MMFF94Typifier, MMFF94STypifier (typify, toPotentials), Potentials, LBFGS
Schema schemaDocument, schemaJson, keysDocument, schemaColumnDtype, schemaVocabVersion

The package README shows each of these in use, including the column dtype table and the record readers.