@sussudio/platform
Version:
Internal APIs for VS Code's service injection the base services.
35 lines (33 loc) • 1.94 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Disposable } from '@sussudio/base/common/lifecycle.mjs';
import { URI } from '@sussudio/base/common/uri.mjs';
import { IQuickPickItem } from '@sussudio/base/parts/quickinput/common/quickInput.mjs';
import { IExtensionGalleryService, IGalleryExtension } from '../../extensionManagement/common/extensionManagement.mjs';
export declare function getLocale(extension: IGalleryExtension): string | undefined;
export declare const ILanguagePackService: import('../../instantiation/common/instantiation.mjs').ServiceIdentifier<ILanguagePackService>;
export interface ILanguagePackItem extends IQuickPickItem {
readonly extensionId: string;
readonly galleryExtension?: IGalleryExtension;
}
export interface ILanguagePackService {
readonly _serviceBrand: undefined;
getAvailableLanguages(): Promise<Array<ILanguagePackItem>>;
getInstalledLanguages(): Promise<Array<ILanguagePackItem>>;
getBuiltInExtensionTranslationsUri(id: string): Promise<URI | undefined>;
}
export declare abstract class LanguagePackBaseService extends Disposable implements ILanguagePackService {
protected readonly extensionGalleryService: IExtensionGalleryService;
readonly _serviceBrand: undefined;
constructor(extensionGalleryService: IExtensionGalleryService);
abstract getBuiltInExtensionTranslationsUri(id: string): Promise<URI | undefined>;
abstract getInstalledLanguages(): Promise<Array<ILanguagePackItem>>;
getAvailableLanguages(): Promise<ILanguagePackItem[]>;
protected createQuickPickItem(
locale: string,
languageName?: string,
languagePack?: IGalleryExtension,
): IQuickPickItem;
}