mirror of
https://github.com/bitwarden/browser
synced 2025-01-14 11:29:52 +01:00
moved service abstractions to lib
This commit is contained in:
parent
0f0b092ed7
commit
108eafaea3
@ -3,3 +3,8 @@ export { DeviceType } from './enums/deviceType.enum';
|
|||||||
export { EncryptionType } from './enums/encryptionType.enum';
|
export { EncryptionType } from './enums/encryptionType.enum';
|
||||||
export { FieldType } from './enums/fieldType.enum';
|
export { FieldType } from './enums/fieldType.enum';
|
||||||
export { SecureNoteType } from './enums/secureNoteType.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';
|
||||||
|
3
src/services/abstractions/messaging.service.ts
Normal file
3
src/services/abstractions/messaging.service.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export interface MessagingService {
|
||||||
|
send(subscriber: string, arg?: any): void;
|
||||||
|
}
|
18
src/services/abstractions/platformUtils.service.ts
Normal file
18
src/services/abstractions/platformUtils.service.ts
Normal 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;
|
||||||
|
}
|
5
src/services/abstractions/storage.service.ts
Normal file
5
src/services/abstractions/storage.service.ts
Normal 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>;
|
||||||
|
}
|
4
src/services/abstractions/utils.service.ts
Normal file
4
src/services/abstractions/utils.service.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface UtilsService {
|
||||||
|
copyToClipboard(text: string, doc?: Document): void;
|
||||||
|
getHostname(uriString: string): string;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user