mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-03 15:11:30 +00:00
21 lines
578 B
Python
21 lines
578 B
Python
![]() |
from __future__ import annotations
|
||
|
|
||
|
from os import PathLike
|
||
|
from typing import Protocol, TypeVar
|
||
|
|
||
|
from typing_extensions import TypeAlias
|
||
|
|
||
|
AnyStr_cov = TypeVar("AnyStr_cov", str, bytes, covariant=True)
|
||
|
FilePath: TypeAlias = str | PathLike[str]
|
||
|
S1 = TypeVar("S1")
|
||
|
|
||
|
class BaseBuffer(Protocol):
|
||
|
@property
|
||
|
def mode(self) -> str: ...
|
||
|
def seek(self, __offset: int, __whence: int = ...) -> int: ...
|
||
|
def seekable(self) -> bool: ...
|
||
|
def tell(self) -> int: ...
|
||
|
|
||
|
class ReadBuffer(BaseBuffer, Protocol[AnyStr_cov]):
|
||
|
def read(self, __n: int = ...) -> AnyStr_cov: ...
|