from typing import Generator, Iterable

class FMIndex:
    def __init__(self, data: str) -> FMIndex: ...
    def __len__(self) -> int: ...
    def __contains__(self, pattern: str) -> bool: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    def __copy__(self) -> FMIndex: ...
    def __deepcopy__(self, memo) -> FMIndex: ...
    def __reduce__(self) -> tuple[type[FMIndex], tuple[str], bytes]: ...
    def __getstate__(self) -> bytes: ...
    def __setstate__(self, state: bytes) -> None: ...
    def item(self) -> str: ...
    def contains(self, pattern: str) -> bool: ...
    def count(self, pattern: str) -> int: ...
    def locate(self, pattern: str) -> list[int]: ...
    def iter_locate(self, pattern: str) -> Generator[int, None, None]: ...
    def startswith(self, prefix: str) -> bool: ...
    def endswith(self, suffix: str) -> bool: ...

class MultiFMIndex:
    def __init__(self, data: Iterable[str]) -> MultiFMIndex: ...
    def __len__(self) -> int: ...
    def __contains__(self, pattern: str) -> bool: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    def __copy__(self) -> MultiFMIndex: ...
    def __deepcopy__(self, memo) -> MultiFMIndex: ...
    def __reduce__(self) -> tuple[type[MultiFMIndex], tuple[list[str]], bytes]: ...
    def __getstate__(self) -> bytes: ...
    def __setstate__(self, state: bytes) -> None: ...
    def item(self) -> list[str]: ...
    def contains(self, pattern: str) -> bool: ...
    def count_all(self, pattern: str) -> int: ...
    def count(self, pattern: str, doc_id: int | None = None) -> dict[int, int] | int: ...
    def topk(self, pattern: str, k: int) -> list[tuple[int, int]]: ...
    def locate(
        self, pattern: str, doc_id: int | None = None
    ) -> dict[int, list[int]] | list[int]: ...
    def iter_locate(
        self, pattern: str, doc_id: int | None = None
    ) -> Generator[tuple[int, int], None, None]: ...
    def startswith(self, prefix: str) -> list[int]: ...
    def endswith(self, suffix: str) -> list[int]: ...
