from collections.abc import Iterator
from typing import IO, Any, AnyStr, Generic

from django.utils._os import _PathCompatible

def validate_file_name(name: _PathCompatible, allow_relative_path: bool = False) -> _PathCompatible: ...

class FileProxyMixin(Generic[AnyStr]):
    file: IO[AnyStr] | None
    @property
    def encoding(self) -> Any: ...
    @property
    def fileno(self) -> Any: ...
    @property
    def flush(self) -> Any: ...
    @property
    def isatty(self) -> Any: ...
    @property
    def newlines(self) -> Any: ...
    @property
    def read(self) -> Any: ...
    @property
    def readinto(self) -> Any: ...
    @property
    def readline(self) -> Any: ...
    @property
    def readlines(self) -> Any: ...
    @property
    def seek(self) -> Any: ...
    @property
    def tell(self) -> Any: ...
    @property
    def truncate(self) -> Any: ...
    @property
    def write(self) -> Any: ...
    @property
    def writelines(self) -> Any: ...
    @property
    def closed(self) -> bool: ...
    def readable(self) -> bool: ...
    def writable(self) -> bool: ...
    def seekable(self) -> bool: ...
    def __iter__(self) -> Iterator[AnyStr]: ...
