Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/files/common/elevatedFileService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
7
import { URI } from '../../../../base/common/uri.js';
8
import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js';
9
import { IFileStatWithMetadata, IWriteFileOptions } from '../../../../platform/files/common/files.js';
10
11
export const IElevatedFileService = createDecorator<IElevatedFileService>('elevatedFileService');
12
13
export interface IElevatedFileService {
14
15
readonly _serviceBrand: undefined;
16
17
/**
18
* Whether saving elevated is supported for the provided resource.
19
*/
20
isSupported(resource: URI): boolean;
21
22
/**
23
* Attempts to write to the target resource elevated. This may bring
24
* up a dialog to ask for admin username / password.
25
*/
26
writeFileElevated(resource: URI, value: VSBuffer | VSBufferReadable | VSBufferReadableStream, options?: IWriteFileOptions): Promise<IFileStatWithMetadata>;
27
}
28
29