sussudio
Version:
An unofficial VS Code Internal API
55 lines (54 loc) • 3.64 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 { Event } from "../../../base/common/event.mjs";
import { Disposable } from "../../../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 "../../../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);
}