from typing import Any

from java.lang import Object

class SerialScriptModule(Object):
    def __init__(self) -> None: ...
    def setTrialExpired(self, arg) -> None: ...

    class PortManager:
        def __init__(self, *args: Any) -> None: ...
        def __enter__(self) -> None: ...
        def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...

    class SerialConfigurator:
        def setBitRate(self, value) -> None: ...
        def setDataBits(self, value) -> None: ...
        def setFlowControl(self, value) -> None: ...
        def setHandshake(self, value) -> None: ...
        def setHardwareFlowControl(self, value) -> None: ...
        def setParity(self, value) -> None: ...
        def setStopBits(self, value) -> None: ...

    class SerialPortWrapper:
        def readBytes(self, port, numberOfBytes, timeout: int = ...) -> None: ...
        def readBytesAsString(
            self, port, numberOfBytes, timeout: int = ..., encoding: str = ...
        ) -> None: ...
        def readLine(
            self,
            port,
            timeout: int = ...,
            encoding: str = ...,
            crlfRequired: bool = ...,
        ) -> None: ...
        def readUntil(
            self, port, delimiter, includeDelimiter, timeout: int = ...
        ) -> None: ...
        def sendBreak(self, port, millis) -> None: ...
        def write(self, port, toWrite, encoding: str = ...) -> None: ...
        def writeBytes(self, port, toWrite, timeout: int = ...) -> None: ...
