1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-20 09:23:23 +00:00

re-organize into "barrels". add utils service

This commit is contained in:
Kyle Spearrin
2018-01-06 22:13:11 -05:00
parent 108eafaea3
commit 2b4cd3fba7
16 changed files with 172 additions and 11 deletions

View File

@@ -0,0 +1,4 @@
export { MessagingService } from './messaging.service';
export { PlatformUtilsService } from './platformUtils.service';
export { StorageService } from './storage.service';
export { UtilsService } from './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;
}