from __future__ import annotations

from typing import Protocol


class BrowserTextPort(Protocol):
    """DOM 조회/텍스트 추출"""

    async def count(self, selector: str) -> int: ...

    async def text_content_first(self, selector: str) -> str: ...
    async def all_texts(self, selector: str) -> list[str]: ...
    async def get_text_by_text(self, needle: str) -> str: ...

    async def inner_text(self, selector: str) -> str: ...
    async def outer_html_nth(self, selector: str, index: int) -> str: ...
