from __future__ import annotations

from typing import Optional

from .config import XmlgenConfig
from .de.main import generate_de
from .events.main import generate_event


def generate_de_xml(params: dict, data: dict, config: Optional[XmlgenConfig] = None) -> str:
    cfg = config or XmlgenConfig()
    return generate_de(params=params, data=data, config=cfg)


def generate_event_xml(event_id: int, params: dict, data: dict, event_type: str, config: Optional[XmlgenConfig] = None) -> str:
    cfg = config or XmlgenConfig()
    return generate_event(event_id=event_id, params=params, data=data, event_type=event_type, config=cfg)
