Just upgraded my project to KendoUI 2013.1.319. I used already TypeScript in my project and create a type definition file for KendoUI (which I posted on Uservoice). Thanks for the work done!
I am now using your version of the type definitions, but found some problems.
I attached a zip file with my version and the original 319 version, so you can compare easily.
Some of the problems:
- Missing overloads of functions
- Missing utility functions
- Missing some fields on classes
- Missing Popup and Query classes
Sometimes I added also fields and functions with names starting with underscore.
I know these are considered to be private.
But I needed them in some cases when I derived a class from a Kendo class. So I use them as if they are 'protected' (as we would call it in C#). It is not very elegant to add them to the type definition. Any thoughts how to solve that?
BTW: my additions are far from complete. Sometimes I just added a field with type any to make it just work. Of course I expect you will work them out :-)
Regards, Jaap
5 Answers, 1 is accepted
The Kendo UI TypeScript definition file will include only API which is public and documented in the API reference documentation.
If you need undocumented or private API you can modify our file as you see fit.
Atanas Korchev
the Telerik team
But what about public but undocumented API?
There are very nice functions and classes available which are not documented.
Is it not supported to use them?
E.g. the Query class is very useful when you have a collection of objects and you want to filter or sort them.
Here is my list of problems in the definition file of the documented API:
- kendo.Culture() does not return a string but a Culture object
- kendo.data.binders is not documented but should be because you need it when you add a custom binder, see example of http://docs.kendoui.com/api/framework/binder
- kendo.data.Binder class needs fields bindings and element, else you can't create a custom binder as shown in above mentioned example.
- kendo.ui.plugin function is documented but not in the definition file
- kendo.ui.Widget class needs a constructor else you can't derived a new widget from it.
- the enable parameter of Upload.enable() should be optional. The documentation shows you can call it without parameter.
- kendo.dataViz.registerTheme is not documented, but AFAIK the way to add custom themes
As soon as we document those classes and methods they will appear in the TypeScript definition file. You can expect this to happen for our next official release.
Regards,Atanas Korchev
the Telerik team
Is there an update for the typescript definition file coming regarding this? What is the recommended workaround?
Here is an example which shows how to create a custom MVVM binder:
/// <reference path="jquery.d.ts" />/// <reference path="kendo.all.d.ts" />module kendo.data.binders { export class custom extends kendo.data.Binder { refresh() { var value = this.bindings["custom"].get(); $(this.element).html(value); } }}$(document).ready(function () { var viewModel = kendo.observable({ model: "Custom binder" }); kendo.bind(document.body, viewModel);});And here is the HTML:
<div id="content" data-bind="custom:model"></div>
I have attached a runnable sample project for your reference.
Regards,
Atanas Korchev
Telerik