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

This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)
have an associated `id` used in subsequent operations on the related object. Each object type has
a specific `id` structure, and those are not interchangeable between objects of different kinds.
CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client
can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and
subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.
https://chromedevtools.github.io/devtools-protocol/tot/CSS/

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

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


class FontsUpdated(CDPEvent):
    """ Fires whenever a web font is updated.  A non-empty font parameter indicates a successfully loaded
    web font. """

    font: CSS.FontFace | None = None


class MediaQueryResultChanged(CDPEvent):
    """ Fires whenever a MediaQuery result changes (for example, after a browser window has been
    resized.) The current implementation considers only viewport-dependent media features. """

    ...


class StyleSheetAdded(CDPEvent):
    """ Fired whenever an active document stylesheet is added. """

    header: CSS.CSSStyleSheetHeader


class StyleSheetChanged(CDPEvent):
    """ Fired whenever a stylesheet is changed as a result of the client operation. """

    styleSheetId: DOM.StyleSheetId


class StyleSheetRemoved(CDPEvent):
    """ Fired whenever an active document stylesheet is removed. """

    styleSheetId: DOM.StyleSheetId


class ComputedStyleUpdated(CDPEvent):

    nodeId: DOM.NodeId
