ag-timemachine
Advanced tools
Comparing version 1.0.9 to 1.0.10
import type { Db } from "mongodb"; | ||
import { ServerBufferApi } from "./TmPlayerBuffer"; | ||
import { ServerBufferApi, ServerBufferState } from "./TmPlayerBuffer"; | ||
export declare class AgTimeMachine { | ||
@@ -13,2 +13,3 @@ private _db; | ||
bufferApi: ServerBufferApi; | ||
bufferState: ServerBufferState; | ||
} |
20
index.js
@@ -49,11 +49,2 @@ "use strict"; | ||
this.bufferApi = { | ||
rtRecentDatas: function (id) { | ||
return _this.getObject(id).recentDatas.value; | ||
}, | ||
rtRecentFrequence: function (id) { | ||
return _this.getObject(id).recentFrequence.value; | ||
}, | ||
rtLifeTime: function (id) { | ||
return _this.getObject(id).lifetime.value; | ||
}, | ||
getHistoryDeltas: function (id, from, to) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -78,2 +69,13 @@ return __generator(this, function (_a) { | ||
}; | ||
this.bufferState = { | ||
rtRecentDatas: function (id) { | ||
return _this.getObject(id).recentDatas.value; | ||
}, | ||
rtRecentFrequence: function (id) { | ||
return _this.getObject(id).recentFrequence.value; | ||
}, | ||
rtLifeTime: function (id) { | ||
return _this.getObject(id).lifetime.value; | ||
}, | ||
}; | ||
} | ||
@@ -80,0 +82,0 @@ AgTimeMachine.prototype.init = function () { |
{ | ||
"name": "ag-timemachine", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,3 +0,3 @@ | ||
import { WebStateProxy } from "ag-remote/AgRemoteTypes"; | ||
import { ServerBufferApi, AgTmPlayerBuffer } from "./TmPlayerBuffer"; | ||
import { WebApiProxy, WebStateProxy } from "ag-remote/AgRemoteTypes"; | ||
import { ServerBufferApi, AgTmPlayerBuffer, ServerBufferState } from "./TmPlayerBuffer"; | ||
import { AgPoll } from "ag-utilities/AgPoll"; | ||
@@ -8,3 +8,3 @@ import { AgTmPlayerCursor } from "./TmPlayerCursor"; | ||
cursor: AgTmPlayerCursor; | ||
constructor(id: string, api: WebStateProxy<ServerBufferApi>); | ||
constructor(id: string, api: WebApiProxy<ServerBufferApi>, state: WebStateProxy<ServerBufferState>); | ||
pollHandle?: ReturnType<typeof AgPoll.poll>; | ||
@@ -11,0 +11,0 @@ speed: import("vue").Ref<number>; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var AgTmPlayer = /** @class */ (function () { | ||
function AgTmPlayer(id, api) { | ||
function AgTmPlayer(id, api, state) { | ||
this.speed = (0, AgVueWrap_1.ref)(0); | ||
@@ -18,3 +18,3 @@ this.checkpoint = (0, AgVueWrap_1.ref)({ | ||
this.play = (0, AgVueWrap_1.ref)(true); | ||
this.buffer = new TmPlayerBuffer_1.AgTmPlayerBuffer(id, api); | ||
this.buffer = new TmPlayerBuffer_1.AgTmPlayerBuffer(id, api, state); | ||
this.cursor = new TmPlayerCursor_1.AgTmPlayerCursor(this.buffer); | ||
@@ -21,0 +21,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import { type WebStateProxy } from 'ag-remote/AgRemoteTypes'; | ||
import { WebApiProxy, type WebStateProxy } from 'ag-remote/AgRemoteTypes'; | ||
import { TmData, TmDelta, TmFrequence } from './AgTypes'; | ||
export type ServerBufferApi = { | ||
export type ServerBufferState = { | ||
rtRecentDatas: (id: string) => { | ||
@@ -9,2 +9,4 @@ [k: number]: TmData; | ||
rtLifeTime: (id: string) => ([Date, Date] | undefined); | ||
}; | ||
export type ServerBufferApi = { | ||
getHistoryDeltas: (id: string, from: Date, to: Date) => Promise<TmDelta[]>; | ||
@@ -16,3 +18,4 @@ getHistoryFrequence: (id: string, date: Date) => Promise<TmFrequence>; | ||
private api; | ||
constructor(id: string, api: WebStateProxy<ServerBufferApi>); | ||
private state; | ||
constructor(id: string, api: WebApiProxy<ServerBufferApi>, state: WebStateProxy<ServerBufferState>); | ||
private pollhandle?; | ||
@@ -19,0 +22,0 @@ start(): void; |
@@ -52,6 +52,7 @@ "use strict"; | ||
var AgTmPlayerBuffer = /** @class */ (function () { | ||
function AgTmPlayerBuffer(id, api) { | ||
function AgTmPlayerBuffer(id, api, state) { | ||
var _this = this; | ||
this.id = id; | ||
this.api = api; | ||
this.state = state; | ||
this.min = (0, AgVueWrap_1.computed)(function () { | ||
@@ -86,6 +87,6 @@ var lifetime = _this.lifeTime.value; | ||
this.cachedFrequence = (0, AgVueWrap_1.ref)(defaultFrequence); | ||
this.lifeTime = this.api.rtLifeTime(this.id).sync(); | ||
this.recentDatasRaw = this.api.rtRecentDatas(this.id).sync([]); | ||
this.lifeTime = this.state.rtLifeTime(this.id).sync(); | ||
this.recentDatasRaw = this.state.rtRecentDatas(this.id).sync([]); | ||
this.recentDatas = (0, AgVueWrap_1.computed)(function () { return Object.values(_this.recentDatasRaw.value); }); | ||
this.recentFrequence = this.api.rtRecentFrequence(this.id).sync(defaultFrequence); | ||
this.recentFrequence = this.state.rtRecentFrequence(this.id).sync(defaultFrequence); | ||
} | ||
@@ -125,3 +126,3 @@ AgTmPlayerBuffer.prototype.start = function () { | ||
max = this.max.value; | ||
return [4 /*yield*/, this.api.getHistoryDeltas(this.id, max[0], max[1]).call()]; | ||
return [4 /*yield*/, this.api.getHistoryDeltas(this.id, max[0], max[1])]; | ||
case 1: | ||
@@ -160,3 +161,3 @@ deltas = _b.sent(); | ||
_a = this.cachedFrequence; | ||
return [4 /*yield*/, this.api.getHistoryFrequence(this.id, target).call()]; | ||
return [4 /*yield*/, this.api.getHistoryFrequence(this.id, target)]; | ||
case 1: | ||
@@ -163,0 +164,0 @@ _a.value = _b.sent(); |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
70097
1507
1