| 1 | from _typeshed import SizedBuffer |
| 2 | from typing import IO, Any, Final |
| 3 | from typing_extensions import TypeAlias |
| 4 | |
| 5 | __all__ = ["binhex", "hexbin", "Error"] |
| 6 | |
| 7 | class Error(Exception): ... |
| 8 | |
| 9 | REASONABLY_LARGE: Final = 32768 |
| 10 | LINELEN: Final = 64 |
| 11 | RUNCHAR: Final = b"\x90" |
| 12 | |
| 13 | class FInfo: |
| 14 | Type: str |
| 15 | Creator: str |
| 16 | Flags: int |
| 17 | |
| 18 | _FileInfoTuple: TypeAlias = tuple[str, FInfo, int, int] |
| 19 | _FileHandleUnion: TypeAlias = str | IO[bytes] |
| 20 | |
| 21 | def getfileinfo(name: str) -> _FileInfoTuple: ... |
| 22 | |
| 23 | class openrsrc: |
| 24 | def __init__(self, *args: Any) -> None: ... |
| 25 | def read(self, *args: Any) -> bytes: ... |
| 26 | def write(self, *args: Any) -> None: ... |
| 27 | def close(self) -> None: ... |
| 28 | |
| 29 | class BinHex: |
| 30 | def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... |
| 31 | def write(self, data: SizedBuffer) -> None: ... |
| 32 | def close_data(self) -> None: ... |
| 33 | def write_rsrc(self, data: SizedBuffer) -> None: ... |
| 34 | def close(self) -> None: ... |
| 35 | |
| 36 | def binhex(inp: str, out: str) -> None: ... |
| 37 | |
| 38 | class HexBin: |
| 39 | def __init__(self, ifp: _FileHandleUnion) -> None: ... |
| 40 | def read(self, *n: int) -> bytes: ... |
| 41 | def close_data(self) -> None: ... |
| 42 | def read_rsrc(self, *n: int) -> bytes: ... |
| 43 | def close(self) -> None: ... |
| 44 | |
| 45 | def hexbin(inp: str, out: str) -> None: ... |