diff --git a/src/index.ts b/src/index.ts index 6657b1a4f7..76e0a577cd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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'; diff --git a/src/services/abstractions/messaging.service.ts b/src/services/abstractions/messaging.service.ts new file mode 100644 index 0000000000..6bafce93e4 --- /dev/null +++ b/src/services/abstractions/messaging.service.ts @@ -0,0 +1,3 @@ +export interface MessagingService { + send(subscriber: string, arg?: any): void; +} diff --git a/src/services/abstractions/platformUtils.service.ts b/src/services/abstractions/platformUtils.service.ts new file mode 100644 index 0000000000..063c18dcdd --- /dev/null +++ b/src/services/abstractions/platformUtils.service.ts @@ -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; +} diff --git a/src/services/abstractions/storage.service.ts b/src/services/abstractions/storage.service.ts new file mode 100644 index 0000000000..5d070d0a55 --- /dev/null +++ b/src/services/abstractions/storage.service.ts @@ -0,0 +1,5 @@ +export interface StorageService { + get(key: string): Promise; + save(key: string, obj: any): Promise; + remove(key: string): Promise; +} diff --git a/src/services/abstractions/utils.service.ts b/src/services/abstractions/utils.service.ts new file mode 100644 index 0000000000..a251eedeaa --- /dev/null +++ b/src/services/abstractions/utils.service.ts @@ -0,0 +1,4 @@ +export interface UtilsService { + copyToClipboard(text: string, doc?: Document): void; + getHostname(uriString: string): string; +}