import typing
import collections.abc
import typing_extensions
import numpy.typing as npt
import _bpy_types
import bl_operators.node_editor.node_functions
import bpy.types

class NODE_OT_connect_to_output(
    _bpy_types.Operator, bl_operators.node_editor.node_functions.NodeEditorBase
):
    bl_description: typing.Any
    bl_idname: typing.Any
    bl_label: typing.Any
    bl_options: typing.Any
    bl_rna: typing.Any
    id_data: typing.Any

    def bl_rna_get_subclass(self) -> bpy.types.Struct:
        """

        :return: The RNA type or default when not found.
        """

    def bl_rna_get_subclass_py(self) -> typing.Any:
        """

        :return: The class or default when not found.
        """

    def cleanup(self) -> None: ...
    def create_links(self, path, node, active_node_socket_id, socket_type) -> None:
        """Create links at each step in the node group path.

        :param path:
        :param node:
        :param active_node_socket_id:
        :param socket_type:
        """

    @staticmethod
    def ensure_group_output(node_tree) -> None:
        """Check if a group output node exists, otherwise create it

        :param node_tree:
        """

    def ensure_viewer_socket(self, node_tree, socket_type, connect_socket=None) -> None:
        """Check if a viewer output already exists in a node group, otherwise create it

        :param node_tree:
        :param socket_type:
        :param connect_socket:
        """

    def get_output_index(
        self, node, output_node, is_base_node_tree, socket_type, check_type=False
    ) -> None:
        """Get the next available output socket in the active node

        :param node:
        :param output_node:
        :param is_base_node_tree:
        :param socket_type:
        :param check_type:
        """

    @staticmethod
    def get_output_sockets(node_tree) -> None:
        """

        :param node_tree:
        """

    def has_socket_other_users(self, socket) -> None:
        """List the other users for this socket (other materials or geometry nodes groups)

        :param socket:
        """

    def init_shader_variables(self, space, shader_type) -> None:
        """Get correct output node in shader editor

        :param space:
        :param shader_type:
        """

    def invoke(self, context, event) -> None:
        """

        :param context:
        :param event:
        """

    def is_socket_used_active_tree(self, socket) -> None:
        """Ensure used sockets in active node tree is calculated and check given socket

        :param socket:
        """

    def link_leads_to_used_socket(self, link) -> None:
        """Return True if link leads to a socket that is already used in this node

        :param link:
        """

    @classmethod
    def poll(cls, context) -> None:
        """Already implemented natively for compositing nodes.

        :param context:
        """

    @staticmethod
    def remove_socket(tree, socket) -> None:
        """

        :param tree:
        :param socket:
        """

    @classmethod
    def search_connected_viewer_sockets(
        cls, output_node, r_sockets, index=None
    ) -> None:
        """From an output node, recursively scan node tree for connected viewer sockets

        :param output_node:
        :param r_sockets:
        :param index:
        """

    @classmethod
    def search_viewer_sockets_in_tree(cls, tree, r_sockets) -> None:
        """Recursively get all viewer sockets in a node tree

        :param tree:
        :param r_sockets:
        """
