Add type stubs for mido MIDI library

- Created type stubs for various modules in the mido library including messages, midifiles, parser, ports, sockets, syx, tokenizer, and version.
- Implemented type hints for functions and classes to improve type checking and code clarity.
- Added support for MIDI over TCP/IP in sockets module.
- Included methods for reading and writing SYX files in syx module.
- Enhanced the parser functionality with a dedicated Parser class for MIDI byte streams.
- Established a structure for MIDI file handling with MidiFile and MidiTrack classes.
This commit is contained in:
2026-04-26 00:51:40 +08:00
parent e5c692e5d7
commit 9009a7c5bc
23 changed files with 1875 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from collections.abc import Callable, Iterable
from numbers import Integral, Real
from .specs import MsgDict
def check_type(type_: str) -> None: ...
def check_channel(channel: int | Integral) -> None: ...
def check_pos(pos: int | Integral) -> None: ...
def check_pitch(pitch: int | Integral) -> None: ...
def check_data(data_bytes: Iterable[int | Integral]) -> None: ...
def check_frame_type(value: int | Integral) -> None: ...
def check_frame_value(value: int | Integral) -> None: ...
def check_data_byte(value: int | Integral) -> None: ...
def check_time(time: float | Real) -> None: ...
_CHECKS: dict[str, Callable[[object], None]]
def check_value(name: str, value: object) -> None: ...
def check_msgdict(msgdict: MsgDict) -> None: ...