# This file is auto-generated by the CDP protocol generator.
# Do not edit this file manually as your changes will be overwritten.
# Generated from Chrome DevTools Protocol specifications.

"""CDP PerformanceTimeline Domain Library"""

from typing import Any, Dict, Optional, cast

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ...client import CDPClient
    from .commands import EnableParameters


class PerformanceTimelineClient:
    """Client for PerformanceTimeline domain commands."""

    def __init__(self, client: "CDPClient"):
        self._client = client

    async def enable(
        self,
        params: "EnableParameters",
        session_id: Optional[str] = None,
    ) -> "Dict[str, Any]":
        """Previously buffered events would be reported before method returns.
        See also: timelineEventAdded"""
        return cast(
            "Dict[str, Any]",
            await self._client.send_raw(
                method="PerformanceTimeline.enable",
                params=params,
                session_id=session_id,
            ),
        )
