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

from typing import Any, Dict, Optional, TYPE_CHECKING
from pyppeteer.connection import CDPSession
from pyppeteer.element_handle import ElementHandle
from pyppeteer.frame_manager import Frame

"""Execution Context Module."""
if TYPE_CHECKING:
    ...
logger = ...
EVALUATION_SCRIPT_URL = ...
SOURCE_URL_REGEX = ...
class ExecutionContext:
    """Execution Context class."""
    def __init__(self, client: CDPSession, contextPayload: Dict, objectHandleFactory: Any, frame: Frame = ...) -> None:
        ...
    
    @property
    def frame(self) -> Optional[Frame]:
        """Return frame associated with this execution context."""
        ...
    
    async def evaluate(self, pageFunction: str, *args: Any, force_expr: bool = ...) -> Any:
        """Execute ``pageFunction`` on this context.

        Details see :meth:`pyppeteer.page.Page.evaluate`.
        """
        ...
    
    async def evaluateHandle(self, pageFunction: str, *args: Any, force_expr: bool = ...) -> JSHandle:
        """Execute ``pageFunction`` on this context.

        Details see :meth:`pyppeteer.page.Page.evaluateHandle`.
        """
        ...
    
    async def queryObjects(self, prototypeHandle: JSHandle) -> JSHandle:
        """Send query.

        Details see :meth:`pyppeteer.page.Page.queryObjects`.
        """
        ...
    


class JSHandle:
    """JSHandle class.

    JSHandle represents an in-page JavaScript object. JSHandle can be created
    with the :meth:`~pyppeteer.page.Page.evaluateHandle` method.
    """
    def __init__(self, context: ExecutionContext, client: CDPSession, remoteObject: Dict) -> None:
        ...
    
    @property
    def executionContext(self) -> ExecutionContext:
        """Get execution context of this handle."""
        ...
    
    async def getProperty(self, propertyName: str) -> JSHandle:
        """Get property value of ``propertyName``."""
        ...
    
    async def getProperties(self) -> Dict[str, JSHandle]:
        """Get all properties of this handle."""
        ...
    
    async def jsonValue(self) -> Dict:
        """Get Jsonized value of this object."""
        ...
    
    def asElement(self) -> Optional[ElementHandle]:
        """Return either null or the object handle itself."""
        ...
    
    async def dispose(self) -> None:
        """Stop referencing the handle."""
        ...
    
    def toString(self) -> str:
        """Get string representation."""
        ...
    


