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

from functools import lru_cache

from prompt_toolkit.document import Document
from prompt_toolkit.validation import ThreadedValidator
from prompt_toolkit.validation import Validator

"""Validators for interactive prompts."""

@lru_cache
def pypi_package_exists(package: str) -> bool:
    """Check if a package name exists on PyPI."""

class ProjectNameValidator(Validator):
    """Validate that a package name is valid."""

    def validate(self, document: Document) -> None: ...

class NotReservedValidator(ThreadedValidator):
    """Validate that a package name is available."""

    def validate(self, document: Document) -> None: ...

class LengthValidator(Validator):
    """Validate text is between 1 and 512 chartacters in length."""

    def validate(self, document: Document) -> None: ...

class PackageValidator(Validator):
    """Validate a package name exists on PyPI."""

    def validate(self, document: Document) -> None: ...

def validate_message(text: str, validator: Validator) -> tuple[bool, str]:
    """Validate a string.

    :param text: string to validate
    :type text: str
    :param validator: validator instance
    :type validator: Validator
    :return: validation, error message
    :rtype: tuple[bool, str]
    """
