1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-05 05:17:40 +02:00

moved service abstractions to lib

This commit is contained in:
Kyle Spearrin 2018-01-06 15:47:23 -05:00
parent 0f0b092ed7
commit 108eafaea3
5 changed files with 35 additions and 0 deletions

View File

@ -3,3 +3,8 @@ export { DeviceType } from './enums/deviceType.enum';
export { EncryptionType } from './enums/encryptionType.enum';
export { FieldType } from './enums/fieldType.enum';
export { SecureNoteType } from './enums/secureNoteType.enum';
export { MessagingService } from './services/abstractions/messaging.service';
export { PlatformUtilsService } from './services/abstractions/platformUtils.service';
export { StorageService } from './services/abstractions/storage.service';
export { UtilsService } from './services/abstractions/utils.service';

View File

@ -0,0 +1,3 @@
export interface MessagingService {
send(subscriber: string, arg?: any): void;
}

View File

@ -0,0 +1,18 @@
import { DeviceType } from '../../enums/deviceType.enum';
export interface PlatformUtilsService {
getDevice(): DeviceType;
getDeviceString(): string;
isFirefox(): boolean;
isChrome(): boolean;
isEdge(): boolean;
isOpera(): boolean;
analyticsId(): string;
initListSectionItemListeners(doc: Document, angular: any): void;
getDomain(uriString: string): string;
inSidebar(theWindow: Window): boolean;
inTab(theWindow: Window): boolean;
inPopout(theWindow: Window): boolean;
inPopup(theWindow: Window): boolean;
isViewOpen(): boolean;
}

View File

@ -0,0 +1,5 @@
export interface StorageService {
get<T>(key: string): Promise<T>;
save(key: string, obj: any): Promise<any>;
remove(key: string): Promise<any>;
}

View File

@ -0,0 +1,4 @@
export interface UtilsService {
copyToClipboard(text: string, doc?: Document): void;
getHostname(uriString: string): string;
}