bitwarden-estensione-browser/libs/common/src/abstractions/platformUtils.service.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
TypeScript
Raw Normal View History

import { ClientType } from "../enums/clientType";
import { DeviceType } from "../enums/deviceType";
2018-01-06 21:47:23 +01:00
2021-12-07 19:15:56 +01:00
interface ToastOptions {
timeout?: number;
}
2018-01-25 20:26:09 +01:00
export abstract class PlatformUtilsService {
getDevice: () => DeviceType;
getDeviceString: () => string;
getClientType: () => ClientType;
2018-01-25 20:26:09 +01:00
isFirefox: () => boolean;
isChrome: () => boolean;
isEdge: () => boolean;
isOpera: () => boolean;
isVivaldi: () => boolean;
isSafari: () => boolean;
2018-02-27 05:32:06 +01:00
isMacAppStore: () => boolean;
2019-08-20 19:47:15 +02:00
isViewOpen: () => Promise<boolean>;
2018-01-25 20:32:10 +01:00
launchUri: (uri: string, options?: any) => void;
2018-01-25 20:26:09 +01:00
saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;
getApplicationVersion: () => Promise<string>;
2021-03-15 16:16:51 +01:00
supportsWebAuthn: (win: Window) => boolean;
2018-05-16 21:30:28 +02:00
supportsDuo: () => boolean;
2018-10-03 05:09:19 +02:00
showToast: (
type: "error" | "success" | "warning" | "info",
title: string,
text: string | string[],
2021-12-07 19:15:56 +01:00
options?: ToastOptions
) => void;
showDialog: (
body: string,
title?: string,
confirmText?: string,
cancelText?: string,
type?: string,
bodyIsHtml?: boolean
) => Promise<boolean>;
2018-02-13 23:23:45 +01:00
isDev: () => boolean;
2018-06-30 19:51:09 +02:00
isSelfHost: () => boolean;
copyToClipboard: (text: string, options?: any) => void | boolean;
2019-02-27 04:35:53 +01:00
readFromClipboard: (options?: any) => Promise<string>;
supportsBiometric: () => Promise<boolean>;
authenticateBiometric: () => Promise<boolean>;
supportsSecureStorage: () => boolean;
2018-01-06 21:47:23 +01:00
}