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

"""Common interface for third-party applications."""

import typing
from .datalore import *
from .ibm_watson import *
from .pycharm import *
from .vscode import *

if typing.TYPE_CHECKING:
    import typing_extensions
    from anaconda_navigator.config import user as user_config
    from anaconda_navigator.api import process
    from .base import *

    class InstallableAppInitializer(typing_extensions.Protocol):  # pylint: disable=too-few-public-methods
        """Common interface for installable apps initializer."""

        def __call__(
                self,
                config: user_config.UserConfig,
                process_api: process.WorkerManager,
        ) -> BaseInstallableApp:
            """Initialize new installable app."""

    class WebAppInitializer(typing_extensions.Protocol):  # pylint: disable=too-few-public-methods
        """Common interface for web apps initializer."""

        def __call__(
                self,
                config: user_config.UserConfig,
        ) -> BaseWebApp:
            """Initialize new web app."""


apps: 'typing_extensions.Final[typing.Mapping[str, InstallableAppInitializer]]' = {
    'pycharm_ce': PyCharmCEApp,
    'pycharm_pro': PyCharmProApp,
    'vscode': VSCodeApp,
}
web_apps: 'typing_extensions.Final[typing.Mapping[str, WebAppInitializer]]' = {
    'datalore': DataloreApp,
    'ibm_watson': IBMWatsonApp,
}
