This issue tracks adding AttachableAsImage support on Wasm via JavaScript bridging.
Standardized JavaScript has several classes (types? prototypes? whatever the JS terminology is) that represent images that can be serialized. For example, HTMLCanvasElement has a toBlob() function that converts the contents of the canvas to PNG, JPEG, etc.
We would need to be able to link to JavaScriptKit in some fashion and would need to see how HTMLCanvasElement is represented on the Swift side before we could add protocol conformances: it's possible we would need to add blanket conformance for JSObject via isInstanceOf(_:).
This issue tracks adding
AttachableAsImagesupport on Wasm via JavaScript bridging.Standardized JavaScript has several classes (types? prototypes? whatever the JS terminology is) that represent images that can be serialized. For example,
HTMLCanvasElementhas atoBlob()function that converts the contents of the canvas to PNG, JPEG, etc.We would need to be able to link to JavaScriptKit in some fashion and would need to see how
HTMLCanvasElementis represented on the Swift side before we could add protocol conformances: it's possible we would need to add blanket conformance forJSObjectviaisInstanceOf(_:).