"""
This type stub file was generated by pyright.
"""

import asyncio
import logging
from typing import Any, Awaitable, Callable, Dict, List
from pyee import EventEmitter
from pyppeteer.connection import CDPSession

"""Helper functions."""
logger = ...
def debugError(_logger: logging.Logger, msg: Any) -> None:
    """Log error messages."""
    ...

def evaluationString(fun: str, *args: Any) -> str:
    """Convert function and arguments to str."""
    ...

def getExceptionMessage(exceptionDetails: dict) -> str:
    """Get exception message from `exceptionDetails` object."""
    ...

def addEventListener(emitter: EventEmitter, eventName: str, handler: Callable) -> Dict[str, Any]:
    """Add handler to the emitter and return emitter/handler."""
    ...

def removeEventListeners(listeners: List[dict]) -> None:
    """Remove listeners from emitter."""
    ...

unserializableValueMap = ...
def valueFromRemoteObject(remoteObject: Dict) -> Any:
    """Serialize value of remote object."""
    ...

def releaseObject(client: CDPSession, remoteObject: dict) -> Awaitable:
    """Release remote object."""
    ...

def waitForEvent(emitter: EventEmitter, eventName: str, predicate: Callable[[Any], bool], timeout: float, loop: asyncio.AbstractEventLoop) -> Awaitable:
    """Wait for an event emitted from the emitter."""
    ...

def get_positive_int(obj: dict, name: str) -> int:
    """Get and check the value of name in obj is positive integer."""
    ...

def is_jsfunc(func: str) -> bool:
    """Heuristically check function or expression."""
    ...

