I propose a fix in TypeScript definition files from:
class DropDownList extends kendo.ui.Widget {
static fn: DropDownList;
options: DropDownListOptions;
dataSource: kendo.data.DataSource;
span: JQuery;
filterInput: JQuery;
list: JQuery;
ul: JQuery;
element: JQuery;
wrapper: JQuery;
static extend(proto: Object): DropDownList;
constructor(element: Element, options?: DropDownListOptions);
close(): void;
dataItem(index?: JQuery): any;
dataItem(index?: number): any;
destroy(): void;
focus(): void;
items(): any;
enable(enable: boolean): void;
open(): void;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
select(): number;
select(li: JQuery): void;
select(li: number): void;
select(li: Function): void;
setDataSource(dataSource: kendo.data.DataSource): void;
text(): string;
text(text: string): void;
toggle(toggle: boolean): void;
value(): string;
value(value: string): void;
}
to:
class DataBoundWidget extends Widget
{
dataSource: kendo.data.DataSource;
//or where it should be
}
class List extends DataBoundWidget
{
dataItem(index?: JQuery): any;
//or where it should be
dataItem(index?: number): any;
//or where it should be
}
class Select extends List
{
setDataSource(dataSource: kendo.data.DataSource): void;
//or where it should be
}
class DropDownList extends Select
{
static fn: DropDownList;
options: DropDownListOptions;
span: JQuery;
filterInput: JQuery;
list: JQuery;
ul: JQuery;
element: JQuery;
wrapper: JQuery;
static extend(proto: Object): DropDownList;
constructor(element: Element, options?: DropDownListOptions);
close(): void;
destroy(): void;
focus(): void;
items(): any;
enable(enable: boolean): void;
open(): void;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
select(): number;
select(li: JQuery): void;
select(li: number): void;
select(li: Function): void;
text(): string;
text(text: string): void;
toggle(toggle: boolean): void;
value(): string;
value(value: string): void;
}
This should make sense, since all widgets does not inherits from kendo.ui.widget as your kendo.all.d.ts file defines.
I need a type for variable that lists all widgets that implements dataSource property. I don't want to write:
function
myFunction(implementDataSource: kendo.ui.ListView | kendo.ui.DropDownList | kendo.ui.ComboBox | kendo.ui.Grid | kendo.ui...)
{
implementsDataSource.dataSource.data(something);
}