from typing import Self
from pyautd3.derive import builder
from pyautd3.driver.link import Link
from pyautd3.driver.link import LinkBuilder
from pyautd3.native_methods.autd3capi import ControllerPtr
from pyautd3.native_methods.autd3capi import NativeMethods as Base
from pyautd3.native_methods.autd3capi_driver import HandlePtr
from pyautd3.native_methods.autd3capi_driver import LinkBuilderPtr
from pyautd3.native_methods.autd3capi_driver import LinkPtr
from pyautd3.native_methods.autd3capi_link_twincat import NativeMethods as LinkTwinCAT
from pyautd3.native_methods.utils import _to_null_terminated_utf8
from pyautd3.native_methods.utils import _validate_ptr



class _TwinCATBuilder(LinkBuilder[TwinCAT]):
    def _resolve_link(self: _TwinCATBuilder, handle: HandlePtr, ptr: ControllerPtr) -> TwinCAT: ...
    def _link_builder_ptr(self: _TwinCATBuilder, ) -> LinkBuilderPtr: ...

class TwinCAT(Link):
    def __init__(self: TwinCAT, handle: HandlePtr, ptr: LinkPtr) -> None: ...
    @staticmethod
    def builder() -> _TwinCATBuilder: ...

class _RemoteTwinCATBuilder(LinkBuilder[RemoteTwinCAT]):
    def __init__(self: _RemoteTwinCATBuilder, server_ams_net_id: str) -> None: ...
    def _link_builder_ptr(self: _RemoteTwinCATBuilder, ) -> LinkBuilderPtr: ...
    def _resolve_link(self: _RemoteTwinCATBuilder, handle: HandlePtr, _ptr: ControllerPtr) -> RemoteTwinCAT: ...
    def with_server_ip(self: _RemoteTwinCATBuilder, server_ip: str) -> _RemoteTwinCATBuilder: ...
    def with_client_ams_net_id(self: _RemoteTwinCATBuilder, client_ams_net_id: str) -> _RemoteTwinCATBuilder: ...
    @property
    def server_ams_net_id(self: _RemoteTwinCATBuilder) -> str: ...
    @property
    def server_ip(self: _RemoteTwinCATBuilder) -> str: ...
    @property
    def client_ams_net_id(self: _RemoteTwinCATBuilder) -> str: ...

class RemoteTwinCAT(Link):
    def __init__(self: RemoteTwinCAT, handle: HandlePtr, ptr: LinkPtr) -> None: ...
    @staticmethod
    def builder(server_ams_net_id: str) -> _RemoteTwinCATBuilder: ...
