import uuid as _uuid
from datetime import datetime
from typing import Any, Literal, overload

from lxml.etree import Element
from pykeepass.group import Group
from pykeepass.pykeepass import PyKeePass

class BaseElement:
    _element: Element
    _kp: PyKeePass | None

    def __init__(
        self,
        element: Element,
        kp: PyKeePass | None = ...,
        icon: str | None = ...,
        expires: bool = ...,
        expiry_time: datetime | None = ...,
    ) -> None: ...
    @overload
    def _xpath(
        self,
        xpath: str,
        *,
        first: Literal[True],
        cast: bool = ...,
        **kwargs: Any,
    ) -> Element | None: ...
    @overload
    def _xpath(
        self,
        xpath: str,
        *,
        first: Literal[False] = ...,
        cast: bool = ...,
        **kwargs: Any,
    ) -> list[Element]: ...
    def _xpath(self, xpath: str, **kwargs: Any) -> list[Element] | Element | None: ...
    def _get_subelement_text(self, tag: str) -> str | None: ...
    def _set_subelement_text(self, tag: str, value: str) -> None: ...
    @property
    def group(self) -> Group | None: ...
    @property
    def parentgroup(self) -> Group | None: ...
    def dump_xml(self, pretty_print: bool = ...) -> bytes: ...
    @property
    def uuid(self) -> _uuid.UUID: ...
    @uuid.setter
    def uuid(self, uuid: _uuid.UUID) -> None: ...
    @property
    def icon(self) -> str | None: ...
    @icon.setter
    def icon(self, value: str | None) -> None: ...
    @property
    def _path(self) -> str: ...
    def _get_times_property(self, prop: str) -> datetime | None: ...
    def _set_times_property(self, prop: str, value: datetime) -> None: ...
    @property
    def expires(self) -> bool: ...
    @expires.setter
    def expires(self, value: bool) -> None: ...
    @property
    def expired(self) -> bool: ...
    @property
    def expiry_time(self) -> datetime | None: ...
    @expiry_time.setter
    def expiry_time(self, value: datetime) -> None: ...
    @property
    def ctime(self) -> datetime | None: ...
    @ctime.setter
    def ctime(self, value: datetime) -> None: ...
    @property
    def atime(self) -> datetime | None: ...
    @atime.setter
    def atime(self, value: datetime) -> None: ...
    @property
    def mtime(self) -> datetime | None: ...
    @mtime.setter
    def mtime(self, value: datetime) -> None: ...
    def delete(self) -> None: ...
    def __unicode__(self) -> str: ...
    def __repr__(self) -> str: ...
    def __hash__(self) -> int: ...
    def __eq__(self, other: object) -> bool: ...
    def touch(self, modify: bool = ...) -> None: ...
