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

from typing import Any, Callable, TypeVar
from typing_extensions import ParamSpec

"""
This type stub file was generated by pyright.
"""
_Params = ParamSpec("_Params")
_Return = TypeVar("_Return")
_utc_zero = ...
_default_info = ...
class ActivityEnvironment:
    """Activity environment for testing activities.

    This environment is used for running activity code that can access the
    functions in the :py:mod:`temporalio.activity` module. Use :py:meth:`run` to
    run an activity function or any function within an activity context.

    Attributes:
        info: The info that is returned from :py:func:`temporalio.activity.info`
            function.
        on_heartbeat: Function called on each heartbeat invocation by the
            activity.
        payload_converter: Payload converter set on the activity context. This
            must be set before :py:meth:`run`. Changes after the activity has
            started do not take effect.
        metric_meter: Metric meter set on the activity context. This must be set
            before :py:meth:`run`. Changes after the activity has started do not
            take effect. Default is noop.
    """
    def __init__(self) -> None:
        """Create an ActivityEnvironment for running activity code."""
        ...
    
    def cancel(self) -> None:
        """Cancel the activity.

        This only has an effect on the first call.
        """
        ...
    
    def worker_shutdown(self) -> None:
        """Notify the activity that the worker is shutting down.

        This only has an effect on the first call.
        """
        ...
    
    def run(self, fn: Callable[_Params, _Return], *args: _Params.args, **kwargs: _Params.kwargs) -> _Return:
        """Run the given callable in an activity context.

        Args:
            fn: The function/callable to run.
            args: All positional arguments to the callable.
            kwargs: All keyword arguments to the callable.

        Returns:
            The callable's result.
        """
        ...
    


class _Activity:
    def __init__(self, env: ActivityEnvironment, fn: Callable) -> None:
        ...
    
    def run(self, *args, **kwargs) -> Any:
        ...
    
    def cancel(self) -> None:
        ...
    
    def worker_shutdown(self) -> None:
        ...
    


