/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; import * as azdata from 'azdata'; /** * The API provided by this extension. * * @export */ export interface IExtensionApi { getJupyterController(): IJupyterController; registerPackageManager(providerId: string, packageManagerProvider: IPackageManageProvider): void getPackageManagers(): Map } export interface IJupyterController { jupyterInstallation: IJupyterServerInstallation; } export interface IJupyterServerInstallation { installPipPackages(packages: IPackageDetails[], useMinVersion: boolean): Promise; uninstallPipPackages(packages: IPackageDetails[]): Promise; installCondaPackages(packages: IPackageDetails[], useMinVersion: boolean): Promise; uninstallCondaPackages(packages: IPackageDetails[]): Promise; getInstalledPipPackages(): Promise; pythonExecutable: string; pythonInstallationPath: string; executeBufferedCommand(command: string): Promise; executeStreamedCommand(command: string): Promise; installPythonPackage(backgroundOperation: azdata.BackgroundOperation, usingExistingPython: boolean, pythonInstallationPath: string, outputChannel: vscode.OutputChannel): Promise; } export interface IPackageDetails { name: string; version: string; readonly?: boolean; } export interface IPackageTarget { location: string; packageType: string; } export interface IPackageOverview { name: string; versions: string[]; summary: string; } export interface IPackageLocation { name: string; displayName: string; } /** * Package manage provider interface */ export interface IPackageManageProvider { /** * Provider id */ providerId: string; /** * package target */ packageTarget: IPackageTarget; /** * Returns list of installed packages */ listPackages(location?: string): Promise; /** * Installs give packages * @param package Packages to install * @param useMinVersion if true, minimal version will be used */ installPackages(package: IPackageDetails[], useMinVersion: boolean, location?: string): Promise; /** * Uninstalls given packages * @param package package to uninstall */ uninstallPackages(package: IPackageDetails[], location?: string): Promise; /** * Returns true if the provider can be used in current context */ canUseProvider(): Promise; /** * Returns location title */ getLocations(): Promise; /** * Get the current location */ getCurrentLocation(): Promise; /** * Returns Package Overview * @param packageName package name */ getPackageOverview(packageName: string): Promise; }