import builtins
from typing import Any

from ton_core.boc.cell import Cell
from ton_core.boc.slice import Slice
from ton_core.tlb.tlb import TlbError, TlbScheme

class VmCellSlice(TlbScheme):
    @classmethod
    def serialize(cls, value: Slice) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> Slice: ...

class VmCont(TlbScheme):
    type_: str
    def __init__(self, type_: str, **kwargs: object) -> None: ...
    @classmethod
    def serialize(cls, value: VmCont) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> VmCont: ...

class VmControlData(TlbScheme):
    type_: str
    def __init__(self, type_: str, **kwargs: object) -> None: ...
    @classmethod
    def serialize(cls, value: VmControlData) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> VmControlData: ...

class VmError(TlbError): ...

class VmSaveList(TlbScheme):
    @classmethod
    def serialize(cls, value: Any) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> dict[Any, Any] | None: ...

class VmStack(TlbScheme):
    @classmethod
    def serialize(cls, data: builtins.list[Any]) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> builtins.list[Any]: ...

class VmStackList(TlbScheme):
    @classmethod
    def serialize(cls, data: builtins.list[Any]) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice, n_p_1: int) -> builtins.list[Any]: ...

class VmStackValue(TlbScheme):
    @classmethod
    def serialize(cls, value: Any) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice) -> Any: ...

class VmTuple(TlbScheme):
    list: builtins.list[Any]
    def __init__(self, list_: builtins.list[Any]) -> None: ...
    def __add__(self, other: VmTuple) -> None: ...
    def __call__(self, index: int) -> Any: ...
    def __getitem__(self, index: int) -> Any: ...
    def __len__(self) -> int: ...
    def append(self, item: Any) -> VmTuple: ...
    def pop(self, index: int = ...) -> Any: ...
    @classmethod
    def serialize(cls, values: VmTuple) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice, length: int) -> VmTuple: ...

class VmTupleRef(TlbScheme):
    @classmethod
    def serialize(cls, values: VmTuple) -> Cell: ...
    @classmethod
    def deserialize(cls, cell_slice: Slice, length: int) -> VmTuple: ...
