@powfix/core-js 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ export declare class TimeService extends EventEmitter<TimeServiceEvent> {
|
|
|
8
8
|
protected clientTimeProvider?: TimeServiceClientTimeProvider;
|
|
9
9
|
protected serverTimeProvider?: TimeServiceServerTimeProvider;
|
|
10
10
|
static calculateNTPResultOffset(ntpResult: TimeServiceNtpResult): TimeServiceOffset;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(options?: TimeServiceOptions);
|
|
12
12
|
getOffset(defaultValue: TimeServiceOffset): TimeServiceOffset;
|
|
13
13
|
getOffset(): TimeServiceOffset | undefined;
|
|
14
14
|
setOffset(offset: TimeServiceOffset): TimeServiceOffset;
|
|
@@ -20,12 +20,12 @@ class TimeService extends eventemitter3_1.default {
|
|
|
20
20
|
const { t1, t2, t3, t4 } = ntpResult;
|
|
21
21
|
return ((t2 - t1) + (t3 - t4)) / 2;
|
|
22
22
|
}
|
|
23
|
-
constructor(
|
|
23
|
+
constructor(options) {
|
|
24
24
|
super();
|
|
25
25
|
// Options
|
|
26
|
-
this.syncInterval =
|
|
27
|
-
this.clientTimeProvider =
|
|
28
|
-
this.serverTimeProvider =
|
|
26
|
+
this.syncInterval = options === null || options === void 0 ? void 0 : options.syncInterval;
|
|
27
|
+
this.clientTimeProvider = options === null || options === void 0 ? void 0 : options.clientTimeProvider;
|
|
28
|
+
this.serverTimeProvider = options === null || options === void 0 ? void 0 : options.serverTimeProvider;
|
|
29
29
|
// Bind
|
|
30
30
|
this.sync = this.sync.bind(this);
|
|
31
31
|
this.fetchServerNTPResult = this.fetchServerNTPResult.bind(this);
|