// Generated by scripts/generate.mjs from bindings/api.mjs. Do not edit.

///|
#external
pub type OBJMTLExporter

///|
#module("@mizchi/three-mbt/obj-mtl")
pub extern "js" fn OBJMTLExporter::OBJMTLExporter() -> OBJMTLExporter = "oBJMTLExporter"

///|
extern "js" fn OBJMTLExporter::ffi_export_bundle(
  self : OBJMTLExporter,
  root : Object3D,
  mtl_file : String,
  textures : TexturePaths,
) -> JsResult[OBJMTL] =
  #| (self, root, mtl_file, textures) => { try { return { ok: true, value: (() => self.export(root, mtl_file, textures))() }; } catch (error) { return { ok: false, error: String(error) }; } }

///|
pub fn OBJMTLExporter::export_bundle(
  self : OBJMTLExporter,
  root : Object3D,
  mtl_file : String,
  textures : TexturePaths,
) -> OBJMTL raise ExportError {
  match self.ffi_export_bundle(root, mtl_file, textures).into_result() {
    Ok(value) => value
    Err(message) => raise ExportError(message)
  }
}