mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-20 07:12:43 +01:00
Co-authored-by: Johannes Rieken <jrieken@microsoft.com> Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Disposable } from '../../../base/common/lifecycle.js';
|
|
import { MainContext, MainThreadDownloadServiceShape } from '../common/extHost.protocol.js';
|
|
import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';
|
|
import { IDownloadService } from '../../../platform/download/common/download.js';
|
|
import { UriComponents, URI } from '../../../base/common/uri.js';
|
|
|
|
@extHostNamedCustomer(MainContext.MainThreadDownloadService)
|
|
export class MainThreadDownloadService extends Disposable implements MainThreadDownloadServiceShape {
|
|
|
|
constructor(
|
|
extHostContext: IExtHostContext,
|
|
@IDownloadService private readonly downloadService: IDownloadService
|
|
) {
|
|
super();
|
|
}
|
|
|
|
$download(uri: UriComponents, to: UriComponents): Promise<void> {
|
|
return this.downloadService.download(URI.revive(uri), URI.revive(to));
|
|
}
|
|
|
|
}
|