UNPKG

sussudio

Version:

An unofficial VS Code Internal API

56 lines (55 loc) 3.18 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 as CommonEvent } from "../../../base/common/event.mjs"; import { Disposable } from "../../../base/common/lifecycle.mjs"; import { URI } from "../../../base/common/uri.mjs"; import { ILifecycleMainService } from "../../lifecycle/electron-main/lifecycleMainService.mjs"; import { ILogService } from "../../log/common/log.mjs"; import { IApplicationStorageMainService } from "../../storage/electron-main/storageMainService.mjs"; import { IRecent, IRecentlyOpened } from "../common/workspaces.mjs"; import { IWorkspacesManagementMainService } from "./workspacesManagementMainService.mjs"; export declare const IWorkspacesHistoryMainService: import("../../instantiation/common/instantiation.mjs").ServiceIdentifier<IWorkspacesHistoryMainService>; export interface IWorkspacesHistoryMainService { readonly _serviceBrand: undefined; readonly onDidChangeRecentlyOpened: CommonEvent<void>; addRecentlyOpened(recents: IRecent[]): Promise<void>; getRecentlyOpened(): Promise<IRecentlyOpened>; removeRecentlyOpened(paths: URI[]): Promise<void>; clearRecentlyOpened(): Promise<void>; } export declare class WorkspacesHistoryMainService extends Disposable implements IWorkspacesHistoryMainService { private readonly logService; private readonly workspacesManagementMainService; private readonly lifecycleMainService; private readonly applicationStorageMainService; private static readonly MAX_TOTAL_RECENT_ENTRIES; private static readonly RECENTLY_OPENED_STORAGE_KEY; readonly _serviceBrand: undefined; private readonly _onDidChangeRecentlyOpened; readonly onDidChangeRecentlyOpened: CommonEvent<void>; constructor(logService: ILogService, workspacesManagementMainService: IWorkspacesManagementMainService, lifecycleMainService: ILifecycleMainService, applicationStorageMainService: IApplicationStorageMainService); private registerListeners; addRecentlyOpened(recentToAdd: IRecent[]): Promise<void>; removeRecentlyOpened(recentToRemove: URI[]): Promise<void>; clearRecentlyOpened(): Promise<void>; getRecentlyOpened(): Promise<IRecentlyOpened>; private mergeEntriesFromStorage; private getRecentlyOpenedFromStorage; private saveRecentlyOpened; private location; private containsWorkspace; private containsFolder; private containsFile; private static readonly MAX_MACOS_DOCK_RECENT_WORKSPACES; private static readonly MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL; private static readonly MAX_WINDOWS_JUMP_LIST_ENTRIES; private static readonly COMMON_FILES_FILTER; private readonly macOSRecentDocumentsUpdater; private handleWindowsJumpList; private updateWindowsJumpList; private getWindowsJumpListLabel; private renderJumpListPathDescription; private updateMacOSRecentDocuments; }