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

///|
#external
pub type WebGLTextureUtils

///|
#module("@mizchi/three-mbt/asset-extra")
pub extern "js" fn WebGLTextureUtils::WebGLTextureUtils() -> WebGLTextureUtils = "webGLTextureUtils"

///|
extern "js" fn WebGLTextureUtils::ffi_decompress(
  self : WebGLTextureUtils,
  texture : Texture,
  max_size : Int,
) -> JsResult[Texture] =
  #| (self, texture, max_size) => { try { return { ok: true, value: (() => self.decompress(texture, max_size))() }; } catch (error) { return { ok: false, error: String(error) }; } }

///|
pub fn WebGLTextureUtils::decompress(
  self : WebGLTextureUtils,
  texture : Texture,
  max_size : Int,
) -> Texture raise ExportError {
  match self.ffi_decompress(texture, max_size).into_result() {
    Ok(value) => value
    Err(message) => raise ExportError(message)
  }
}