"""
This type stub file was generated by pyright.
"""

from abc import ABC, abstractmethod
from typing import Any, TYPE_CHECKING
from streamlit.errors import StreamlitAPIException
from streamlit.runtime.state.common import WidgetCallback

if TYPE_CHECKING:
    ...
class MarshallComponentException(StreamlitAPIException):
    """Class for exceptions generated during custom component marshalling."""
    ...


class BaseCustomComponent(ABC):
    """Interface for CustomComponents."""
    def __init__(self, name: str, path: str | None = ..., url: str | None = ..., module_name: str | None = ...) -> None:
        ...
    
    def __repr__(self) -> str:
        ...
    
    def __call__(self, *args, default: Any = ..., key: str | None = ..., on_change: WidgetCallback | None = ..., tab_index: int | None = ..., **kwargs) -> Any:
        """An alias for create_instance."""
        ...
    
    @property
    def abspath(self) -> str | None:
        ...
    
    @property
    def module_name(self) -> str | None:
        ...
    
    @property
    def name(self) -> str:
        ...
    
    @property
    def path(self) -> str | None:
        ...
    
    @property
    def url(self) -> str | None:
        ...
    
    def __str__(self) -> str:
        ...
    
    @abstractmethod
    def __eq__(self, other) -> bool:
        """Equality operator."""
        ...
    
    @abstractmethod
    def __ne__(self, other) -> bool:
        """Inequality operator."""
        ...
    
    @abstractmethod
    def create_instance(self, *args, default: Any = ..., key: str | None = ..., on_change: WidgetCallback | None = ..., tab_index: int | None = ..., **kwargs) -> Any:
        """Create a new instance of the component.

        Parameters
        ----------
        *args
            Must be empty; all args must be named. (This parameter exists to
            enforce correct use of the function.)
        default: any or None
            The default return value for the component. This is returned when
            the component's frontend hasn't yet specified a value with
            `setComponentValue`.
        key: str or None
            If not None, this is the user key we use to generate the
            component's "widget ID".
        on_change: WidgetCallback or None
            An optional callback invoked when the widget's value changes. No arguments are passed to it.
        tab_index: int or None
            Specifies the tab order of the iframe containing the component.
            Possible values are:
            - ``None`` (default): Browser default behavior.
            - ``-1``: Removes the iframe from the natural tab order, but it can still be focused programmatically.
            - ``0`` or positive integer: Includes the iframe in the natural tab order.
        **kwargs
            Keyword args to pass to the component.

        Raises
        ------
        MarshallComponentException
            Raised when args is not empty or component cannot be marshalled.
        StreamlitAPIException
            Raised when PyArrow is not installed.

        Returns
        -------
        any or None
            The component's widget value.

        """
        ...
    


