import asyncio
from pyfuse3 import FileHandleT as FileHandleT
from typing import Any, Callable, Iterable, Optional, Type

Lock = asyncio.Lock

def enable() -> None: ...
def disable() -> None: ...
def current_trio_token() -> str: ...
async def wait_readable(fd: FileHandleT) -> None: ...
def notify_closing(fd: FileHandleT) -> None: ...

class ClosedResourceError(Exception): ...

def current_task() -> Optional[asyncio.Task]: ...

class _Nursery:
    tasks: Any
    async def __aenter__(self) -> _Nursery: ...
    def start_soon(self, func: Callable, *args: Iterable[Any], name: Optional[str] = ...) -> None: ...
    async def __aexit__(self, exc_type: Optional[Type], exc_value: Optional[BaseException], traceback: Optional[Any]) -> None: ...

def open_nursery() -> _Nursery: ...
