from typing import Any

from .builder import Builder
from .cell import Cell
from .slice import Slice
from .tvm_bitarray import TvmBitarray

SERIALIZED_BOC_IDX_CRC32C: bytes
SERIALIZED_BOC_IDX_PREFIX: bytes
SERIALIZED_BOC_PREFIX: bytes

class BocError(Exception): ...

class NullCell:
    bits: TvmBitarray
    refs: list[Any]
    type_: int
    def __init__(self, bits: TvmBitarray, refs: list[Any], type_: int) -> None: ...
    def to_cell(self) -> Cell: ...
    def to_slice(self) -> Slice: ...
    def to_builder(self) -> Builder: ...
    def copy(self) -> NullCell: ...
    def __repr__(self) -> str: ...
    def __str__(self, t: int = ..., comma: bool = ...) -> str: ...

class Boc:
    data: bytes
    data_len: int
    def __init__(self, data: bytes | str) -> None: ...
    @classmethod
    def from_base64(cls, data: str) -> Boc: ...
    @classmethod
    def from_hex(cls, data: str) -> Boc: ...
    def parse(self) -> None: ...
    @staticmethod
    def deserialize_boc_header(data: bytes) -> dict[str, Any]: ...
    @staticmethod
    def deserialize_cell(data: bytes, ref_index_size: int) -> tuple[dict[str, Any], int]: ...
    def deserialize(self, cls: type | None = ...) -> list[Any]: ...
