mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-13 19:51:37 +01:00
abstract services
This commit is contained in:
parent
9cd74af2df
commit
28ed4144db
@ -1,3 +1,3 @@
|
||||
export interface MessagingService {
|
||||
send(subscriber: string, arg?: any): void;
|
||||
export abstract class MessagingService {
|
||||
send: (subscriber: string, arg?: any) => void;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
export interface SettingsService {
|
||||
clearCache(): void;
|
||||
getEquivalentDomains(): Promise<any>;
|
||||
setEquivalentDomains(equivalentDomains: string[][]): Promise<any>;
|
||||
clear(userId: string): Promise<void>;
|
||||
export abstract class SettingsService {
|
||||
clearCache: () => void;
|
||||
getEquivalentDomains: () => Promise<any>;
|
||||
setEquivalentDomains: (equivalentDomains: string[][]) => Promise<any>;
|
||||
clear: (userId: string) => Promise<void>;
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
export interface UserService {
|
||||
export abstract class UserService {
|
||||
userId: string;
|
||||
email: string;
|
||||
stamp: string;
|
||||
setUserIdAndEmail(userId: string, email: string): Promise<any>;
|
||||
setSecurityStamp(stamp: string): Promise<any>;
|
||||
getUserId(): Promise<string>;
|
||||
getEmail(): Promise<string>;
|
||||
getSecurityStamp(): Promise<string>;
|
||||
clear(): Promise<any>;
|
||||
isAuthenticated(): Promise<boolean>;
|
||||
|
||||
setUserIdAndEmail: (userId: string, email: string) => Promise<any>;
|
||||
setSecurityStamp: (stamp: string) => Promise<any>;
|
||||
getUserId: () => Promise<string>;
|
||||
getEmail: () => Promise<string>;
|
||||
getSecurityStamp: () => Promise<string>;
|
||||
clear: () => Promise<any>;
|
||||
isAuthenticated: () => Promise<boolean>;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { SettingsService as SettingsServiceInterface } from '../abstractions/settings.service';
|
||||
import { SettingsService as SettingsServiceAbstraction } from '../abstractions/settings.service';
|
||||
import { StorageService } from '../abstractions/storage.service';
|
||||
import { UserService } from '../abstractions/user.service';
|
||||
|
||||
@ -7,7 +7,7 @@ const Keys = {
|
||||
equivalentDomains: 'equivalentDomains',
|
||||
};
|
||||
|
||||
export class SettingsService implements SettingsServiceInterface {
|
||||
export class SettingsService implements SettingsServiceAbstraction {
|
||||
private settingsCache: any;
|
||||
|
||||
constructor(private userService: UserService, private storageService: StorageService) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { StorageService } from '../abstractions/storage.service';
|
||||
import { TokenService } from '../abstractions/token.service';
|
||||
import { UserService as UserServiceInterface } from '../abstractions/user.service';
|
||||
import { UserService as UserServiceAbsrtaction } from '../abstractions/user.service';
|
||||
|
||||
const Keys = {
|
||||
userId: 'userId',
|
||||
@ -8,7 +8,7 @@ const Keys = {
|
||||
stamp: 'securityStamp',
|
||||
};
|
||||
|
||||
export class UserService implements UserServiceInterface {
|
||||
export class UserService implements UserServiceAbsrtaction {
|
||||
userId: string;
|
||||
email: string;
|
||||
stamp: string;
|
||||
|
Loading…
Reference in New Issue
Block a user