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


https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/

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

from cdpkit.protocol.base import CDPEvent


class AddHeapSnapshotChunk(CDPEvent):

    chunk: str


class HeapStatsUpdate(CDPEvent):
    """ If heap objects tracking has been started then backend may send update for one or more fragments """

    statsUpdate: list[int]


class LastSeenObjectId(CDPEvent):
    """ If heap objects tracking has been started then backend regularly sends a current value for last
    seen object id and corresponding timestamp. If the were changes in the heap since last event
    then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. """

    lastSeenObjectId: int
    timestamp: float


class ReportHeapSnapshotProgress(CDPEvent):

    done: int
    total: int
    finished: bool | None = None


class ResetProfiles(CDPEvent):

    ...
