import { Emitter } from "../../../base/common/event.js"; import { Disposable } from "../../../base/common/lifecycle.js"; import { URI, UriDto } from "../../../base/common/uri.js"; import { IEnvironmentService } from "../../environment/common/environment.service.js"; import { IFileService } from "../../files/common/files.service.js"; import { ILogService } from "../../log/common/log.service.js"; import { IAnyWorkspaceIdentifier } from "../../workspace/common/workspace.js"; import { IStringDictionary } from "../../../base/common/collections.js"; import { IUriIdentityService } from "../../uriIdentity/common/uriIdentity.service.js"; import { IUserDataProfilesService } from "./userDataProfile.service.js"; export declare enum ProfileResourceType { Settings = "settings", Keybindings = "keybindings", Snippets = "snippets", Prompts = "prompts", Tasks = "tasks", Extensions = "extensions", GlobalState = "globalState", Mcp = "mcp" } /** * Flags to indicate whether to use the default profile or not. */ export type UseDefaultProfileFlags = { [key in ProfileResourceType]?: boolean; }; export type ProfileResourceTypeFlags = UseDefaultProfileFlags; export type SettingValue = string | boolean | number | undefined | null | object; export type ISettingsDictionary = Record; export interface IUserDataProfile { readonly id: string; readonly isDefault: boolean; readonly name: string; readonly icon?: string; readonly location: URI; readonly globalStorageHome: URI; readonly settingsResource: URI; readonly keybindingsResource: URI; readonly tasksResource: URI; readonly snippetsHome: URI; readonly promptsHome: URI; readonly extensionsResource: URI; readonly mcpResource: URI; readonly cacheHome: URI; readonly useDefaultFlags?: UseDefaultProfileFlags; readonly isTransient?: boolean; readonly workspaces?: readonly URI[]; } export declare function isUserDataProfile(thing: unknown): thing is IUserDataProfile; export interface IParsedUserDataProfileTemplate { readonly name: string; readonly icon?: string; readonly settings?: ISettingsDictionary; readonly globalState?: IStringDictionary; } export interface ISystemProfileTemplate extends IParsedUserDataProfileTemplate { readonly id: string; } export type DidChangeProfilesEvent = { readonly added: readonly IUserDataProfile[]; readonly removed: readonly IUserDataProfile[]; readonly updated: readonly IUserDataProfile[]; readonly all: readonly IUserDataProfile[]; }; export type WillCreateProfileEvent = { profile: IUserDataProfile; join(promise: Promise): void; }; export type WillRemoveProfileEvent = { profile: IUserDataProfile; join(promise: Promise): void; }; export interface IUserDataProfileOptions { readonly icon?: string; readonly useDefaultFlags?: UseDefaultProfileFlags; readonly transient?: boolean; readonly workspaces?: readonly URI[]; } export interface IUserDataProfileUpdateOptions extends Omit { readonly name?: string; readonly icon?: string | null; } export declare function reviveProfile(profile: UriDto, scheme: string): IUserDataProfile; export declare function toUserDataProfile(id: string, name: string, location: URI, profilesCacheHome: URI, options?: IUserDataProfileOptions, defaultProfile?: IUserDataProfile): IUserDataProfile; export type UserDataProfilesObject = { profiles: IUserDataProfile[]; emptyWindows: Map; }; export type StoredUserDataProfile = { name: string; location: URI; icon?: string; useDefaultFlags?: UseDefaultProfileFlags; isSystem?: boolean; }; export type StoredProfileAssociations = { workspaces?: IStringDictionary; emptyWindows?: IStringDictionary; }; export declare class UserDataProfilesService extends Disposable implements IUserDataProfilesService { protected environmentService: IEnvironmentService; protected fileService: IFileService; protected uriIdentityService: IUriIdentityService; protected logService: ILogService; readonly _serviceBrand: undefined; protected static readonly PROFILES_KEY = "userDataProfiles"; protected static readonly PROFILE_ASSOCIATIONS_KEY = "profileAssociations"; readonly profilesHome: URI; private readonly profilesCacheHome; get defaultProfile(): IUserDataProfile; get profiles(): IUserDataProfile[]; protected readonly _onDidChangeProfiles: Emitter; readonly onDidChangeProfiles: import("../../../base/common/event.js").Event; protected readonly _onWillCreateProfile: Emitter; readonly onWillCreateProfile: import("../../../base/common/event.js").Event; protected readonly _onWillRemoveProfile: Emitter; readonly onWillRemoveProfile: import("../../../base/common/event.js").Event; private readonly _onDidResetWorkspaces; readonly onDidResetWorkspaces: import("../../../base/common/event.js").Event; private profileCreationPromises; protected readonly transientProfilesObject: UserDataProfilesObject; constructor(environmentService: IEnvironmentService, fileService: IFileService, uriIdentityService: IUriIdentityService, logService: ILogService); init(): void; protected _profilesObject: UserDataProfilesObject | undefined; protected get profilesObject(): UserDataProfilesObject; private isInvalidProfile; private createDefaultProfile; createTransientProfile(workspaceIdentifier?: IAnyWorkspaceIdentifier): Promise; createNamedProfile(name: string, options?: IUserDataProfileOptions, workspaceIdentifier?: IAnyWorkspaceIdentifier): Promise; createProfile(id: string, name: string, options?: IUserDataProfileOptions, workspaceIdentifier?: IAnyWorkspaceIdentifier): Promise; private doCreateProfile; updateProfile(profile: IUserDataProfile, options: IUserDataProfileUpdateOptions): Promise; removeProfile(profileToRemove: IUserDataProfile): Promise; setProfileForWorkspace(workspaceIdentifier: IAnyWorkspaceIdentifier, profileToSet: IUserDataProfile): Promise; unsetWorkspace(workspaceIdentifier: IAnyWorkspaceIdentifier, transient?: boolean): void; resetWorkspaces(): Promise; cleanUp(): Promise; cleanUpTransientProfiles(): Promise; getProfileForWorkspace(workspaceIdentifier: IAnyWorkspaceIdentifier): IUserDataProfile | undefined; protected getWorkspace(workspaceIdentifier: IAnyWorkspaceIdentifier): URI | string; private isProfileAssociatedToWorkspace; private updateProfiles; protected triggerProfilesChanges(added: IUserDataProfile[], removed: IUserDataProfile[], updated: IUserDataProfile[]): void; private updateEmptyWindowAssociation; private updateStoredProfiles; protected getStoredProfiles(): StoredUserDataProfile[]; protected saveStoredProfiles(storedProfiles: StoredUserDataProfile[]): void; protected getStoredProfileAssociations(): StoredProfileAssociations; protected saveStoredProfileAssociations(storedProfileAssociations: StoredProfileAssociations): void; protected getDefaultProfileExtensionsLocation(): URI | undefined; } export declare class InMemoryUserDataProfilesService extends UserDataProfilesService { private storedProfiles; protected getStoredProfiles(): StoredUserDataProfile[]; protected saveStoredProfiles(storedProfiles: StoredUserDataProfile[]): void; private storedProfileAssociations; protected getStoredProfileAssociations(): StoredProfileAssociations; protected saveStoredProfileAssociations(storedProfileAssociations: StoredProfileAssociations): void; }