"""
This file is generated by generator/run.py based on the Chrome DevTools Protocol.

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object
that has an `id`. This `id` can be used to get additional information on the Node, resolve it into
the JavaScript object wrapper, etc. It is important that client receives DOM events only for the
nodes that are known to the client. Backend keeps track of the nodes that were sent to the client
and never sends the same node twice. It is client's responsibility to collect information about
the nodes that were sent to the client. Note that `iframe` owner elements will return
corresponding document elements as their child nodes.
https://chromedevtools.github.io/devtools-protocol/tot/DOM/

***************************************************
                    Events
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    DOM,
)
from cdpkit.protocol.base import CDPEvent


class AttributeModified(CDPEvent):
    """ Fired when `Element`'s attribute is modified. """

    nodeId: DOM.NodeId  # deprecated
    name: str  # deprecated
    value: str  # deprecated


class AttributeRemoved(CDPEvent):
    """ Fired when `Element`'s attribute is removed. """

    nodeId: DOM.NodeId  # deprecated
    name: str  # deprecated


class CharacterDataModified(CDPEvent):
    """ Mirrors `DOMCharacterDataModified` event. """

    nodeId: DOM.NodeId  # deprecated
    characterData: str  # deprecated


class ChildNodeCountUpdated(CDPEvent):
    """ Fired when `Container`'s child node count has changed. """

    nodeId: DOM.NodeId  # deprecated
    childNodeCount: int  # deprecated


class ChildNodeInserted(CDPEvent):
    """ Mirrors `DOMNodeInserted` event. """

    parentNodeId: DOM.NodeId  # deprecated
    previousNodeId: DOM.NodeId  # deprecated
    node: DOM.Node  # deprecated


class ChildNodeRemoved(CDPEvent):
    """ Mirrors `DOMNodeRemoved` event. """

    parentNodeId: DOM.NodeId  # deprecated
    nodeId: DOM.NodeId  # deprecated


class DistributedNodesUpdated(CDPEvent):
    """ Called when distribution is changed. """

    insertionPointId: DOM.NodeId  # deprecated
    distributedNodes: list[DOM.BackendNode]  # deprecated


class DocumentUpdated(CDPEvent):
    """ Fired when `Document` has been totally updated. Node ids are no longer valid. """

    ...


class InlineStyleInvalidated(CDPEvent):
    """ Fired when `Element`'s inline style is modified via a CSS property modification. """

    nodeIds: list[DOM.NodeId]  # deprecated


class PseudoElementAdded(CDPEvent):
    """ Called when a pseudo element is added to an element. """

    parentId: DOM.NodeId  # deprecated
    pseudoElement: DOM.Node  # deprecated


class TopLayerElementsUpdated(CDPEvent):
    """ Called when top layer elements are changed. """

    ...


class ScrollableFlagUpdated(CDPEvent):
    """ Fired when a node's scrollability state changes. """

    nodeId: DOM.NodeId  # deprecated
    isScrollable: bool  # deprecated


class PseudoElementRemoved(CDPEvent):
    """ Called when a pseudo element is removed from an element. """

    parentId: DOM.NodeId  # deprecated
    pseudoElementId: DOM.NodeId  # deprecated


class SetChildNodes(CDPEvent):
    """ Fired when backend wants to provide client with the missing DOM structure. This happens upon
    most of the calls requesting node ids. """

    parentId: DOM.NodeId  # deprecated
    nodes: list[DOM.Node]  # deprecated


class ShadowRootPopped(CDPEvent):
    """ Called when shadow root is popped from the element. """

    hostId: DOM.NodeId  # deprecated
    rootId: DOM.NodeId  # deprecated


class ShadowRootPushed(CDPEvent):
    """ Called when shadow root is pushed into the element. """

    hostId: DOM.NodeId  # deprecated
    root: DOM.Node  # deprecated
