mirror of
https://github.com/bitwarden/browser
synced 2026-02-21 03:43:58 +00:00
* Replace any-returns with types * Show an error message when a failure from the native call is returned --------- Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com> Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
20 lines
681 B
TypeScript
20 lines
681 B
TypeScript
import { ipcRenderer } from "electron";
|
|
|
|
import type { chromium_importer } from "@bitwarden/desktop-napi";
|
|
|
|
const chromiumImporter = {
|
|
getMetadata: (): Promise<Record<string, chromium_importer.NativeImporterMetadata>> =>
|
|
ipcRenderer.invoke("chromium_importer.getMetadata"),
|
|
getAvailableProfiles: (browser: string): Promise<chromium_importer.ProfileInfo[]> =>
|
|
ipcRenderer.invoke("chromium_importer.getAvailableProfiles", browser),
|
|
importLogins: (
|
|
browser: string,
|
|
profileId: string,
|
|
): Promise<chromium_importer.LoginImportResult[]> =>
|
|
ipcRenderer.invoke("chromium_importer.importLogins", browser, profileId),
|
|
};
|
|
|
|
export default {
|
|
chromiumImporter,
|
|
};
|