mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #3271 from adidahiya/selectize
Improve selectize.js API typings
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="selectize.d.ts" />
|
||||
|
||||
// All code examples taken from https://github.com/brianreavis/selectize.js/blob/master/examples
|
||||
var $input = $(".test-input").selectize();
|
||||
var testApi = $input[0].selectize;
|
||||
|
||||
function changeListener(selection: string) {
|
||||
console.log(selection);
|
||||
}
|
||||
|
||||
testApi.on("change", changeListener);
|
||||
testApi.off("change", changeListener);
|
||||
testApi.off("change");
|
||||
|
||||
// All code examples below taken from https://github.com/brianreavis/selectize.js/blob/master/examples
|
||||
|
||||
// API example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+3
-8
@@ -445,17 +445,12 @@ declare module Selectize {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*/
|
||||
on(eventName: string, handler: (event: JQueryEventObject) => any): void;
|
||||
on(eventName: string, handler: Function): void;
|
||||
|
||||
/**
|
||||
* Removes an event listener.
|
||||
* Removes an event listener. If no handler is provided, all event listeners are removed.
|
||||
*/
|
||||
off(eventName: string, handler: (event: JQueryEventObject) => any): void;
|
||||
|
||||
/**
|
||||
* Removes all event listeners.
|
||||
*/
|
||||
off(eventName: string): void;
|
||||
off(eventName: string, handler?: Function): void;
|
||||
|
||||
/**
|
||||
* Triggers event listeners.
|
||||
|
||||
Reference in New Issue
Block a user