From a8049bb66f7bc62c9a33488615d0990e0a920520 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 09:53:28 +0100 Subject: build: add utility scripts --- typings/serial/serialwin32.pyi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 typings/serial/serialwin32.pyi (limited to 'typings/serial/serialwin32.pyi') diff --git a/typings/serial/serialwin32.pyi b/typings/serial/serialwin32.pyi new file mode 100644 index 0000000..5124dd2 --- /dev/null +++ b/typings/serial/serialwin32.pyi @@ -0,0 +1,34 @@ +""" +This type stub file was generated by pyright. +""" + +from typing import Any, Optional +from serial.serialutil import SerialBase + + +class Serial(SerialBase): + """Serial port implementation for Win32 based on ctypes.""" + + def __init__( + self, + port: Optional[str] = ..., + baudrate: Optional[int] = ..., + **kwargs: Any + ) -> None: + ... + + def close(self) -> None: + """Close port""" + ... + + def read(self, size: Optional[int] = ...) -> bytes: + """\ + Read size bytes from the serial port. If a timeout is set it may + return less characters as requested. With no timeout it will block + until the requested number of bytes is read. + """ + ... + + def __enter__(self) -> Serial: ... + + def __exit__(self, *args: Any, **kwargs: Any) -> None: ... -- cgit v1.2.3-18-g5258