package me.eater.threedom.dom.event

import me.eater.threedom.dom.INode
import me.eater.threedom.kapt.EventName

@EventName("DOMTreeUpdate")
sealed class DOMTreeUpdate {
    abstract val child: INode<*>

    @EventName("DOMNodeRemove")
    data class Remove(val parent: INode<*>, override val child: INode<*>) : DOMTreeUpdate()

    @EventName("DOMNodeInsert")
    data class Insert(val parent: INode<*>, override val child: INode<*>) : DOMTreeUpdate()

    @EventName("DOMNodeMove")
    data class Move(val oldParent: INode<*>, val newParent: INode<*>, override val child: INode<*>) : DOMTreeUpdate()
}
