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

from abc import ABC, abstractmethod
from typing import Any, Protocol, override, runtime_checkable

@runtime_checkable
class Disposable(Protocol):
    def dispose(self) -> None:
        ...
    


class IDisposable(ABC):
    """
    Represents an object that can be disposed.
    """
    __disposed: bool = ...
    @abstractmethod
    def do_dispose(self) -> None:
        """
        Custom dispose logic should be implemented in subclasses.
        """
        ...
    
    def dispose(self) -> None:
        """
        Disposes of the object, setting its disposed state to True and calling the custom dispose logic.
        """
        ...
    
    @property
    def is_disposed(self) -> bool:
        """
        Returns whether the object has been disposed.
        """
        ...
    
    def __getattr__(self, name: str): # -> Any:
        """
        Checks if the object is disposed before accessing any attributes.
        """
        ...
    
    @override
    def __getattribute__(self, name: str): # -> Any:
        """
        Checks if the object is disposed before accessing any attributes.
        """
        ...
    
    @override
    def __setattr__(self, name: str, value: Any) -> None:
        """
        Checks if the object is disposed before setting any attributes.
        """
        ...
    
    def __call__(self, *args: Any, **kwargs: Any) -> Any:
        """
        Checks if the object is disposed before calling it.
        """
        ...
    
    @override
    def __str__(self) -> str:
        """
        Checks if the object is disposed before converting it to a string.
        """
        ...
    
    @override
    def __repr__(self) -> str:
        """
        Checks if the object is disposed before getting its representation.
        """
        ...
    
    def __del__(self) -> None:
        """
        Ensures dispose is called before garbage collection if not already done.
        """
        ...
    


