import os
from collections.abc import Generator, Iterator
from io import BufferedIOBase
from pydicom.config import logger as logger, settings as settings
from pydicom.datadict import dictionary_description as dictionary_description
from pydicom.filebase import ReadableBuffer as ReadableBuffer, WriteableBuffer as WriteableBuffer
from pydicom.misc import size_in_bytes as size_in_bytes
from pydicom.tag import BaseTag as BaseTag, ItemTag as ItemTag, SequenceDelimiterTag as SequenceDelimiterTag, Tag as Tag, TupleTag as TupleTag
from typing import BinaryIO

PathType = str | bytes | os.PathLike

def absorb_delimiter_item(fp: BinaryIO, is_little_endian: bool, delimiter: BaseTag) -> None: ...
def find_bytes(fp: BinaryIO, bytes_to_find: bytes, read_size: int = 128, rewind: bool = True) -> int | None: ...
def read_undefined_length_value(fp: BinaryIO, is_little_endian: bool, delimiter_tag: BaseTag, defer_size: int | float | None = None, read_size: int = ...) -> bytes | None: ...
def find_delimiter(fp: BinaryIO, delimiter: BaseTag, is_little_endian: bool, read_size: int = 128, rewind: bool = True) -> int | None: ...
def length_of_undefined_length(fp: BinaryIO, delimiter: BaseTag, is_little_endian: bool, read_size: int = 128, rewind: bool = True) -> int | None: ...
def path_from_pathlike(file_object: PathType | BinaryIO | ReadableBuffer | WriteableBuffer) -> str | BinaryIO: ...
def check_buffer(buffer: BufferedIOBase) -> None: ...
def reset_buffer_position(buffer: BufferedIOBase) -> Generator[int, None, None]: ...
def read_buffer(buffer: BufferedIOBase, *, chunk_size: int | None = None) -> Iterator[bytes]: ...
def buffer_length(buffer: BufferedIOBase) -> int: ...
def buffer_remaining(buffer: BufferedIOBase) -> int: ...
def buffer_equality(buffer: BufferedIOBase, other: bytes | bytearray | BufferedIOBase) -> bool: ...
