mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
updated extended-listbox to 2.0.0 (#14879)
This commit is contained in:
committed by
Mohamed Hegazy
parent
a971970e93
commit
8d1cf56e25
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
var $test = $("#test");
|
||||
|
||||
@@ -126,54 +125,3 @@ instance.onItemEnterPressed((event: ListboxEvent) => {
|
||||
instance.onItemDoubleClicked((event: ListboxEvent) => {
|
||||
console.log(event.args);
|
||||
});
|
||||
|
||||
|
||||
|
||||
/////// LEGACY API ///////
|
||||
|
||||
// Add string item
|
||||
instance.target.listbox("addItem", "Test2");
|
||||
|
||||
|
||||
// Add item
|
||||
var item: ListboxItem = <ListboxItem>{};
|
||||
item.selected = true;
|
||||
item.disabled = false;
|
||||
item.childItems = ["Test4"];
|
||||
item.groupHeader = false;
|
||||
item.id = "ouetioreit";
|
||||
item.index = 0;
|
||||
item.text = "Test3";
|
||||
var id: string = instance.target.listbox("addItem", item);
|
||||
|
||||
|
||||
// Remove item
|
||||
instance.target.listbox("removeItem", id);
|
||||
|
||||
|
||||
// Get item
|
||||
var i: ListboxItem = instance.target.listbox("getItem", id);
|
||||
|
||||
|
||||
// Get items
|
||||
var allItems: ListboxItem[] = instance.target.listbox("getItems");
|
||||
|
||||
|
||||
// Move item up
|
||||
var newIndex: number = instance.target.listbox("moveItemUp", i.id);
|
||||
|
||||
|
||||
// Move item down
|
||||
newIndex = instance.target.listbox("moveItemDown", i.id);
|
||||
|
||||
|
||||
// Clear selection
|
||||
instance.target.listbox("clearSelection");
|
||||
|
||||
|
||||
// Enable
|
||||
instance.target.listbox("enable", false);
|
||||
|
||||
|
||||
// Destroy
|
||||
instance.target.listbox("destroy");
|
||||
|
||||
Vendored
+1
-36
@@ -1,10 +1,8 @@
|
||||
// Type definitions for extended-listbox 1.1.x
|
||||
// Type definitions for extended-listbox 2.0.x
|
||||
// Project: https://github.com/code-chris/extended-listbox
|
||||
// Definitions by: Christian Kotzbauer <https://github.com/code-chris>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
interface ListboxItem {
|
||||
/** display text */
|
||||
text?: string;
|
||||
@@ -147,37 +145,4 @@ interface JQuery {
|
||||
|
||||
/** constructs a new instance of Listbox on the given DOM item */
|
||||
listbox(options: ListBoxOptions): ExtendedListboxInstance|ExtendedListboxInstance[];
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'addItem'): string;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'removeItem'): void;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'destroy'): void;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'getItem'): ListboxItem;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'getItems'): ListboxItem[];
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'moveItemUp'): number;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'moveItemDown'): number;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'clearSelection'): void;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: 'enable'): void;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: string): any;
|
||||
|
||||
/** @deprecated: use method in ExtendedListboxInstance */
|
||||
listbox(methodName: string, methodParameter: any): any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user