UNPKG

1.03 kBTypeScriptView Raw
1/// <reference types="node" />
2import { DownloadOptions, HttpExecutor } from "builder-util-runtime";
3import { RequestOptions } from "http";
4import Session = Electron.Session;
5import ClientRequest = Electron.ClientRequest;
6export declare type LoginCallback = (username: string, password: string) => void;
7export declare const NET_SESSION_NAME = "electron-updater";
8export declare function getNetSession(): Session;
9export declare class ElectronHttpExecutor extends HttpExecutor<Electron.ClientRequest> {
10 private readonly proxyLoginCallback?;
11 private cachedSession;
12 constructor(proxyLoginCallback?: ((authInfo: any, callback: LoginCallback) => void) | undefined);
13 download(url: URL, destination: string, options: DownloadOptions): Promise<string>;
14 createRequest(options: any, callback: (response: any) => void): any;
15 protected addRedirectHandlers(request: ClientRequest, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void): void;
16}