From 01fff80c3686f3bd2b7757bc302eac894c858274 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Wed, 10 Jul 2024 14:00:03 -0400 Subject: [PATCH] refactor: introduce type `MeiData` Refs: #105 --- src/Editor/MeiTools.ts | 5 +++-- src/Types.ts | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Editor/MeiTools.ts b/src/Editor/MeiTools.ts index 92231ec..057a796 100644 --- a/src/Editor/MeiTools.ts +++ b/src/Editor/MeiTools.ts @@ -1,9 +1,10 @@ import Handsontable from 'handsontable'; import { updateStatus } from './ValidationTools'; import * as Notification from '../utils/Notification'; +import { MeiData } from '../Types'; export class MeiTools { - private meiData: any[]; + private meiData: MeiData; public validationInProgress = false; public pendingValidations = 0; public hasInvalid = false; @@ -18,7 +19,7 @@ export class MeiTools { const mei = row[inputMeiHeader]; if (mei) { this.meiData.push({ - mei, + mei: mei, row: rowIndex, isValid: null, errorMsg: null, diff --git a/src/Types.ts b/src/Types.ts index 4e47efa..87bcad8 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -74,3 +74,10 @@ export type TableEvent = | 'afterRemoveRow' | 'afterRowMove' | 'afterRowSequenceChange'; + +export type MeiData = { + mei: string; + row: number; + isValid: boolean | null; + errorMsg: string | null; +}[];