UNPKG

@sussudio/platform

Version:

Internal APIs for VS Code's service injection the base services.

73 lines (71 loc) 3.58 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Event } from '@sussudio/base/common/event.mjs'; import { Disposable } from '@sussudio/base/common/lifecycle.mjs'; import { IStorageService } from '../../storage/common/storage.mjs'; import { IProductService } from '../../product/common/productService.mjs'; import { ILogService } from '../../log/common/log.mjs'; import { IExtension } from '../../extensions/common/extensions.mjs'; import { IStringDictionary } from '@sussudio/base/common/collections.mjs'; import { IExtensionManagementService, IGalleryExtension } from './extensionManagement.mjs'; export interface IExtensionIdWithVersion { id: string; version: string; } export declare const IExtensionStorageService: import('../../instantiation/common/instantiation.mjs').ServiceIdentifier<IExtensionStorageService>; export interface IExtensionStorageService { readonly _serviceBrand: undefined; getExtensionState( extension: IExtension | IGalleryExtension | string, global: boolean, ): IStringDictionary<any> | undefined; getExtensionStateRaw(extension: IExtension | IGalleryExtension | string, global: boolean): string | undefined; setExtensionState( extension: IExtension | IGalleryExtension | string, state: IStringDictionary<any> | undefined, global: boolean, ): void; readonly onDidChangeExtensionStorageToSync: Event<void>; setKeysForSync(extensionIdWithVersion: IExtensionIdWithVersion, keys: string[]): void; getKeysForSync(extensionIdWithVersion: IExtensionIdWithVersion): string[] | undefined; addToMigrationList(from: string, to: string): void; getSourceExtensionToMigrate(target: string): string | undefined; } export declare class ExtensionStorageService extends Disposable implements IExtensionStorageService { private readonly storageService; private readonly productService; private readonly logService; readonly _serviceBrand: undefined; private static LARGE_STATE_WARNING_THRESHOLD; private static toKey; private static fromKey; static removeOutdatedExtensionVersions( extensionManagementService: IExtensionManagementService, storageService: IStorageService, ): Promise<void>; private static readAllExtensionsWithKeysForSync; private readonly _onDidChangeExtensionStorageToSync; readonly onDidChangeExtensionStorageToSync: Event<void>; private readonly extensionsWithKeysForSync; constructor(storageService: IStorageService, productService: IProductService, logService: ILogService); private onDidChangeStorageValue; private getExtensionId; getExtensionState( extension: IExtension | IGalleryExtension | string, global: boolean, ): IStringDictionary<any> | undefined; getExtensionStateRaw(extension: IExtension | IGalleryExtension | string, global: boolean): string | undefined; setExtensionState( extension: IExtension | IGalleryExtension | string, state: IStringDictionary<any> | undefined, global: boolean, ): void; setKeysForSync(extensionIdWithVersion: IExtensionIdWithVersion, keys: string[]): void; getKeysForSync(extensionIdWithVersion: IExtensionIdWithVersion): string[] | undefined; addToMigrationList(from: string, to: string): void; getSourceExtensionToMigrate(toExtensionId: string): string | undefined; private get migrationList(); private set migrationList(value); }