from typing import Optional, Tuple, Union, List, Literal



class Hierarchy:
    def all_vars(self) -> VarIter: ...
    def top_scopes(self) -> ScopeIter: ...
    def date(self) -> str: ...
    def version(self) -> str: ...
    def timescale(self) -> Optional[Timescale]: ...
    def file_format(self) -> Literal["VCD", "FST", "GHW", "Unknown"]: ...

class Scope:
    def name(self, hier: Hierarchy) -> str: ...
    def full_name(self, hier: Hierarchy) -> str: ...
    def scope_type(self) -> Literal[
        "module", "task", "function", "begin", "fork", "generate", "struct", "union", 
        "class", "interface", "package", "program", "vhdl_architecture", "vhdl_procedure", 
        "vhdl_function", "vhdl_record", "vhdl_process", "vhdl_block", "vhdl_for_generate", 
        "vhdl_if_generate", "vhdl_generate", "vhdl_package", "ghw_generic", "vhdl_array", 
        "unknown"
    ]: ...
    def vars(self, hier: Hierarchy) -> VarIter: ...
    def scopes(self, hier: Hierarchy) -> ScopeIter: ...

class ScopeIter:
    def __iter__(self) -> ScopeIter: ...
    def __next__(self) -> Scope: ...

class Var:
    def name(self, hier: Hierarchy) -> str: ...
    def full_name(self, hier: Hierarchy) -> str: ...
    def bitwidth(self) -> Optional[int]: ...
    def var_type(self) -> Literal[
        "Event", "Integer", "Parameter", "Real", "Reg", "Supply0", "Supply1", "Time", 
        "Tri", "TriAnd", "TriOr", "TriReg", "Tri0", "Tri1", "WAnd", "Wire", "WOr", 
        "String", "Port", "SparseArray", "RealTime", "Bit", "Logic", "Int", "ShortInt", 
        "LongInt", "Byte", "Enum", "ShortReal", "Boolean", "BitVector", "StdLogic", 
        "StdLogicVector", "StdULogic", "StdULogicVector"
    ]: ...
    def enum_type(self, hier: Hierarchy) -> Optional[Tuple[str, List[Tuple[str, str]]]]: ...
    def vhdl_type_name(self, hier: Hierarchy) -> Optional[str]: ...
    def direction(self) -> Literal["Unknown", "Implicit", "Input", "Output", "InOut", "Buffer", "Linkage"]: ...
    def length(self) -> Optional[int]: ...
    def is_real(self) -> bool: ...
    def is_string(self) -> bool: ...
    def is_bit_vector(self) -> bool: ...
    def is_1bit(self) -> bool: ...

class VarIter:
    def __iter__(self) -> VarIter: ...
    def __next__(self) -> Var: ...

class TimeTable:
    def __getitem__(self, idx: int) -> int: ...

class Waveform:
    hierarchy: Hierarchy
    time_table: TimeTable

    def __init__(
        self,
        path: str,
        multi_threaded: bool = True,
        remove_scopes_with_empty_name: bool = False,
    ) -> None: ...
    def get_signal(self, var: Var) -> Signal: ...
    def get_signal_from_path(self, abs_hierarchy_path: str) -> Signal: ...

class Signal:
    def value_at_time(self, time: int) -> Union[int, str]: ...
    def value_at_idx(self, idx: int) -> Union[int, str]: ...
    def all_changes(self) -> SignalChangeIter: ...

class SignalChangeIter:
    def __iter__(self) -> SignalChangeIter: ...
    def __next__(self) -> Tuple[int, str]: ...


class TimescaleUnit:
    def __str__(self) -> Literal["zs", "as", "fs", "ps", "ns", "us", "ms", "s", "unknown"]: ...
    def __repr__(self) -> str: ...
    def to_exponent(self) -> Optional[int]: ...

class Timescale:
    factor: int
    unit: TimescaleUnit
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
