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

import CacheManager as CacheManager
import PyFnAttribute as FnAttribute
import PyFnGeolib as FnGeolib
import PyFnGeolibServices as FnGeolibServices
import NodegraphAPI as NodegraphAPI
import NodegraphAPI_cmodule as NodegraphAPI_cmodule
import Nodes3DAPI
import PyFnGeolib
import Nodes3DAPI.UpdateModes as UpdateModes
import Utils as Utils
import _weakrefset
import typing
import weakref
from Nodes3DAPI.PortOpClient import PortOpClient as PortOpClient, g_portOpClientRegistry as g_portOpClientRegistry
from Nodes3DAPI.TerminalOpDelegates.TerminalOpDelegate import TerminalOpDelegate
from PyFnGeolib import _Geolib as _Geolib, _Runtime as _Runtime, _gDefaultSourceOp as _gDefaultSourceOp
from _typeshed import Incomplete
from typing import ClassVar, Set, Tuple

class NodeGeolib3:
    class OpChainInterface:
        FAIL: ClassVar[int] = ...
        NO_OP: ClassVar[int] = ...
        SKIP: ClassVar[int] = ...
        def __init__(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, entries, inputRequests) -> None: ...
        def addInputRequest(self, inputPortName, graphState: NodegraphAPI.GraphState, invalidInputBehavior: int = ...): ...
        def appendOp(self, opType, opArgs): ...
        def getGraphState(self): ...
        def getMinRequiredInputs(self): ...
        def getPort(self): ...
        def setExplicitInputRequestsEnabled(self, state): ...
        def setMinRequiredInputs(self, value): ...

    class OpRecord:
        def __init__(self, transaction, nodeName, nodeType) -> None: ...

    class ParamDependencyTracker:
        def __init__(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState) -> None: ...
        def addDependency(self, node: NodegraphAPI.Node): ...
        def __enter__(self): ...
        def __exit__(self, type, value, traceback): ...
    _NodeGeolib3__instances: ClassVar[_weakrefset.WeakSet] = ...
    _NodeGeolib3__opIdToNodeDict: ClassVar[weakref.WeakValueDictionary] = ...
    def __init__(self) -> None: ...
    def _NodeGeolib3__handleInvalidInput(self, transaction, graphState: NodegraphAPI.GraphState, inputOps, inputPortName, invalidInputBehavior, message): ...
    def _areInputsAndParametersDirty(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, visitedState: set, reset: bool = ...) -> Tuple[bool, bool]: ...
    def _areInputsDirty(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, visitedState, reset: bool = ...): ...
    def _areParamsDirty(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, reset: bool = ...): ...
    def _areParentsDirty(self, graphState: NodegraphAPI.GraphState, reset: bool = ...) -> bool: ...
    def _createOrGetOp(self, transaction, key, graphState: NodegraphAPI.GraphState): ...
    def _flushAll(self): ...
    def _getErrorOp(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, transaction: PyFnGeolib.GeolibRuntimeTransaction, message: str) -> PyFnGeolib.GeolibRuntimeOp: ...
    def _getOp(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, visitedState: set, transaction: PyFnGeolib.GeolibRuntimeTransaction) -> PyFnGeolib.GeolibRuntimeOp: ...
    def _getSafeOp(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, visitedState, transaction): ...
    def _getSafeOpChain(self, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState, visitedState, transaction): ...
    def _registerOpChain(self, opChain): ...
    def _setParamsDirty(self): ...
    @staticmethod
    def _unregisterOpChain(opChain): ...
    @staticmethod
    def flushAll(): ...
    @staticmethod
    def getNodeForOpId(opId: int) -> Nodes3DAPI.Node3D | None: ...
    def invalidateOps(self): ...

class _NodeTraversal(NodeTraversal):
    @classmethod
    def __init__(cls, graphState: NodegraphAPI.GraphState, nodeTraversalEndpoints) -> None: ...

class _PortAndGraphState(tuple):
    _field_defaults: ClassVar[dict] = ...
    _fields: ClassVar[tuple] = ...
    _fields_defaults: ClassVar[dict] = ...
    def __init__(self, _cls, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState) -> None: ...
    def _asdict(self): ...
    @classmethod
    def _make(cls, iterable): ...
    def _replace(self, _self, **kwds): ...
    def __getnewargs__(self): ...
    @property
    def graphState(self): ...
    @property
    def port(self): ...

def ActivatePort(port: NodegraphAPI.Port, graphState: typing.Optional[NodegraphAPI.GraphState] = ..., potentialOpChangeCallback: typing.Optional[typing.Callable] = ..., getOpFunction: Incomplete | None = ..., applyTerminalOpDelegatesForCallback: bool = ...): ...
def ApplyTerminalOpDelegates(op: PyFnGeolib.GeolibRuntimeOp, txn: PyFnGeolib.GeolibRuntimeTransaction, port: NodegraphAPI.Port, graphState: NodegraphAPI.GraphState) -> PyFnGeolib.GeolibRuntimeOp: ...
def CommitChanges() -> int: ...
def DeactivatePort(port: NodegraphAPI.Port, graphState: typing.Optional[NodegraphAPI.GraphState] = ..., potentialOpChangeCallback: typing.Optional[typing.Callable] = ...): ...
def GetDefaultSourceOp(): ...
def GetRuntime(): ...
def IsProcessing(): ...
def ManualUpdate() -> int: ...
def MarkPortOpClientDirty(portOpClient: PortOpClient): ...
def PrintOpDependencyInfo(): ...
def RegisterCommitIdCallback(commitIdCallback: typing.Callable): ...
def RegisterPortOpClient(portOpClient: PortOpClient): ...
def RegisterTerminalOpDelegate_geolib3(name: str, terminalOpDelegate: TerminalOpDelegate): ...
def UnregisterPortOpClient(portOpClient: PortOpClient): ...
def UpdatePortOpClients(portOpClients: Incomplete | None = ...) -> int: ...
