# -*- coding: utf-8 -*-

"""Collection of additional data types used by APIs."""

__all__ = ()

import typing


ApplicationName = str
Version = str

if typing.TYPE_CHECKING:
    import typing_extensions
    from anaconda_navigator.utils import constants

    class RawApplication(typing_extensions.TypedDict, total=False):
        """
        Application description from external services (conda).

        Transformed into :class:`~Application` in :mod:`~anaconda_navigator.api.anaconda_api`
        """

        versions: typing.Sequence[Version]
        size: typing.Mapping[Version, int]
        type: typing.Mapping[Version, typing_extensions.Literal['app']]
        app_entry: typing.Mapping[Version, str]
        app_type: typing.Mapping[Version, typing_extensions.Literal[None, 'desk', 'web']]
        latest_version: Version

        description: str

    class Application(typing_extensions.TypedDict, total=False):
        """
        Common description of a third-party application.

        Used for all home page tiles.
        """

        app_type: constants.AppType
        name: ApplicationName
        display_name: str
        description: str
        image_path: str

        versions: typing.Sequence[str]
        version: str

        non_conda: bool
        installed: bool
        command: str
        extra_arguments: typing.Sequence[typing.Any]
