From 8b77a42f313e6514a4634dcad988dd2fea6bdee6 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sat, 15 Oct 2022 17:54:32 +1100 Subject: Pass TimeLine offsets to BaseLine Add TimelineState --- src/lib.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/lib.ts') diff --git a/src/lib.ts b/src/lib.ts index bd81a8d..54dffc5 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -268,10 +268,22 @@ export function getScaleRatio(scale: number, scale2: number){ } // For sending timeline-bound data to BaseLine -export type TimelineRange = { - id: number, - start: HistDate, - end: HistDate, +export class TimelineState { + id: number; + startDate: HistDate; + endDate: HistDate; + startOffset: number | null; + endOffset: number | null; + scaleIdx: number | null; + constructor(id: number, startDate: HistDate, endDate: HistDate, + startOffset: number | null = null, endOffset: number | null = null, scaleIdx: number | null = null){ + this.id = id; + this.startDate = startDate; + this.endDate = endDate; + this.startOffset = startOffset; + this.endOffset = endOffset; + this.scaleIdx = scaleIdx; + } }; export type HistEvent = { -- cgit v1.2.3