Kendo-ui-core: Kendo typings error using TypeScript 2.5.2 -> DataSourceTransportWithFunctionOperations

Created on 4 Sep 2017  路  15Comments  路  Source: telerik/kendo-ui-core

Error:(1199, 15) TS2430:Interface 'DataSourceTransportWithFunctionOperations' incorrectly extends interface 'DataSourceTransport'.
Types of property 'create' are incompatible.
Type '(options: DataSourceTransportOptions) => void' has no properties in common with type 'DataSourceTransportCreate'.

Bug

Most helpful comment

It looks like you can resolve this issue by replacing the interface DataSourceTransport with this code:

````
interface DataSourceTransport {
create?: DataSourceTransportCreate | ((options: DataSourceTransportOptions) => void);
destroy?: DataSourceTransportDestroy | ((options: DataSourceTransportOptions) => void);
push?: Function;
read?: DataSourceTransportRead | ((options: DataSourceTransportOptions) => void);
signalr?: DataSourceTransportSignalr | ((options: DataSourceTransportOptions) => void);
update?: DataSourceTransportUpdate | ((options: DataSourceTransportOptions) => void);

    parameterMap?(data: DataSourceTransportParameterMapData, type: string): any;
}

````

I figured this out by installing the latest copy of the Kendo UI typings file from DefinitelyTyped using npm, and then doing a diff between the index.d.ts file and the copy of the kendo.all.d.ts file that I had in my project (I had an old version too, mine was v2016.3.1118). By comparing the interface signatures, I found how they fixed it in the newest Kendo UI typings file and the fix looked just fine / backwards compatible.

Here is how I got the typings file from DefinitelyTyped:

npm install @types/kendo-ui

When I was done, I removed the npm types version since my project uses the older version of the Kendo UI libraries and I didn't want it automatically picking up that version in my typescript build process.

npm remove @types/kendo-ui

It's a pain having old projects that are falling behind in the Kendo UI releases, and the rest of the ecosystem changes so fast it is breaking old stuff.

I also used this technique to find some other minor fixes (like fixing some error I had about the Dialog, Confirm, Prompt options) as well.

Hope that helps!

All 15 comments

Same problem.

Same problem. Did you find a solution?

I just commented out the offending interface as we don't use it. I'll have to do this each time we upgrade until it's fixed at source

For what it's worth, I just update the kendo.all.d.ts file and the problem has gone however it's now complaining about other interfaces.

It looks like you can resolve this issue by replacing the interface DataSourceTransport with this code:

````
interface DataSourceTransport {
create?: DataSourceTransportCreate | ((options: DataSourceTransportOptions) => void);
destroy?: DataSourceTransportDestroy | ((options: DataSourceTransportOptions) => void);
push?: Function;
read?: DataSourceTransportRead | ((options: DataSourceTransportOptions) => void);
signalr?: DataSourceTransportSignalr | ((options: DataSourceTransportOptions) => void);
update?: DataSourceTransportUpdate | ((options: DataSourceTransportOptions) => void);

    parameterMap?(data: DataSourceTransportParameterMapData, type: string): any;
}

````

I figured this out by installing the latest copy of the Kendo UI typings file from DefinitelyTyped using npm, and then doing a diff between the index.d.ts file and the copy of the kendo.all.d.ts file that I had in my project (I had an old version too, mine was v2016.3.1118). By comparing the interface signatures, I found how they fixed it in the newest Kendo UI typings file and the fix looked just fine / backwards compatible.

Here is how I got the typings file from DefinitelyTyped:

npm install @types/kendo-ui

When I was done, I removed the npm types version since my project uses the older version of the Kendo UI libraries and I didn't want it automatically picking up that version in my typescript build process.

npm remove @types/kendo-ui

It's a pain having old projects that are falling behind in the Kendo UI releases, and the rest of the ecosystem changes so fast it is breaking old stuff.

I also used this technique to find some other minor fixes (like fixing some error I had about the Dialog, Confirm, Prompt options) as well.

Hope that helps!

@sixdimensionalarray Your solution works. It looks like they fixed this in the DefinitelyTyped repo, but they just didn't push it to NPM yet. So hopefully they push the fix out soon.

have same problem, but solution above impedes CI/CD :(

Yes, the issue is fixed in the latest version of the code and in DefinitelyTyped. It will be also included in the package of our next release (R3 2017 SP1) and in npm.

same issue ... not fixed in 2017.3.913

Supporting @ConX-Ryan comment, still not resolved, nor for typescript 2.5.3 (next version)

Note: 2017.3.913 probably isn't R2 2017 SP1, 2017.3.913 was released before @Stamo-Gochev made their comment.

Can you recheck if the issue is still present with the latest version from DefinitelyTyped:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/kendo-ui/index.d.ts#L880-L886

This version can also be tested from npm:
https://www.npmjs.com/package/@types/kendo-ui

The changes in DataSourceTransport are added by a community member in:
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/ecdb51e2bd3b58cb9bda1faedde002f267794f10#diff-6892c3337024d80c66687f1e88553bf2

This fix was not included in the typescript/kendo.all.d.ts file that is shipped with our distribution packages (2017.3.913) that are available for download from the Telerik accounts. The reason for this is that we are syncing the latest version from the kendo repository (which might include TS definitions for new widgets) with the version from DefinitelyTyped and not vice versa.

However, the updates regarding this change are already added to the kendo repository as well and this is why they will be included in our packages for R3 2017 SP1 (or latest internal builds).

For reference, this error still occurs in the latest "kendo-ui.TypeScript.DefinitelyTyped" NuGet package (v0.2.5).
It's fixed in npm @types/kendo-ui v2017.3.1.

In addition to that fix not in the NuGet package v0.2.5, many widgets do not properly extend kendo.ui.Dialog. I had to go in and add " extends kendo.ui.DialogMessages/Options/Alerts" to several subclasses.

Thank you, @pmcintyre3.

Do you plan to make a PR? 馃檹 馃槃

I can certainly do that when I get a chance this weekend.

Was this page helpful?
0 / 5 - 0 ratings