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

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

import typing
from .datalore import *  # noqa: F403
from .ibm_watson import *  # noqa: F403
from .pycharm import *  # noqa: F403
from .vscode import *  # noqa: F403

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 *  # noqa: F403

    class InstallableAppInitializer(typing_extensions.Protocol):
        """Common interface for installable apps initializer."""

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

    class WebAppInitializer(typing_extensions.Protocol):
        """Common interface for web apps initializer."""

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


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