ag-timemachine
Advanced tools
Comparing version 1.0.89 to 1.0.90
import type { Db } from "mongodb"; | ||
import { ServerBufferApi, ServerBufferState } from "./TmPlayerBuffer"; | ||
import { ServerBufferProxy } from "./TmPlayerBuffer"; | ||
export declare class AgTimeMachine { | ||
@@ -12,4 +12,3 @@ private _db; | ||
attachDynamic(idFn: () => string[], dataFn: (id: string) => any): void; | ||
bufferApi: ServerBufferApi; | ||
bufferState: ServerBufferState; | ||
bufferProxy: ServerBufferProxy; | ||
} |
@@ -50,3 +50,3 @@ "use strict"; | ||
this._db = _db; | ||
this.bufferApi = { | ||
this.bufferProxy = { | ||
getHistoryDeltas: function (id, from, to) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -67,5 +67,3 @@ return __generator(this, function (_a) { | ||
}); | ||
}); } | ||
}; | ||
this.bufferState = { | ||
}); }, | ||
rtRecentDatas: function (id) { | ||
@@ -72,0 +70,0 @@ return AgHelper_1.AgHelper.toMap(_this.getObject(id).recentDatas.value, function (v) { return v.time.getTime() + ''; }); |
{ | ||
"name": "ag-timemachine", | ||
"version": "1.0.89", | ||
"version": "1.0.90", | ||
"description": "", | ||
@@ -13,5 +13,5 @@ "main": "index.js", | ||
"ag-bundle": "^2.0.99", | ||
"ag-remote": "^1.0.29" | ||
"ag-remote": "^1.0.30" | ||
}, | ||
"bin": {} | ||
} |
@@ -1,5 +0,5 @@ | ||
import { WebApiProxy, WebStateProxy } from "ag-remote/AgRemoteTypes"; | ||
import { ServerBufferApi, ServerBufferState } from "./TmPlayerBuffer"; | ||
import { ServerBufferProxy } from "./TmPlayerBuffer"; | ||
import { WebProxy } from "ag-remote/AgRemoteTypes"; | ||
export declare class AgTmPlayer { | ||
private state; | ||
private proxy; | ||
private buffer; | ||
@@ -14,3 +14,3 @@ private cursor; | ||
private pollHandle?; | ||
constructor(id: string, api: WebApiProxy<ServerBufferApi>, state: WebStateProxy<ServerBufferState>); | ||
constructor(id: string, proxy: WebProxy<ServerBufferProxy>); | ||
get playing(): boolean; | ||
@@ -17,0 +17,0 @@ set playing(v: boolean); |
@@ -10,7 +10,7 @@ "use strict"; | ||
var AgTmPlayer = /** @class */ (function () { | ||
function AgTmPlayer(id, api, state) { | ||
function AgTmPlayer(id, proxy) { | ||
var _this = this; | ||
this.state = state; | ||
this.proxy = proxy; | ||
this._speed = (0, AgVueWrap_1.ref)(0); | ||
this._serverTimeRaw = this.state.serverTime().sync(new Date()); | ||
this._serverTimeRaw = this.proxy.serverTime.args().sync(new Date()); | ||
this._serverTime = (0, AgVueWrap_1.ref)(new Date()); | ||
@@ -26,3 +26,3 @@ this.serverTimeCheckpoint = { | ||
this._playing = (0, AgVueWrap_1.ref)(true); | ||
this.buffer = new TmPlayerBuffer_1.AgTmPlayerBuffer(id, api, state); | ||
this.buffer = new TmPlayerBuffer_1.AgTmPlayerBuffer(id, proxy); | ||
this.cursor = new TmPlayerCursor_1.AgTmPlayerCursor(this.buffer); | ||
@@ -29,0 +29,0 @@ (0, AgVueWrap_1.watch)(this._serverTimeRaw, function (v) { |
@@ -1,4 +0,4 @@ | ||
import { WebApiProxy, type WebStateProxy } from 'ag-remote/AgRemoteTypes'; | ||
import { WebProxy } from 'ag-remote/AgRemoteTypes'; | ||
import { TmDelta, TmFrequence } from './AgTypes'; | ||
export type ServerBufferState = { | ||
export type ServerBufferProxy = { | ||
rtRecentDatas: (id: string) => { | ||
@@ -10,4 +10,2 @@ [k: string]: TmDelta; | ||
serverTime: () => Date; | ||
}; | ||
export type ServerBufferApi = { | ||
getHistoryDeltas: (id: string, from: Date, to: Date) => Promise<TmDelta[]>; | ||
@@ -18,5 +16,4 @@ getHistoryFrequence: (id: string, date: Date) => Promise<TmFrequence>; | ||
private id; | ||
private api; | ||
private state; | ||
constructor(id: string, api: WebApiProxy<ServerBufferApi>, state: WebStateProxy<ServerBufferState>); | ||
private proxy; | ||
constructor(id: string, proxy: WebProxy<ServerBufferProxy>); | ||
private pollhandle?; | ||
@@ -23,0 +20,0 @@ start(): void; |
@@ -52,7 +52,6 @@ "use strict"; | ||
var AgTmPlayerBuffer = /** @class */ (function () { | ||
function AgTmPlayerBuffer(id, api, state) { | ||
function AgTmPlayerBuffer(id, proxy) { | ||
var _this = this; | ||
this.id = id; | ||
this.api = api; | ||
this.state = state; | ||
this.proxy = proxy; | ||
this.min = (0, AgVueWrap_1.computed)(function () { | ||
@@ -87,4 +86,4 @@ var lifetime = _this.lifeTime.value; | ||
this.cachedFrequence = (0, AgVueWrap_1.ref)(defaultFrequence); | ||
this.lifeTime = this.state.rtLifeTime(this.id).sync(); | ||
this.recentDatasRaw = this.state.rtRecentDatas(this.id).sync({}); | ||
this.lifeTime = this.proxy.rtLifeTime.args(this.id).sync(); | ||
this.recentDatasRaw = this.proxy.rtRecentDatas.args(this.id).sync({}); | ||
this.recentDatas = (0, AgVueWrap_1.ref)([]); | ||
@@ -120,3 +119,3 @@ this.deltaWatcher = (0, AgVueWrap_1.watch)(this.recentDatasRaw, function (v) { | ||
}); | ||
this.recentFrequence = this.state.rtRecentFrequence(this.id).sync(defaultFrequence); | ||
this.recentFrequence = this.proxy.rtRecentFrequence.args(this.id).sync(defaultFrequence); | ||
} | ||
@@ -156,3 +155,3 @@ AgTmPlayerBuffer.prototype.start = function () { | ||
max = this.max.value; | ||
return [4 /*yield*/, this.api.getHistoryDeltas(this.id, max[0], max[1])]; | ||
return [4 /*yield*/, this.proxy.getHistoryDeltas(this.id, max[0], max[1])]; | ||
case 1: | ||
@@ -191,3 +190,3 @@ deltas = _b.sent(); | ||
_a = this.cachedFrequence; | ||
return [4 /*yield*/, this.api.getHistoryFrequence(this.id, target)]; | ||
return [4 /*yield*/, this.proxy.getHistoryFrequence(this.id, target)]; | ||
case 1: | ||
@@ -194,0 +193,0 @@ _a.value = _b.sent(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72649
1603