"""
Type annotations for awscrt.cbor module.

Copyright 2025 Vlad Emelianov
"""

from enum import IntEnum
from typing import Any, Callable

from awscrt import NativeResource

class AwsCborType(IntEnum):
    Unknown = 0
    UnsignedInt = 1
    NegativeInt = 2
    Float = 3
    Bytes = 4
    Text = 5
    ArrayStart = 6
    MapStart = 7
    Tag = 8
    Bool = 9
    Null = 10
    Undefined = 11
    Break = 12
    IndefBytes = 13
    IndefStr = 14
    IndefArray = 15
    IndefMap = 16

class AwsCborEncoder(NativeResource):
    def __init__(self) -> None: ...
    def get_encoded_data(self) -> bytes: ...
    def reset(self) -> None: ...
    def write_int(self, val: int) -> None: ...
    def write_float(self, val: float) -> None: ...
    def write_bytes(self, val: bytes) -> None: ...
    def write_text(self, val: str) -> None: ...
    def write_array_start(self, number_entries: int) -> None: ...
    def write_map_start(self, number_entries: int) -> None: ...
    def write_tag(self, tag_number: int) -> None: ...
    def write_null(self) -> None: ...
    def write_undefined(self) -> None: ...
    def write_indef_array_start(self) -> None: ...
    def write_indef_map_start(self) -> None: ...
    def write_indef_bytes_start(self) -> None: ...
    def write_indef_text_start(self) -> None: ...
    def write_break(self) -> None: ...
    def write_bool(self, val: bool) -> None: ...
    def write_epoch_time(self, val: float) -> None: ...
    def write_list(self, val: list[Any]) -> None: ...
    def write_dict(self, val: dict[Any, Any]) -> None: ...
    def write_data_item(self, data_item: Any) -> None: ...

class AwsCborDecoder(NativeResource):
    def __init__(
        self, src: bytes, on_epoch_time: Callable[[float], Any] | None = ..., **kwargs: Any
    ) -> None: ...
    def _on_epoch_time_callback(self, epoch_secs: float) -> Any: ...
    def peek_next_type(self) -> AwsCborType: ...
    def get_remaining_bytes_len(self) -> int: ...
    def get_remaining_bytes(self) -> bytes: ...
    def reset_src(self, src: bytes) -> None: ...
    def consume_next_single_element(self) -> None: ...
    def consume_next_whole_data_item(self) -> None: ...
    def pop_next_unsigned_int(self) -> int: ...
    def pop_next_negative_int(self) -> int: ...
    def pop_next_double(self) -> float: ...
    def pop_next_bool(self) -> bool: ...
    def pop_next_bytes(self) -> bytes: ...
    def pop_next_text(self) -> str: ...
    def pop_next_array_start(self) -> int: ...
    def pop_next_map_start(self) -> int: ...
    def pop_next_tag_val(self) -> int: ...
    def pop_next_list(self) -> list[Any]: ...
    def pop_next_map(self) -> dict[Any, Any]: ...
    def pop_next_data_item(self) -> Any: ...
