from typing import Any

class Rope:
    @property
    def text(self) -> str: ...
    @staticmethod
    def from_str(self, s: str) -> Rope: ...
    @staticmethod
    def from_reader(self, reader: Any) -> None: ...
    @staticmethod
    def from_file(self, f: str) -> Rope: ...
    def write_to(self, _writer: Any) -> None: ...
    def write_to_file(self, f: str) -> None: ...
    def len_bytes(self) -> int: ...
    def len_chars(self) -> int: ...
    def len_lines(self) -> int: ...
    def len_utf16_cu(self) -> int: ...
    def capacity(self) -> int: ...
    def shrink_to_fit(self) -> None: ...
    def insert(self, char_idx: int, text: str) -> None: ...
    def insert_char(self, char_idx: int, ch: str) -> None: ...
    def remove_range(self, char_start: int, char_end: int) -> None: ...
    def remove_range_from(self, char_start: int) -> None: ...
    def remove_range_to(self, char_end: int) -> None: ...
    def remove_range_full(self) -> None: ...
    def remove(self, char_range: slice) -> None: ...
    def split_off(self, char_idx: int) -> Rope: ...
    def append(self, other: Rope) -> None: ...

class RopeBuilder:
    def append(self, chunk: str) -> None: ...
    def finish(self) -> Rope: ...
