Path: blob/main/src/vs/workbench/services/files/common/elevatedFileService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';6import { URI } from '../../../../base/common/uri.js';7import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js';8import { IFileStatWithMetadata, IWriteFileOptions } from '../../../../platform/files/common/files.js';910export const IElevatedFileService = createDecorator<IElevatedFileService>('elevatedFileService');1112export interface IElevatedFileService {1314readonly _serviceBrand: undefined;1516/**17* Whether saving elevated is supported for the provided resource.18*/19isSupported(resource: URI): boolean;2021/**22* Attempts to write to the target resource elevated. This may bring23* up a dialog to ask for admin username / password.24*/25writeFileElevated(resource: URI, value: VSBuffer | VSBufferReadable | VSBufferReadableStream, options?: IWriteFileOptions): Promise<IFileStatWithMetadata>;26}272829