from enum import Enum
from typing import Any, Optional, final
from datetime import datetime

__all__: list[str] = [
    "CompatFlag",
    "Config",
    "Inventory",
    "NodeInfo",
    "NodeInfoMeta",
    "Reclass",
    "buildinfo",
]

@final
class CompatFlag(Enum):
    ComposeNodeNameLiteralDots = "ComposeNodeNameLiteralDots"

@final
class Config:
    @property
    def class_mappings(self) -> list[str]: ...
    @property
    def class_mappings_match_path(self) -> bool: ...
    @property
    def classes_path(self) -> str: ...
    @property
    def compatflags(self) -> set[CompatFlag]: ...
    @property
    def compose_node_name(self) -> bool: ...
    @classmethod
    def from_dict(
        cls, inventory_path: str, config: dict[str, Any], verbose: bool = False
    ) -> Config: ...
    @property
    def ignore_class_notfound(self) -> bool: ...
    @property
    def ignore_class_notfound_regexp(self) -> list[str]: ...
    @property
    def ignore_overwritten_missing_references(self) -> bool: ...
    @property
    def inventory_path(self) -> str: ...
    @property
    def nodes_path(self) -> str: ...
    @property
    def verbose_warnings(self) -> bool: ...

@final
class NodeInfoMeta:
    @property
    def environment(self) -> str: ...
    @property
    def name(self) -> str: ...
    @property
    def node(self) -> str: ...
    @property
    def render_time(self) -> datetime: ...
    @property
    def uri(self) -> str: ...

@final
class NodeInfo:
    @property
    def __reclass__(self) -> NodeInfoMeta: ...
    @property
    def applications(self) -> list[str]: ...
    def as_dict(self) -> dict[str, Any]: ...
    @property
    def classes(self) -> list[str]: ...
    @property
    def exports(self) -> dict[str, Any]: ...
    @property
    def parameters(self) -> dict[str, Any]: ...
    def reclass_as_dict(self) -> dict[str, Any]: ...

@final
class Inventory:
    @property
    def applications(self) -> dict[str, list[str]]: ...
    def as_dict(self) -> dict[str, Any]: ...
    @property
    def classes(self) -> dict[str, list[str]]: ...
    @property
    def nodes(self) -> dict[str, NodeInfo]: ...

@final
class Reclass:
    @property
    def config(self) -> Config: ...
    def __new__(
        cls,
        inventory_path: Optional[str] = ".",
        nodes_path: Optional[str] = None,
        classes_path: Optional[str] = None,
        ignore_class_notfound: Optional[bool] = None,
    ): ...
    @classmethod
    def from_config_file(
        cls, inventory_path: str, config_file: str, verbose: bool = False
    ) -> Reclass: ...
    @classmethod
    def from_config(cls, config: Config) -> Reclass: ...
    def nodeinfo(self, nodename: str) -> NodeInfo: ...
    def inventory(self) -> Inventory: ...
    @classmethod
    def set_thread_count(cls, count: int): ...
    def set_compat_flag(self, flag: CompatFlag): ...
    def unset_compat_flag(self, flag: CompatFlag): ...
    def clear_compat_flags(self): ...
    @property
    def nodes(self) -> dict[str, str]: ...
    @property
    def classes(self) -> dict[str, str]: ...
    def set_ignore_class_notfound_regexp(self, patterns: list[str]): ...

def buildinfo() -> dict[str, str]: ...
