from enum import Enum, auto

import typing as t
import typing_extensions as tx

from .noise_protocol import NoiseProtocol

T = t.TypeVar("T")

class NoiseConnection:
    noise_protocol: NoiseProtocol

    @classmethod
    def from_name(cls, name: bytes) -> tx.Self: ...

    def set_as_initiator(self) -> None: ...
    def set_keypair_from_private_bytes(self, keypair: Keypair, private_bytes: bytes) -> None: ...
    def set_prologue(self, prologue: bytes) -> None: ...
    def start_handshake(self) -> None: ...
    def write_message(self, payload: bytes) -> bytes: ...
    def read_message(self, payload: bytes) -> bytes: ...
    def get_handshake_hash(self) -> bytes: ...
    def decrypt(self, data: bytes) -> bytes: ...
    def encrypt(self, data: bytes) -> bytes: ...


class Keypair(Enum):
    EPHEMERAL = auto()
    STATIC = auto()
