UNPKG

sussudio

Version:

An unofficial VS Code Internal API

44 lines (43 loc) 2.15 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /// <reference types="node" /> import * as http from 'http'; import { CancellationToken } from "../../../base/common/cancellation.mjs"; import { Disposable } from "../../../base/common/lifecycle.mjs"; import { IRequestContext, IRequestOptions } from "../../../base/parts/request/common/request.mjs"; import { IConfigurationService } from "../../configuration/common/configuration.mjs"; import { INativeEnvironmentService } from "../../environment/common/environment.mjs"; import { ILogService } from "../../log/common/log.mjs"; import { IRequestService } from "../common/request.mjs"; import { Agent } from "./proxy.mjs"; export interface IRawRequestFunction { (options: http.RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; } export interface NodeRequestOptions extends IRequestOptions { agent?: Agent; strictSSL?: boolean; isChromiumNetwork?: boolean; getRawRequest?(options: IRequestOptions): IRawRequestFunction; } /** * This service exposes the `request` API, while using the global * or configured proxy settings. */ export declare class RequestService extends Disposable implements IRequestService { private readonly configurationService; private readonly environmentService; private readonly logService; readonly _serviceBrand: undefined; private proxyUrl?; private strictSSL; private authorization?; private shellEnvErrorLogged?; constructor(configurationService: IConfigurationService, environmentService: INativeEnvironmentService, logService: ILogService); private configure; request(options: NodeRequestOptions, token: CancellationToken): Promise<IRequestContext>; private getNodeRequest; private _request; resolveProxy(url: string): Promise<string | undefined>; }