ANovokmet / svelte-gantt

:calendar: Interactive JavaScript Gantt chart/resource booking component

Home Page:https://anovokmet.github.io/svelte-gantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RowModel Types

aliyss opened this issue Β· comments

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

In my opinion the types I'm using seem to be working.
I'm not sure about the id. Afaik it can be a string too.

label is defined in the README but missing in the interface.
height works fine without providing it. So I will assume it's optional.

Aliyss

Here is the diff that solved my problem:

diff --git a/node_modules/svelte-gantt/types/core/row.d.ts b/node_modules/svelte-gantt/types/core/row.d.ts
index a2469e2..5e65ca3 100644
--- a/node_modules/svelte-gantt/types/core/row.d.ts
+++ b/node_modules/svelte-gantt/types/core/row.d.ts
@@ -1,9 +1,10 @@
 export interface RowModel {
-    id: number;
+    id: number | string;
+    label: string;
     classes?: string | string[];
     contentHtml?: string;
     enableDragging?: boolean;
-    height: number;
+    height?: number;
     /** Child rows in expandable tree */
     children?: RowModel[];
     /** Content of row header, html string */
commented

Basically your issue is a pull request ? πŸ˜„ I'll look into it and integrate it asap