"""Type stubs for the Rust extension module ewal._core."""

from typing import Any, Optional


class PyTrace:
    @staticmethod
    def from_vcd(path: str) -> "PyTrace": ...
    @staticmethod
    def from_vcd_string(data: str) -> "PyTrace": ...
    def signal_names(self) -> list[str]: ...
    def scopes(self) -> list[str]: ...
    def max_index(self) -> int: ...
    def timestamp(self, index: int) -> int: ...
    def signal_value(self, name: str, index: int) -> Any: ...
    def signal_value_raw(self, name: str, index: int) -> int: ...
    def signal_width(self, name: str) -> int: ...
    def signal_id(self, name: str) -> Optional[int]: ...
    def signal_values_range(self, name: str, start: int, end: int) -> list: ...
    def resolve(self, scope: str, short_name: str) -> Optional[str]: ...
    def local_signals(self, scope: str) -> list[str]: ...
    def local_scopes(self, scope: str) -> list[str]: ...
    def find(self, expr: "PyExpr") -> list[int]: ...
    def eval_expr(self, expr: "PyExpr", index: int) -> Any: ...
    def eval_expr_bool(self, expr: "PyExpr", index: int) -> bool: ...
    def bit_slice_val(self, val: int, high: int, low: int) -> int: ...
    def sign_extend_val(self, val: int, width: int) -> int: ...


class PyExpr:
    @staticmethod
    def signal(id: int) -> "PyExpr": ...
    @staticmethod
    def const_int(val: int) -> "PyExpr": ...
    @staticmethod
    def const_float(val: float) -> "PyExpr": ...
    @staticmethod
    def const_str(val: str) -> "PyExpr": ...
    @staticmethod
    def always_true() -> "PyExpr": ...
    def rel_eval(self, offset: int) -> "PyExpr": ...
    def not_(self) -> "PyExpr": ...
    def and_(self, other: "PyExpr") -> "PyExpr": ...
    def or_(self, other: "PyExpr") -> "PyExpr": ...
    def eq_(self, other: "PyExpr") -> "PyExpr": ...
    def neq(self, other: "PyExpr") -> "PyExpr": ...
    def gt_(self, other: "PyExpr") -> "PyExpr": ...
    def lt_(self, other: "PyExpr") -> "PyExpr": ...
    def gte(self, other: "PyExpr") -> "PyExpr": ...
    def lte(self, other: "PyExpr") -> "PyExpr": ...
    def add(self, other: "PyExpr") -> "PyExpr": ...
    def sub(self, other: "PyExpr") -> "PyExpr": ...
    def bit_and(self, other: "PyExpr") -> "PyExpr": ...
    def bit_or(self, other: "PyExpr") -> "PyExpr": ...
    def bit_xor(self, other: "PyExpr") -> "PyExpr": ...
    def slice(self, high: int, low: int) -> "PyExpr": ...
    def signed(self) -> "PyExpr": ...
