aboutsummaryrefslogtreecommitdiff
path: root/src/lib.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-15 17:54:32 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-15 17:54:32 +1100
commit8b77a42f313e6514a4634dcad988dd2fea6bdee6 (patch)
treec092ceb1379f11edb43a19d6a7060a9fe743c77f /src/lib.ts
parent48adb0e668d1118b6c5ef4a8bfb479ef10113813 (diff)
Pass TimeLine offsets to BaseLine
Add TimelineState
Diffstat (limited to 'src/lib.ts')
-rw-r--r--src/lib.ts20
1 files changed, 16 insertions, 4 deletions
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 = {