[Refactor] Clean up image nodes, add TS types (#1927)

* [Refactor] Clean up image nodes, add TS types

Should be no functional changes.

* Remove unused code
This commit is contained in:
filtered
2024-12-18 08:09:24 +11:00
committed by GitHub
parent 2b4ac582d4
commit cb3e4b5ed7
5 changed files with 342 additions and 317 deletions

View File

@@ -84,11 +84,9 @@ app.registerExtension({
const img = new Image()
img.onload = () => {
// @ts-expect-error adding extra property
node.imgs = [img]
app.graph.setDirtyCanvas(true)
requestAnimationFrame(() => {
// @ts-expect-error accessing extra property
node.setSizeForImage?.()
})
}
@@ -109,7 +107,6 @@ app.registerExtension({
camera.serializeValue = async () => {
if (captureOnQueue.value) {
capture()
// @ts-expect-error accessing extra property
} else if (!node.imgs?.length) {
const err = `No webcam image captured`
useToastStore().addAlert(err)