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

import AssetAPI as AssetAPI
import ConfigurationAPI_cmodule as Configuration
import Utils.EventModule as EventModule
import NodegraphAPI.GroupStack as GroupStack
import NodegraphAPI.NodeExtensions as NodeExtensions
import NodegraphAPI.NodeXmlIO as NodeXmlIO
import NodegraphAPI as NodegraphAPI
import NodegraphAPI.GroupStack
import NodegraphAPI_cmodule
import NodegraphAPI.NodegraphGlobals as NodegraphGlobals
import PyXmlIO
import PyQt5.QtCore as QtCore
import Utils.UndoStack as UndoStack
import Utils as Utils
import Utils.UndoStack
import NodegraphAPI.Xio as Xio
from Callbacks.Callbacks import Callbacks as Callbacks
from NodegraphAPI_cmodule import GroupNode as GroupNode, PythonGroupNode as PythonGroupNode, node_addNodeFlavor as node_addNodeFlavor, node_getAllNodes as node_getAllNodes, node_registerPythonGroupType as node_registerPythonGroupType
from Utils.Decorators import deprecated as deprecated
from _typeshed import Incomplete
from typing import ClassVar, Set, Tuple

class AssetPublishing:
    kAssetPublishingCancelled: ClassVar[int] = ...
    kAssetPublishingFailed: ClassVar[int] = ...
    kAssetPublishingStarted: ClassVar[int] = ...
    kAssetPublishingSucceeded: ClassVar[int] = ...
    def __init__(self) -> None: ...
    def errorMessageDialogsEnabled(self) -> bool: ...
    def getAssetType(self) -> str | None: ...
    def getErrorMessage(self) -> str | None: ...
    def getExtraOptions(self) -> dict: ...
    def getFilenameOrAssetIdToPublish(self) -> str | None: ...
    def getNodeName(self) -> str | None: ...
    def getPublishedFilenameOrAssetID(self) -> str | None: ...
    def getState(self) -> int: ...
    def isErrorLoggingEnabled(self) -> bool: ...
    def isOverwriteAssetEnabled(self) -> bool: ...
    def isSuccessLoggingEnabled(self) -> bool: ...
    def setAssetType(self, assetType: str | None): ...
    def setErrorLoggingEnabled(self, errorLoggingEnabled: bool): ...
    def setErrorMessage(self, errorMessage: str | None): ...
    def setErrorMessageDialogsEnabled(self, errorMessageDialogsEnabled: bool): ...
    def setExtraOptions(self, extraOptions: dict): ...
    def setFilenameOrAssetIdToPublish(self, filenameOrAssetIdToPublish: str | None): ...
    def setNodeName(self, nodeName: str | None): ...
    def setOverwriteAssetEnabled(self, overwriteAssetEnabled: bool): ...
    def setPublishedFilenameOrAssetID(self, publishedFilenameOrAssetID: str | None): ...
    def setState(self, state: int): ...
    def setSuccessLoggingEnabled(self, successLoggingEnabled: bool): ...

class LiveGroupMixin:
    EDITABLE_STATES: ClassVar[tuple] = ...
    STATES: ClassVar[tuple] = ...
    STATE_ATTR_NAME: ClassVar[str] = ...
    STATE_CHILD_EDITABLE: ClassVar[int] = ...
    STATE_CHILD_MODIFIED: ClassVar[int] = ...
    STATE_EDITABLE: ClassVar[int] = ...
    STATE_EDITABLE_CHILD_MODIFIED: ClassVar[int] = ...
    STATE_MODIFIED: ClassVar[int] = ...
    STATE_NON_EDITABLE: ClassVar[int] = ...
    _LiveGroupMixin__foundRecursionOnLoading: ClassVar[bool] = ...
    _LiveGroupMixin__loadingRootNode: ClassVar[None] = ...
    _LiveGroupMixin__loadingStack: ClassVar[list] = ...
    def __init__(self) -> None: ...
    def _LiveGroupMixin__adoptPortConfiguration(self, node: NodegraphAPI.Node): ...
    def _LiveGroupMixin__canChangeStateTo(self, editable): ...
    def _LiveGroupMixin__makeEditable(self): ...
    def _LiveGroupMixin__makeNonEditable(self): ...
    def _LiveGroupMixin__mergeParameters(self, loadedGroup): ...
    def _LiveGroupMixin__removeChildren(self): ...
    def _LiveGroupMixin__reparentChildren(self, loadedGroup): ...
    def _isSourcelessLiveGroupModified(self) -> bool: ...
    def _load(self, forceLoad: bool, forceNonEditable: bool = ...): ...
    def _setEditable(self, editable: bool, updateContentLock: bool = ...) -> bool: ...
    def _setLiveGroupState(self, liveGroupState: int): ...
    def _setLiveGroupStateToEditable(self): ...
    def _updateContentLock(self): ...
    def _updateLiveGroupState(self, childLiveGroupNode: LiveGroupNode, previousChildLiveGroupState: int): ...
    def _updateShapeAttributes(self): ...
    def getLastSource(self): ...
    def getNestedLiveGroupNodes(self) -> list: ...
    def getSourceFile(self) -> str: ...
    def getSourceName(self) -> str: ...
    def hasEditableLiveGroupChildren(self) -> bool: ...
    def hasModifiedLiveGroupChildren(self) -> bool: ...
    def isDisabledByParameter(self) -> bool: ...
    def isEditable(self) -> bool: ...
    def setAttributes(self, attrs: dict): ...
    def setSource(self, filenameOrAssetID: str, loadFromSource: bool = ...): ...

class LiveGroupNode(NodegraphAPI_cmodule.PythonGroupNode, LiveGroupMixin):
    ATTRIBUTES_TO_IGNORE: ClassVar[tuple] = ...
    def __init__(self) -> None: ...
    def _LiveGroupNode__resolveLiveGroupReferences(self, documentElement: PyXmlIO.Element) -> tuple[bool, PyXmlIO.Element]: ...
    def _calculateContentHash(self): ...
    def _hasContentChanged(self): ...
    def _sourceAssetIdIsFilePath(self): ...
    def _updateContentHash(self): ...
    def _updateContentLock(self): ...
    def addParameterHints(self, attrName, inputDict): ...
    def convertToGroup(self): ...
    def exportAsset(self, filenameOrAssetID: str, extraOptions: Incomplete | None = ...) -> str: ...
    def getGroupXmlIO(self) -> Document: ...
    def hasContentChanged(self): ...
    def isModified(self) -> bool: ...
    def load(self, lockResult: bool = ..., forceLoad: bool = ..., forceNonEditable: bool = ...): ...
    def makeEditable(self, includingAllParents: bool = ...) -> bool: ...
    def publishAndLoadAsset(self, filenameOrAssetID: Incomplete | None = ..., extraOptions: Incomplete | None = ...): ...
    def publishAsset(self, filenameOrAssetID: Incomplete | None = ..., extraOptions: Incomplete | None = ...) -> str: ...
    def publishAssetAndFinishEditingContents(self, filenameOrAssetID: Incomplete | None = ..., extraOptions: Incomplete | None = ...) -> str: ...
    def reloadFromSource(self) -> bool: ...
    def revert(self) -> bool: ...
    def setAttributes(self, attrs: dict): ...
    def setLocked(self, locked: bool): ...
    def writeToAsset(self, filenameOrAssetID, extraOptions: Incomplete | None = ..., reloadContent: bool = ...): ...

class LiveGroupStack(NodegraphAPI.GroupStack.GroupStackNode, LiveGroupMixin):
    def __init__(self) -> None: ...
    def addParameterHints(self, attrName, inputDict): ...
    def allowChildReparentingViaDrag(self, childNode): ...
    def buildChildNode(self, adoptNode: Incomplete | None = ...): ...
    def canAdoptNodes(self, nodes): ...
    def deleteChildNode(self, childNode): ...
    def load(self, lockResult: bool = ..., forceLoad: bool = ..., forceNonEditable: bool = ...): ...
    def preprocessChildReparentingViaDrag(self, childNode): ...
    def reorderChildNode(self, fromIndex, toIndex): ...

class UndoConvertGroupToLiveGroup(Utils.UndoStack.UndoEntry):
    def __init__(self, groupNodeName, liveGroupNodeName) -> None: ...
    def getName(self) -> str: ...
    def redo(self): ...
    def undo(self): ...

class UndoConvertLiveGroupToGroup(Utils.UndoStack.UndoEntry):
    def __init__(self, groupNodeName, liveGroupNodeName, filenameOrAssetID, isEditable) -> None: ...
    def getName(self) -> str: ...
    def redo(self): ...
    def undo(self): ...

def CalculateLiveGroupDepth(liveGroupNode: LiveGroupMixin | NodegraphAPI.Node) -> int: ...
def CanBeDifferentFromSource(liveGroupNode: LiveGroupMixin) -> bool: ...
def ConvertGroupToLiveGroup(groupNode): ...
def IsLiveGroupCachingEnabled(): ...
def IsLiveGroupLoadingEnabled(): ...
def LoadAllLiveGroups(node: NodegraphAPI.Node, lockResult: bool = ..., forceLoad: bool = ...): ...
def LockAllLiveGroups(node: NodegraphAPI.Node): ...
def MakeAllLiveGroupsEditable(node: NodegraphAPI.Node): ...
def MakeAllParentLiveGroupsEditable(node: NodegraphAPI.Node) -> bool: ...
def SetLiveGroupCachingEnabled(liveGroupCachingEnabled): ...
def SetLiveGroupLoadingEnabled(state): ...
def UpdateAllLiveGroupSources(oldSource: str, newSource: str): ...
