from typing import Iterable

from pyarrow.lib import MemoryPool, _Weakrefable

from .array import StringArray, StringViewArray

class StringBuilder(_Weakrefable):
    def __init__(self, memory_pool: MemoryPool | None = None) -> None: ...
    def append(self, value: str | bytes | None): ...
    def append_values(self, values: Iterable[str | bytes | None]): ...
    def finish(self) -> StringArray: ...
    @property
    def null_count(self) -> int: ...
    def __len__(self) -> int: ...

class StringViewBuilder(_Weakrefable):
    def __init__(self, memory_pool: MemoryPool | None = None) -> None: ...
    def append(self, value: str | bytes | None): ...
    def append_values(self, values: Iterable[str | bytes | None]): ...
    def finish(self) -> StringViewArray: ...
    @property
    def null_count(self) -> int: ...
    def __len__(self) -> int: ...

__all__ = ["StringBuilder", "StringViewBuilder"]
