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

from typing import Awaitable, Callable
from nexusrpc import InputT, OperationInfo, OutputT
from nexusrpc.handler import CancelOperationContext, FetchOperationInfoContext, FetchOperationResultContext, OperationHandler, StartOperationContext, StartOperationResultAsync
from temporalio.nexus._token import WorkflowHandle

class WorkflowRunOperationHandler(OperationHandler[InputT, OutputT]):
    """Operation handler for Nexus operations that start a workflow.

    Use this class to create an operation handler that starts a workflow by passing your
    ``start`` method to the constructor. Your ``start`` method must use
    :py:func:`temporalio.nexus.WorkflowRunOperationContext.start_workflow` to start the
    workflow.
    """
    def __init__(self, start: Callable[[StartOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]],]) -> None:
        """Initialize the workflow run operation handler."""
        ...
    
    async def start(self, ctx: StartOperationContext, input: InputT) -> StartOperationResultAsync:
        """Start the operation, by starting a workflow and completing asynchronously."""
        ...
    
    async def cancel(self, ctx: CancelOperationContext, token: str) -> None:
        """Cancel the operation, by cancelling the workflow."""
        ...
    
    async def fetch_info(self, ctx: FetchOperationInfoContext, token: str) -> OperationInfo:
        """Fetch operation info (not supported for Temporal Nexus operations)."""
        ...
    
    async def fetch_result(self, ctx: FetchOperationResultContext, token: str) -> OutputT:
        """Fetch operation result (not supported for Temporal Nexus operations)."""
        ...
    


