Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#6388 from maeg02/master
Browse files Browse the repository at this point in the history
Select2 has two template functions
  • Loading branch information
horiuchi committed Oct 23, 2015
2 parents 44cbde4 + 26d1679 commit 3191f6e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions select2/select2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ interface Select2Options {
dropdownCssClass?: any;
escapeMarkup?: (markup: string) => string;
theme?: string;
/**
* Template can return both plain string that will be HTML escaped and a jquery object that can render HTML
*/
templateSelection?: (object: Select2SelectionObject) => any;
templateResult?: (object: Select2SelectionObject) => any;
}

interface Select2JQueryEventObject extends JQueryEventObject {
Expand All @@ -84,6 +89,15 @@ interface Select2JQueryEventObject extends JQueryEventObject {
};
}

interface Select2SelectionObject {
disabled: boolean,
element: HTMLOptionElement,
id: string,
selected: boolean,
text: string,
title: string,
}

interface JQuery {
off(events?: "change", selector?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery;

Expand Down

0 comments on commit 3191f6e

Please sign in to comment.