mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-06-27 02:30:08 +00:00

**Summary** Mechanical refactoring in preparation for adding (pre-chunk) `TableSplitter` in a PR stacked on this one.
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: ...
|