import { ServiceIdentifier } from '../../instantiation/common/instantiation.js';
import { URI } from '../../../base/common/uri.js';
import { IExtensionManifest, ExtensionType, TargetPlatform } from '../../extensions/common/extensions.js';
import { InstallExtensionEvent, InstallExtensionResult, UninstallExtensionEvent, DidUninstallExtensionEvent, DidUpdateExtensionMetadata, ILocalExtension, IExtensionIdentifier, InstallOptions, IGalleryExtension, InstallExtensionInfo, UninstallOptions, IProductVersion, IExtensionsControlManifest, Metadata, InstallOperation, IExtensionManagementParticipant } from './extensionManagement.js';
import { Event } from '../../../base/common/event.js';

declare const IExtensionManagementService: ServiceIdentifier<IExtensionManagementService>;
interface IExtensionManagementService {
    readonly _serviceBrand: undefined;
    onInstallExtension: Event<InstallExtensionEvent>;
    onDidInstallExtensions: Event<readonly InstallExtensionResult[]>;
    onUninstallExtension: Event<UninstallExtensionEvent>;
    onDidUninstallExtension: Event<DidUninstallExtensionEvent>;
    onDidUpdateExtensionMetadata: Event<DidUpdateExtensionMetadata>;
    zip(extension: ILocalExtension): Promise<URI>;
    unzip(zipLocation: URI): Promise<IExtensionIdentifier>;
    getManifest(vsix: URI): Promise<IExtensionManifest>;
    install(vsix: URI, options?: InstallOptions): Promise<ILocalExtension>;
    canInstall(extension: IGalleryExtension): Promise<boolean>;
    installFromGallery(extension: IGalleryExtension, options?: InstallOptions): Promise<ILocalExtension>;
    installGalleryExtensions(extensions: InstallExtensionInfo[]): Promise<InstallExtensionResult[]>;
    installFromLocation(location: URI, profileLocation: URI): Promise<ILocalExtension>;
    installExtensionsFromProfile(extensions: IExtensionIdentifier[], fromProfileLocation: URI, toProfileLocation: URI): Promise<ILocalExtension[]>;
    uninstall(extension: ILocalExtension, options?: UninstallOptions): Promise<void>;
    toggleAppliationScope(extension: ILocalExtension, fromProfileLocation: URI): Promise<ILocalExtension>;
    reinstallFromGallery(extension: ILocalExtension): Promise<ILocalExtension>;
    getInstalled(type?: ExtensionType, profileLocation?: URI, productVersion?: IProductVersion): Promise<ILocalExtension[]>;
    getExtensionsControlManifest(): Promise<IExtensionsControlManifest>;
    copyExtensions(fromProfileLocation: URI, toProfileLocation: URI): Promise<void>;
    updateMetadata(local: ILocalExtension, metadata: Partial<Metadata>, profileLocation: URI): Promise<ILocalExtension>;
    download(extension: IGalleryExtension, operation: InstallOperation, donotVerifySignature: boolean): Promise<URI>;
    registerParticipant(pariticipant: IExtensionManagementParticipant): void;
    getTargetPlatform(): Promise<TargetPlatform>;
    cleanUp(): Promise<void>;
}

export { IExtensionManagementService };
