Create ion.rangeSlider.d.ts

This commit is contained in:
Douglas Eichelberger
2014-07-25 11:40:02 -07:00
committed by dduugg
parent 570b760130
commit 1cdae538ab
3 changed files with 90 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ All definitions files include a header with the author and editors, so at some p
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [interact.js](http://github.com/taye/interact.js) (by [Douglas Eichelberger](https://github.com/dduugg))
* [Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) (by [Douglas Eichelberger](https://github.com/dduugg))
* [Ionic-Cordova](https://github.com/driftyco/) (by [Hendrik Maus](https://github.com/hendrikmaus))
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski))
* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek))

View File

@@ -0,0 +1,38 @@
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="ion.rangeSlider.d.ts"/>
var sliderInputElement = $('<input />');
sliderInputElement.ionRangeSlider({
min: 10,
max: 100,
from: 30,
to: 80,
type: "single",
step: 10,
prefix: "$",
postfix: ".00",
maxPostfix: "+",
hasGrid: true,
hideMinMax: true,
hideFromTo: true,
prettify: true,
disable: false,
values: ["a", "b", "c"],
onLoad: function (obj) {
console.log(obj);
},
onChange: function (obj) {
console.log(obj);
},
onFinish: function (obj) {
console.log(obj);
}
});
sliderInputElement.ionRangeSlider("update", {
min: 20,
max: 90,
from: 40,
to: 70,
step: 5
});
sliderInputElement.ionRangeSlider("remove");

51
ion.rangeSlider/ion.rangeSlider.d.ts vendored Normal file
View File

@@ -0,0 +1,51 @@
// Type definitions for for Ion.RangeSlider 1.9.1
// Project: https://github.com/IonDen/ion.rangeSlider/
// Definitions by: Douglas Eichelberger <https://github.com/dduugg>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// API documentation: http://ionden.com/a/plugins/ion.rangeSlider/en.html
interface JQuery {
ionRangeSlider(): JQuery;
ionRangeSlider(options: IonRangeSliderOptions): JQuery;
ionRangeSlider(method: string): JQuery;
ionRangeSlider(method: string, options: IonRangeSliderOptions): JQuery;
}
interface IonRangeSliderOptions {
disable?: boolean;
from?: number;
hasGrid?: boolean;
hideFromTo?: boolean;
hideMinMax?: boolean;
max?: number;
maxPostfix?: string;
min?: number;
onChange?: (obj: IonRangeSliderEvent) => void;
onFinish?: (obj: IonRangeSliderEvent) => void;
onLoad?: (obj: IonRangeSliderEvent) => void;
postfix?: string;
prefix?: string;
prettify?: boolean;
step?: number;
to?: number;
type?: string;
values?: any[];
}
interface IonRangeSliderEvent {
fromNumber: number;
fromPers: number;
fromValue?: any;
fromX: number;
fromX_pure?: number;
input: JQuery;
max: number;
min: number;
slider: JQuery;
toNumber: number;
toPers: number;
toValue?: number;
toX: number;
toX_pure?: number;
}