UNPKG

1.73 kBTypeScriptView Raw
1/// <reference types="node" />
2import * as https from 'https';
3import { DownloadPlatform } from './download';
4export declare let systemDefaultPlatform: string;
5export declare function getVSCodeDownloadUrl(version: string, platform?: DownloadPlatform): string;
6export declare function urlToOptions(url: string): https.RequestOptions;
7export declare function downloadDirToExecutablePath(dir: string): string;
8export declare function insidersDownloadDirToExecutablePath(dir: string): string;
9export declare function insidersDownloadDirMetadata(dir: string): {
10 version: any;
11 date: any;
12};
13export interface IUpdateMetadata {
14 url: string;
15 name: string;
16 version: string;
17 productVersion: string;
18 hash: string;
19 timestamp: number;
20 sha256hash: string;
21 supportsFastUpdate: boolean;
22}
23export declare function getLatestInsidersMetadata(platform: string): Promise<IUpdateMetadata>;
24/**
25 * Resolve the VS Code cli path from executable path returned from `downloadAndUnzipVSCode`.
26 * You can use this path to spawn processes for extension management. For example:
27 *
28 * ```ts
29 * const cp = require('child_process');
30 * const { downloadAndUnzipVSCode, resolveCliPathFromExecutablePath } = require('vscode-test')
31 * const vscodeExecutablePath = await downloadAndUnzipVSCode('1.36.0');
32 * const cliPath = resolveCliPathFromExecutablePath(vscodeExecutablePath);
33 *
34 * cp.spawnSync(cliPath, ['--install-extension', '<EXTENSION-ID-OR-PATH-TO-VSIX>'], {
35 * encoding: 'utf-8',
36 * stdio: 'inherit'
37 * });
38 * ```
39 *
40 * @param vscodeExecutablePath The `vscodeExecutablePath` from `downloadAndUnzipVSCode`.
41 */
42export declare function resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath: string): string;