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

from collections.abc import Callable
from collections.abc import Mapping
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Annotated
from typing import Union

from jinja2 import Environment
from jinja2 import Template

"""Primitives for generating meson rewrite commands."""
if TYPE_CHECKING:
    ...

@dataclass
class RewriteCommand:
    """Meson rewriter command input"""
    active: bool = ...
    type: str = ...
    target: str = ...
    operation: str = ...
    sources: list[str] = ...
    subdir: str = ...
    target_type: str = ...
    def add(self: RewriteCommand, mode: str, kind: str, source: str) -> dict[str, Union[str, list[str]]]:
        """Add sources and tests to an OZI project."""
    def rem(self: RewriteCommand, mode: str, kind: str, source: str) -> dict[str, Union[str, list[str]]]:
        """Add sources and tests to an OZI project."""

@dataclass
class Rewriter:
    """Container for Meson rewriter commands for OZI projects."""
    target: str
    name: str
    fix: str
    env: Environment
    commands: list[dict[str, str]] = ...
    path_map: Mapping[str, Callable[[str], Path]] = {}
    base_templates: dict[Annotated[str, 'fix'], Annotated[Template, 'base_template']] = {}
    def __post_init__(self: Rewriter) -> None:
        """Setup the path_map"""
    def __iadd__(self: Rewriter, other: list[str]) -> Rewriter:
        """Add a list of paths"""
    def __isub__(self: Rewriter, other: list[str]) -> Rewriter:
        """Remove a list of paths"""
