а

6.2 typescript declaration file not updated


#1

Hi,

One of the API change was date_format, however, the declaration is not updated.

It is outdated, and still referring to v6.1.0.

Please review, and update.

Probably have some more that wasn’t updated.

Thank you.


#2

Hello Joseph,
Thank you for reporting about that.
We have a bug in our internal tracker that there are some missing types. The dev team will fix it in future updates, but I cannot give you any ETA.
However, if you encounter other missing types, you can list them here, and I will forward them to the dev team.


#3

Hi @ramil

I can’t use it without the correct types right? In that case, I won’t be able to upgrade to 6.2.0?

In that case, I’m losing all the features upgrade in 6.2.0? And there’s no ETA for this?

I can submit a official request if that expedite the process.

– Update
Similar to this, I added a interface to extend the default GanttConfigOptions to add date_format at the moment.

Thanks.


#4

Hello Joseph,
If you use Angular, as a workaround, you can add the following string to allow any types for Gantt:

declare let gantt: any;

When the dev team adds the missing types, you can remove that string.


#5

Hi @ramil,

Setting to any will lose all typings, so I think extending now probably better as a temporary solution.


#6

Hi @ramil,

Missing marker_class in gantt.templates too.


#7

Hi,

Based on this sample.

$container is not inside the typing as well.


#8

Hi,

The typing for scrollTo is defined as

scrollTo(x: number, y: number)

But according to the documentation in here, it states to define null if x or y is not in use.

It’s not possible to pass in null though. I passed in 0 and it seem to be working as the same as far as I can tell.

Please advise.


#9

Hello Joseph,
Thank you for sharing that information. I added it in the tracker.
Unfortunately, I cannot reproduce the issue with the scrollTo method:
http://snippet.dhtmlx.com/5466cc2e6

If you do that from the web console and it doesn’t work, it is strange, but it is hard to suggest what might be wrong as I couldn’t reproduce the issue and I don’t see your code.
If you use it in a function, you need to check that the function is actually called. If it happens in Angular, maybe it is not allowing to pass the value with a different type.


#10

Hi @ramil,

I’m using Typescript.

It’s not an issue per say, it’s more of the type definition.

You define the function scrollTo with 2 parameters that takes in only number.
So I cannot pass in scrollTo(5, null) or scrollTo(null, 5) since null is not a number by definition.

Hence, if scrollTo method can take in null, then it should be defined as scrollTo(x: number | null, y: number | null). This way, I will be able to then pass in null as the argument. Otherwise, if it has to be strictly only number, then your documentation should update to state that?

Otherwise, is there is different with passing scrollTo(5, 0) and scrollTo(5, null)`, is it doing the same thing?


You can visit Typescript Playground, then put in the following.

function scrollTo(x: number, y: number) {
    console.log(x, y);
}

scrollTo(null, 2); // Complains 'Argument of type 'null' is not assignable to parameter of type 'number'.'

#11

Hello Joseph,
Thank you for the clarification and tips. I will forward your tips to the dev team.

Otherwise, is there is different with passing scrollTo(5, 0) and scrollTo(5, null)`, is it doing the same thing?

You can use gantt.scrollTo(5, 0)command instead of gantt.scrollTo(5, null). I didn’t test it in all possible scenarios, but it works correctly in snippets.


#12

Hi @ramil,

I am currently pass 0 instead of null and seem to be quite alright at the moment.

Perhaps 0 might be a better way to pass in as args rather than null. This way, the typing does not need to change. Just the documentation to reflect correctly.

Hopefully all the typing issue could be updated as soon as possible.

Thanks again, will report any more findings here.


#13

Hi @ramil,

Was wondering if the recent release of 6.3.x has any update to correcting the type definitions?


#14

Hello Joseph,
Unfortunately, that bug has not yet been fixed.