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

The Browser domain defines methods and events for browser managing.
https://chromedevtools.github.io/devtools-protocol/tot/Browser/

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

from typing import Literal

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


class DownloadWillBegin(CDPEvent):
    """ Fired when page is about to start a download. """

    frameId: Page.FrameId
    guid: str
    url: str
    suggestedFilename: str


class DownloadProgress(CDPEvent):
    """ Fired when download makes progress. Last call has |done| == true. """

    guid: str
    totalBytes: float
    receivedBytes: float
    state: Literal['inProgress', 'completed', 'canceled']
    filePath: str | None = None  # experimental
