# mypy: disable-error-code="misc, override, attr-defined, no-redef, assignment"

import NodegraphAPI as NodegraphAPI
import PyFnGeolib
import Utils as Utils
import abc
import typing
from Nodes3DAPI.PortOpClient import PortOpClient as PortOpClient
from Utils.Decorators import deprecated as deprecated
from _typeshed import Incomplete
from typing import ClassVar, Set, Tuple

kCurrentGraphStateId: GraphStateId
kNoGraphStateId: GraphStateId
kViewedNodeId: NodeId
kViewedPortId: PortId

class CallbackPortOpClient(PortOpClient):
    _abc_impl: ClassVar[_abc_data] = ...
    __abstractmethods__: ClassVar[frozenset] = ...
    initialGraphStateModifier: Incomplete
    opChangeCallback: Incomplete
    postTraversalGraphStateModifier: Incomplete
    def __init__(self, port: PortId = ..., opChangeCallback: typing.Optional[typing.Callable] = ..., initialGraphStateSpec: GraphStateId = ..., nodeTraversalEndpointsSpec: str = ..., initialGraphStateModifier: Incomplete | None = ..., postTraversalGraphStateModifier: Incomplete | None = ..., applyTerminalOpDelegates: bool = ...) -> None: ...
    @staticmethod
    def _getCallback(weakCallback: typing.Callable): ...
    @staticmethod
    def _getWeakCallback(callback): ...
    def modifyInitialGraphState(self, graphState: NodegraphAPI.GraphState): ...
    def modifyPostTraversalGraphState(self, graphState: NodegraphAPI.GraphState): ...
    def opChanged(self, op, graphState: NodegraphAPI.GraphState, txn): ...

class GraphStateId(str):
    kCurrent: ClassVar[str] = ...
    kNone: ClassVar[str] = ...
    kValues: ClassVar[tuple] = ...
    @classmethod
    def __init__(cls, value: str = ...) -> None: ...

class GraphStateSpec(GraphStateSpec):
    @classmethod
    def __init__(cls, value: GraphStateId = ...) -> None: ...

class NodeId(str):
    kValues: ClassVar[tuple] = ...
    kViewed: ClassVar[str] = ...
    @classmethod
    def __init__(cls, value: str = ...) -> None: ...

class NodeTraversalEndpoints(NodeTraversalEndpointsBase):
    @classmethod
    def __init__(cls, searchPort: NodegraphAPI.Port, startPortOrNode: NodegraphAPI.Port | NodegraphAPI.Node) -> None: ...
    @property
    def searchPort(self): ...
    @property
    def startPortOrNode(self): ...

class NodeTraversalEndpointsSpec(NodeTraversalEndpointsBase):
    @classmethod
    def __init__(cls, searchPortSpec: NodegraphAPI.Port | PortId, startPortOrNodeSpec: NodeId = ...) -> None: ...
    def getNodeTraversalEndpoints(self) -> NodeTraversalEndpoints | None: ...
    @property
    def searchPortSpec(self): ...
    @property
    def startPortOrNodeSpec(self): ...

class PortId(str):
    kValues: ClassVar[tuple] = ...
    kViewed: ClassVar[str] = ...
    @classmethod
    def __init__(cls, value: str = ...) -> None: ...

class PortOpClient(abc.ABC):
    _abc_impl: ClassVar[_abc_data] = ...
    kDefaultInitialGraphStateSpec: ClassVar[GraphStateId] = ...
    kDefaultNodeTraversalEndpointsSpec: ClassVar[str] = ...
    __abstractmethods__: ClassVar[frozenset] = ...
    initialGraphStateSpec: Incomplete
    nodeTraversalEndpointsSpec: Incomplete
    port: Incomplete
    def __init__(self, port: PortId = ..., initialGraphStateSpec: GraphStateId = ..., nodeTraversalEndpointsSpec: str = ..., applyTerminalOpDelegates: bool = ...) -> None: ...
    def getNodeTraversalEndpoints(self) -> NodeTraversalEndpoints | None: ...
    def getResolvedPort(self) -> NodegraphAPI.Port | None: ...
    def modifyInitialGraphState(self, graphState: NodegraphAPI.GraphState | None) -> NodegraphAPI.GraphState: ...
    def modifyPostTraversalGraphState(self, graphState: NodegraphAPI.GraphState) -> NodegraphAPI.GraphState: ...
    def opChanged(self, op: PyFnGeolib.GeolibRuntimeOp, graphState: NodegraphAPI.GraphState, txn: PyFnGeolib.GeolibRuntimeTransaction): ...

class PortOpClientRegistry:
    def __init__(self) -> None: ...
    def clientIsRegistered(self, client): ...
    def getClientOp(self, client: PortOpClient) -> PyFnGeolib.GeolibRuntimeOp: ...
    def getClients(self) -> list[PortOpClient]: ...
    def getClientsAndOps(self) -> list[PortOpClient, PyFnGeolib.GeolibRuntimeOp]: ...
    def isClientRegistered(self, client: PortOpClient) -> bool: ...
    def registerClient(self, client: PortOpClient): ...
    def unregisterClient(self, client: PortOpClient): ...
    def updateClientOp(self, client: PortOpClient, op: PyFnGeolib.GeolibRuntimeOp) -> bool: ...

class _NodeTraversalEndpointsBase(tuple):
    _field_defaults: ClassVar[dict] = ...
    _fields: ClassVar[tuple] = ...
    _fields_defaults: ClassVar[dict] = ...
    def __init__(self, _cls, searchPoint, startPoint) -> None: ...
    def _asdict(self): ...
    @classmethod
    def _make(cls, iterable): ...
    def _replace(self, _self, **kwds): ...
    def __getnewargs__(self): ...
    @property
    def searchPoint(self): ...
    @property
    def startPoint(self): ...
