Skip to main content

Abstract Class: Provider<T>

Extended by​

Type Parameters​

T​

T extends UpdateInfo

Constructors​

Constructor​

protected new Provider<T>(runtimeOptions): Provider<T>

Parameters​

runtimeOptions​

ProviderRuntimeOptions

Returns​

Provider<T>

Properties​

executor​

protected readonly executor: ElectronHttpExecutor

Accessors​

feedBaseUrl​

Get Signature​

get feedBaseUrl(): URL | null | undefined

Base URL of the update feed: the credential-bearing request headers (the ones stripped on a cross-origin redirect) are only sent to download URLs on its origin. null sends the request headers to every download URL. The default, undefined, means not declared: a download with credential headers (from requestHeaders / addAuthHeader) then fails with ERR_UPDATER_FEED_BASE_URL_NOT_DECLARED, so a custom provider used with credentials must override this getter.

Returns​

URL | null | undefined


fileExtraDownloadHeaders​

Get Signature​

get fileExtraDownloadHeaders(): OutgoingHttpHeaders | null

Returns​

OutgoingHttpHeaders | null


isUseMultipleRangeRequest​

Get Signature​

get isUseMultipleRangeRequest(): boolean

Returns​

boolean

Methods​

createRequestOptions()​

protected createRequestOptions(url, headers?): RequestOptions

Parameters​

url​

URL

headers?​

OutgoingHttpHeaders | null

Returns​

RequestOptions


getBlockMapFiles()​

getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl?): URL[] | Promise<URL[]>

Parameters​

baseUrl​

URL

oldVersion​

string

newVersion​

string

oldBlockMapFileBaseUrl?​

string | null

Returns​

URL[] | Promise<URL[]>


getCustomChannelName()​

protected getCustomChannelName(channel): string

Parameters​

channel​

string

Returns​

string


getDefaultChannelName()​

protected getDefaultChannelName(): string

Returns​

string


getLatestVersion()​

abstract getLatestVersion(): Promise<T>

Returns​

Promise<T>


httpRequest()​

protected httpRequest(url, headers?, cancellationToken?): Promise<string | null>

Method to perform API request only to resolve update info, but not to download update.

Parameters​

url​

URL

headers?​

OutgoingHttpHeaders | null

cancellationToken?​

CancellationToken

Returns​

Promise<string | null>


resolveFiles()​

abstract resolveFiles(updateInfo): ResolvedUpdateFileInfo[]

Parameters​

updateInfo​

T

Returns​

ResolvedUpdateFileInfo[]


setRequestHeaders()​

setRequestHeaders(value): void

Parameters​

value​

OutgoingHttpHeaders | null

Returns​

void