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

from dataclasses import dataclass
from typing import Generic, Literal, Optional, TYPE_CHECKING
from nexusrpc import OutputT

OperationTokenType = Literal[1]
OPERATION_TOKEN_TYPE_WORKFLOW: OperationTokenType = ...
if TYPE_CHECKING:
    ...
@dataclass(frozen=True)
class WorkflowHandle(Generic[OutputT]):
    """A handle to a workflow that is backing a Nexus operation.

    .. warning::
        This API is experimental and unstable.

    Do not instantiate this directly. Use
    :py:func:`temporalio.nexus.WorkflowRunOperationContext.start_workflow` to create a
    handle.
    """
    namespace: str
    workflow_id: str
    version: Optional[int] = ...
    def to_token(self) -> str:
        """Convert handle to a base64url-encoded token string."""
        ...
    
    @classmethod
    def from_token(cls, token: str) -> WorkflowHandle[OutputT]:
        """Decodes and validates a token from its base64url-encoded string representation."""
        ...
    


_base64_url_alphabet = ...
