UNPKG

@alfresco/adf-core

Version:
29 lines (28 loc) 1.16 kB
import { Injector } from '@angular/core'; import { AppConfigService } from '../../app-config/app-config.service'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; export interface TimeSync { outOfSync: boolean; timeOutOfSyncInSec?: number; localDateTimeISO: string; serverDateTimeISO: string; } export declare class TimeSyncService { private _injector; private _appConfigService; private readonly _http; constructor(_injector: Injector, _appConfigService: AppConfigService); checkTimeSync(maxAllowedClockSkewInSec: number): Observable<TimeSync>; /** * Checks if the local time is out of sync with the server time. * * @param maxAllowedClockSkewInSec - The maximum allowed clock skew in seconds. * @returns An Observable that emits a boolean indicating whether the local time is out of sync. */ isLocalTimeOutOfSync(maxAllowedClockSkewInSec: number): Observable<boolean>; private getServerTime; private getServerTimeUrl; static ɵfac: i0.ɵɵFactoryDeclaration<TimeSyncService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<TimeSyncService>; }