mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Added tests file. Bugfixes on definitions
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
function basicTest() {
|
||||
$('#magicSuggest').magicSuggest();
|
||||
}
|
||||
|
||||
function testWithConfigurationOptions() {
|
||||
$('#magicSuggest').magicSuggest({
|
||||
data: [
|
||||
{ id: 1, name: "Buenos Aires" },
|
||||
{ id: 2, name: "New York" },
|
||||
{ id: 3, name: "Madrid" },
|
||||
],
|
||||
maxDropHeight: 500,
|
||||
maxSelection: 2,
|
||||
expandOnFocus: true,
|
||||
});
|
||||
}
|
||||
|
||||
function testSomeMethods() {
|
||||
var ms = $('#magicSuggest').magicSuggest();
|
||||
ms.addToSelection([{ id: 1, name: "Mexico" }]);
|
||||
console.info(ms.getSelection());
|
||||
ms.disable()
|
||||
}
|
||||
Vendored
+5
-2
@@ -5,7 +5,10 @@
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
interface JQuery {
|
||||
magicSuggest: (configurationObject: MagicSuggest.Configuration) => MagicSuggest.Instance;
|
||||
/**
|
||||
* Initialize MagicSuggest on this selector
|
||||
*/
|
||||
magicSuggest(configurationObject?: MagicSuggest.Configuration): MagicSuggest.Instance;
|
||||
}
|
||||
|
||||
declare module MagicSuggest {
|
||||
@@ -460,4 +463,4 @@ declare module MagicSuggest {
|
||||
setDataUrlParams(params: any): void;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user