/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Disposable, Event, ProviderResult, Uri } from 'vscode'; export { ProviderResult } from 'vscode'; export interface API { pickRemoteSource(options: PickRemoteSourceOptions): Promise; registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable; } export interface GitBaseExtension { readonly enabled: boolean; readonly onDidChangeEnablement: Event; /** * Returns a specific API version. * * Throws error if git-base extension is disabled. You can listed to the * [GitBaseExtension.onDidChangeEnablement](#GitBaseExtension.onDidChangeEnablement) * event to know when the extension becomes enabled/disabled. * * @param version Version number. * @returns API instance */ getAPI(version: 1): API; } export interface PickRemoteSourceOptions { readonly providerLabel?: (provider: RemoteSourceProvider) => string; readonly urlLabel?: string; readonly providerName?: string; readonly branch?: boolean; // then result is PickRemoteSourceResult } export interface PickRemoteSourceResult { readonly url: string; readonly branch?: string; } export interface RemoteSource { readonly name: string; readonly description?: string; readonly url: string | string[]; } export interface RemoteSourceProvider { readonly name: string; /** * Codicon name */ readonly icon?: string; readonly supportsQuery?: boolean; getBranches?(url: string): ProviderResult; getRemoteSources(query?: string): ProviderResult; }