"""
Type stubs for SWIG-generated `marisa_bindings.marisa`.
Keep this file in sync with the public API surface of `marisa.py`.
"""

from typing import Final, overload

OK: Final[int]
STATE_ERROR: Final[int]
NULL_ERROR: Final[int]
BOUND_ERROR: Final[int]
RANGE_ERROR: Final[int]
CODE_ERROR: Final[int]
RESET_ERROR: Final[int]
SIZE_ERROR: Final[int]
MEMORY_ERROR: Final[int]
IO_ERROR: Final[int]
FORMAT_ERROR: Final[int]
MIN_NUM_TRIES: Final[int]
MAX_NUM_TRIES: Final[int]
DEFAULT_NUM_TRIES: Final[int]
HUGE_CACHE: Final[int]
LARGE_CACHE: Final[int]
NORMAL_CACHE: Final[int]
SMALL_CACHE: Final[int]
TINY_CACHE: Final[int]
DEFAULT_CACHE: Final[int]
TEXT_TAIL: Final[int]
BINARY_TAIL: Final[int]
DEFAULT_TAIL: Final[int]
LABEL_ORDER: Final[int]
WEIGHT_ORDER: Final[int]
DEFAULT_ORDER: Final[int]

class Key:
    """
    A key returned by MARISA operations.

    Notes
    -----
    This is a SWIG proxy object. It is not intended to be constructed directly.
    """

    thisown: bool

    def str(self) -> str: ...
    def id(self) -> int: ...
    def weight(self) -> float: ...

class Query:
    """
    A query object associated with an Agent.

    Notes
    -----
    This is a SWIG proxy object. It is not intended to be constructed directly.
    """

    thisown: bool

    def str(self) -> str: ...
    def id(self) -> int: ...

class Keyset:
    """
    A set of strings used to build a Trie.
    """

    thisown: bool

    def __init__(self) -> None: ...
    @overload
    def push_back(self, key: str) -> None: ...
    @overload
    def push_back(self, key: str, weight: float) -> None: ...
    def key(self, i: int) -> Key: ...
    def key_str(self, i: int) -> str: ...
    def key_id(self, i: int) -> int: ...
    def num_keys(self) -> int: ...
    def empty(self) -> bool: ...
    def size(self) -> int: ...
    def total_length(self) -> int: ...
    def reset(self) -> None: ...
    def clear(self) -> None: ...

class Agent:
    """
    Search agent used for incremental search APIs.
    """

    thisown: bool

    def __init__(self) -> None: ...
    @overload
    def set_query(self, query: str) -> None: ...
    @overload
    def set_query(self, key_id: int) -> None: ...
    def key(self) -> Key: ...
    def query(self) -> Query: ...
    def key_str(self) -> str: ...
    def key_id(self) -> int: ...
    def query_str(self) -> str: ...
    def query_id(self) -> int: ...

class Trie:
    """
    MARISA Trie dictionary.
    """

    thisown: bool

    def __init__(self) -> None: ...
    def build(self, keyset: Keyset, config_flags: int = 0) -> None: ...
    def mmap(self, filename: str) -> None: ...
    def load(self, filename: str) -> None: ...
    def save(self, filename: str) -> None: ...
    def common_prefix_search(self, agent: Agent) -> bool: ...
    def predictive_search(self, agent: Agent) -> bool: ...
    @overload
    def lookup(self, agent: Agent) -> bool: ...
    @overload
    def lookup(self, query: str) -> int: ...
    def reverse_lookup(self, agent: Agent) -> bool: ...
    def num_tries(self) -> int: ...
    def num_keys(self) -> int: ...
    def num_nodes(self) -> int: ...
    def tail_mode(self) -> int: ...
    def node_order(self) -> int: ...
    def empty(self) -> bool: ...
    def size(self) -> int: ...
    def total_size(self) -> int: ...
    def io_size(self) -> int: ...
    def clear(self) -> None: ...

INVALID_KEY_ID: Final[int]
