import abc
import tree_sitter
from ..document import QTextDocumentEx as QTextDocumentEx, QTextEditChange as QTextEditChange
from ..qt import QColor as QColor, QFont as QFont, QObject as QObject, QTextBlock as QTextBlock, QTextCharFormat as QTextCharFormat, QTextLayout as QTextLayout, QTimer as QTimer
from ..textcursor import QTextDocumentCursor as QTextDocumentCursor
from .scheme import QCodeScheme as QCodeScheme
from _typeshed import Incomplete
from abc import abstractmethod
from typing import ByteString

class QSyntaxHighlighter(QObject, metaclass=abc.ABCMeta):
    HIGHLIGHT_BATCH_CHARACTERS: int
    HIGHLIGHT_BARCH_TIME_MS_INTERVAL: int
    def __init__(self, scheme: QCodeScheme, document: QTextDocumentEx) -> None: ...
    @property
    def syntaxTree(self) -> None: ...
    @abstractmethod
    def contentChanged(self, change: QTextEditChange): ...
    @abstractmethod
    def highlightBlock(self, blockText: str): ...
    def setEnabled(self, enable: bool): ...
    def isEnabled(self) -> bool: ...
    def scheme(self) -> QCodeScheme: ...
    def setScheme(self, scheme: QCodeScheme): ...
    def rehighlight(self) -> None: ...
    def rehighlightBlocks(self, from_: int, charsRemoved: int, charsAdded: int): ...
    def setFormat(self, start: int, count: int, colorOrFontOrFormat: QColor | QFont | QTextCharFormat): ...
    def currentBlock(self) -> QTextBlock: ...
    def destroy(self) -> None: ...

class QTreeSitterSyntaxHighlighter(QSyntaxHighlighter, metaclass=abc.ABCMeta):
    BLANK_PROG: Incomplete
    BLANK_ALPHA_FACTOR: float
    def __init__(self, parser: tree_sitter.Parser, scheme: QCodeScheme, document: QTextDocumentEx) -> None: ...
    @property
    def syntaxTree(self) -> tree_sitter.Tree | None: ...
    def contentChanged(self, change: QTextEditChange): ...
    def read(self, bytes: int, point: tree_sitter.Point) -> ByteString | None: ...

class PythonSyntaxHighlighter(QTreeSitterSyntaxHighlighter):
    kwlist: Incomplete
    builtinList: Incomplete
    def __init__(self, scheme: QCodeScheme, document: QTextDocumentEx) -> None: ...
    def highlightBlock(self, blockText: str): ...
