1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

sync service abstraction

This commit is contained in:
Kyle Spearrin 2018-02-08 10:49:00 -05:00
parent 78088acac7
commit 9cd74af2df
2 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
export interface SyncService {
export abstract class SyncService {
syncInProgress: boolean;
getLastSync(): Promise<Date>;
setLastSync(date: Date): Promise<any>;
syncStarted(): void;
syncCompleted(successfully: boolean): void;
fullSync(forceSync: boolean): Promise<boolean>;
getLastSync: () => Promise<Date>;
setLastSync: (date: Date) => Promise<any>;
syncStarted: () => void;
syncCompleted: (successfully: boolean) => void;
fullSync: (forceSync: boolean) => Promise<boolean>;
}

View File

@ -6,7 +6,7 @@ import { FolderService } from '../abstractions/folder.service';
import { MessagingService } from '../abstractions/messaging.service';
import { SettingsService } from '../abstractions/settings.service';
import { StorageService } from '../abstractions/storage.service';
import { SyncService as SyncServiceInterface } from '../abstractions/sync.service';
import { SyncService as SyncServiceAbstraction } from '../abstractions/sync.service';
import { UserService } from '../abstractions/user.service';
import { CipherData } from '../models/data/cipherData';
@ -23,7 +23,7 @@ const Keys = {
lastSyncPrefix: 'lastSync_',
};
export class SyncService implements SyncServiceInterface {
export class SyncService implements SyncServiceAbstraction {
syncInProgress: boolean = false;
constructor(private userService: UserService, private apiService: ApiService,