Typehint the parts of python-mpd2 I'm using too

This commit is contained in:
Danielle McLean 2023-11-27 15:48:52 +11:00
parent de884cbf72
commit 1e7fd270eb
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
2 changed files with 46 additions and 0 deletions

23
stubs/mpd/asyncio.pyi Normal file
View file

@ -0,0 +1,23 @@
from collections.abc import AsyncIterator, Sequence
from typing import Literal
from mpd.base import MPDClientBase
from mpd_now_playable.mpd import types
class MPDClient(MPDClientBase):
mpd_version: str | None
def __init__(self) -> None: ...
async def connect(self, host: str, port: int = ...) -> None: ...
async def password(self, password: str) -> None: ...
def idle(self, subsystems: Sequence[str] = ...) -> AsyncIterator[Sequence[str]]: ...
async def status(self) -> types.StatusResponse: ...
async def currentsong(self) -> types.CurrentSongResponse: ...
async def readpicture(self, uri: str) -> types.ReadPictureResponse: ...
async def play(self) -> None: ...
async def pause(self, pause: Literal[1, 0, None] = None) -> None: ...
async def stop(self) -> None: ...
async def next(self) -> None: ... # noqa: A003
async def previous(self) -> None: ...

23
stubs/mpd/base.pyi Normal file
View file

@ -0,0 +1,23 @@
from enum import Enum
class FailureResponseCode(Enum):
NOT_LIST: int
ARG: int
PASSWORD: int
PERMISSION: int
UNKNOWN: int
NO_EXIST: int
PLAYLIST_MAX: int
SYSTEM: int
PLAYLIST_LOAD: int
UPDATE_ALREADY: int
PLAYER_SYNC: int
EXIST: int
class MPDError(Exception): ...
class CommandError(MPDError):
pass
class MPDClientBase:
pass