"""
This type stub file was generated by pyright.
"""

from typing import List, Optional, TYPE_CHECKING
from nats.js import api
from nats import NATS

if TYPE_CHECKING:
    ...
NATS_HDR_LINE = ...
NATS_HDR_LINE_SIZE = ...
_CRLF_ = ...
_CRLF_LEN_ = ...
class JetStreamManager:
    """
    JetStreamManager exposes management APIs for JetStream.
    """
    def __init__(self, conn: NATS, prefix: str = ..., timeout: float = ...) -> None:
        ...
    
    async def account_info(self) -> api.AccountInfo:
        ...
    
    async def find_stream_name_by_subject(self, subject: str) -> str:
        """
        Find the stream to which a subject belongs in an account.
        """
        ...
    
    async def stream_info(self, name: str, subjects_filter: Optional[str] = ...) -> api.StreamInfo:
        """
        Get the latest StreamInfo by stream name.
        """
        ...
    
    async def add_stream(self, config: Optional[api.StreamConfig] = ..., **params) -> api.StreamInfo:
        """
        add_stream creates a stream.
        """
        ...
    
    async def update_stream(self, config: Optional[api.StreamConfig] = ..., **params) -> api.StreamInfo:
        """
        update_stream updates a stream.
        """
        ...
    
    async def delete_stream(self, name: str) -> bool:
        """
        Delete a stream by name.
        """
        ...
    
    async def purge_stream(self, name: str, seq: Optional[int] = ..., subject: Optional[str] = ..., keep: Optional[int] = ...) -> bool:
        """
        Purge a stream by name.
        """
        ...
    
    async def consumer_info(self, stream: str, consumer: str, timeout: Optional[float] = ...): # -> ConsumerInfo:
        ...
    
    async def streams_info(self) -> List[api.StreamInfo]:
        """
        streams_info retrieves a list of streams.
        """
        ...
    
    async def add_consumer(self, stream: str, config: Optional[api.ConsumerConfig] = ..., timeout: Optional[float] = ..., **params) -> api.ConsumerInfo:
        ...
    
    async def delete_consumer(self, stream: str, consumer: str) -> bool:
        ...
    
    async def consumers_info(self, stream: str, offset: Optional[int] = ...) -> List[api.ConsumerInfo]:
        """
        consumers_info retrieves a list of consumers. Consumers list limit is 256 for more
        consider to use offset
        :param stream: stream to get consumers
        :param offset: consumers list offset
        """
        ...
    
    async def get_msg(self, stream_name: str, seq: Optional[int] = ..., subject: Optional[str] = ..., direct: Optional[bool] = ..., next: Optional[bool] = ...) -> api.RawStreamMsg:
        """
        get_msg retrieves a message from a stream.
        """
        ...
    
    async def delete_msg(self, stream_name: str, seq: int) -> bool:
        """
        delete_msg retrieves a message from a stream based on the sequence ID.
        """
        ...
    
    async def get_last_msg(self, stream_name: str, subject: str, direct: Optional[bool] = ...) -> api.RawStreamMsg:
        """
        get_last_msg retrieves the last message from a stream.
        """
        ...
    


