This is a migrated thread and some comments may be shown as answers.

kendo.all.d.ts errors

4 Answers 206 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
YP
Top achievements
Rank 1
YP asked on 20 Jul 2017, 01:06 PM

Hello,

I added to my project kendo.all.d.ts file (Type definitions for Kendo UI Professional v2017.2.621), but I have bunch of errors.

TypeScript version: 2.4.1

4 Answers, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 21 Jul 2017, 10:44 AM

Hello YP,

Yes, those are due to the "Stricter checks on “weak types”" in 2.4. It is announced here: https://blogs.msdn.microsoft.com/typescript/2017/06/27/announcing-typescript-2-4/

This update has been already addressed and the definitions will stop throwing these errors with the next release. 

For the time being, you can manually change the kendo.all.d.ts file and change the option field of the Dialog class to be of type any, not DialogOptions. 

class Dialog extends kendo.ui.Widget {
 
    static fn: Dialog;
 
    options: any;
 
 
    element: JQuery;
    wrapper: JQuery;
 
    static extend(proto: Object): Dialog;
 
    constructor(element: Element, options?: DialogOptions);
 
 
    close(): kendo.ui.Dialog;
    content(): string;
    content(content?: string): kendo.ui.Dialog;
    content(content?: JQuery): kendo.ui.Dialog;
    destroy(): void;
    open(): kendo.ui.Dialog;
    title(): string;
    title(text?: string): kendo.ui.Dialog;
    toFront(): kendo.ui.Dialog;
 
}

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
YP
Top achievements
Rank 1
answered on 21 Jul 2017, 11:28 AM

Thank you, it works now.

0
Robert
Top achievements
Rank 1
answered on 15 Aug 2017, 09:12 PM

I just wanted to point out that, while this solution appears to fix the problem, the real solution is to properly implement generics and inheritance on the Dialog and DialogOptions classes so that they can be leveraged properly.

On a similar note, are you guys going to start using the new features to use TypeScript against the regular Kendo files? Wouldn't need the d.ts files anymore if you guys started shipping Kendo in TypeScript.

Thanks!


0
Dimitar
Telerik team
answered on 17 Aug 2017, 11:54 AM
Hello Robert,

On the following GitHub issue you can find the public item for the TypeScript definitions generation bug. The item has already been addressed, a fix is implemented and will be available with the next release of Kendo UI (R3 2017 - scheduled for mid September).

Concerning your follow-up questions, for the time being we do not have any plans for shipping Kendo UI in TypeScript.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
YP
Top achievements
Rank 1
Answers by
Ianko
Telerik team
YP
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or