from typing import Union, overload, List
from .rf24 import RF24, rf24_datarate_e
from .rf24_network import RF24Network

MESH_DEFAULT_ADDRESS: int = 0o4444
MESH_ADDR_LOOKUP: int = 196
MESH_ADDR_RELEASE: int = 197
MESH_ID_LOOKUP: int = 198

class AddrListStruct:
    def __init__(self): ...
    @property
    def node_id(self) -> int: ...
    @property
    def address(self) -> int: ...

class RF24Mesh:
    def __init__(self, radio: RF24, network: RF24Network) -> None: ...
    def begin(
        self,
        channel: int = 97,
        data_rate: rf24_datarate_e = rf24_datarate_e.RF24_1MBPS,
        timeout: int = 7500,
    ) -> bool: ...
    def check_connection(self) -> bool: ...
    def checkConnection(self) -> bool: ...
    def dhcp(self) -> None: ...
    def DHCP(self) -> None: ...
    def save_dhcp(self) -> None: ...
    def saveDHCP(self) -> None: ...
    def load_dhcp(self) -> None: ...
    def loadDHCP(self) -> None: ...
    def get_address(self, node_id: int) -> int: ...
    def getAddress(self, node_id: int) -> int: ...
    def set_address(
        self, node_id: int, address: int, search_by_address: bool = False
    ): ...
    def setAddress(
        self, node_id: int, address: int, search_by_address: bool = False
    ): ...
    def setStaticAddress(self, node_id: int, address: int) -> None: ...
    def set_node_id(self) -> None: ...
    def setNodeID(self) -> None: ...
    def get_node_id(self, address: int) -> int: ...
    def getNodeID(self, address: int) -> int: ...
    def release_address(self) -> bool: ...
    def releaseAddress(self) -> bool: ...
    def renew_address(self, timeout: int = 7500) -> int: ...
    def renewAddress(self, timeout: int = 7500) -> int: ...
    def set_channel(self, channel: int) -> None: ...
    def setChannel(self, channel: int) -> None: ...
    def set_child(self, allow: bool) -> None: ...
    def setChild(self, allow: bool) -> None: ...
    def update(self) -> int: ...
    @overload
    def write(
        self, buf: Union[bytes, bytearray], message_type: int, to_node_id: int = 0
    ) -> bool: ...
    @overload
    def write(
        self, to_node: int, buf: Union[bytes, bytearray], message_type: int
    ) -> bool: ...
    @property
    def mesh_address(self) -> int: ...
    @property
    def node_id(self) -> int: ...
    @node_id.setter
    def node_id(self, number: int) -> None: ...
    @property
    def _nodeID(self) -> int: ...
    @_nodeID.setter
    def _nodeID(self, number: int) -> None: ...
    @property
    def addr_list(self) -> List[AddrListStruct]: ...
    @property
    def addrList(self) -> List[AddrListStruct]: ...
