Skip to content

platform/electron/data-service-client

Defined in: app/src/platform/electron/data-service-client.ts:19

Talks to the data service. The service starts with the first call, outside the start-up path, and starts again with the next call if it ever stops. A service that keeps failing, for example because profile.db cannot be opened, rests for a minute, during which calls fail at once instead of starting it again and again.

new DataServiceClient(entry, databasePath, logger): DataServiceClient

Defined in: app/src/platform/electron/data-service-client.ts:34

string

Path of the service’s bundled entry.

string

Path of profile.db.

Logger

Receives failures.

DataServiceClient

call<M>(method, …params): Promise<ReturnType<DataApi[M]>>

Defined in: app/src/platform/electron/data-service-client.ts:45

Calls a method of the profile database.

M extends "history" | "bookmarks" | "addVisit" | "setTitle" | "deleteHistory" | "clearHistory" | "importHistory" | "bookmarkList" | "bookmarkUrls" | "addBookmark" | "updateBookmark" | "removeBookmark" | "removeBookmarkUrl" | "importBookmarks" | "addDownload" | "updateDownload" | "downloads" | "interruptDownloads" | "removeDownloads" | "findBrowsers" | "importBrowser"

M

The method.

…Parameters<DataApi[M]>

Its arguments.

Promise<ReturnType<DataApi[M]>>

dispose(): void

Defined in: app/src/platform/electron/data-service-client.ts:69

Stops the service.

void

DataClient = Pick<DataServiceClient, "call" | "dispose">

Defined in: app/src/platform/electron/data-service-client.ts:11

The calls of the data service, as its users see them.