diff --git a/Definitions/spin-1.2.d.ts b/Definitions/spin-1.2.d.ts new file mode 100644 index 000000000..6e0a368d2 --- /dev/null +++ b/Definitions/spin-1.2.d.ts @@ -0,0 +1,30 @@ +// Type definitions for Spin.js 1.2 +// Project: http://fgnass.github.com/spin.js/ +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface SpinnerOptions { + lines?: number; // The number of lines to draw + length?: number; // The length of each line + width?: number; // The line thickness + radius?: number; // The radius of the inner circle + corners?: number; // Corner roundness (0..1) + rotate?: number; // The rotation offset + color?: string; // #rgb or #rrggbb + speed?: number; // Rounds per second + trail?: number; // Afterglow percentage + shadow?: bool; // Whether to render a shadow + hwaccel?: bool; // Whether to use hardware acceleration + className?: string; // The CSS class to assign to the spinner + zIndex?: number; // The z-index (defaults to 2000000000) + top?: string; // Top position relative to parent in px + left?: string; // Left position relative to parent in px +} + + +class Spinner { + constructor (options?: SpinnerOptions); + spin(target?: any); + stop(); + lines(el, o); + opacity(el, i, val); +} \ No newline at end of file diff --git a/README.md b/README.md index 47127c5da..8987ffd8b 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Complete * [Node.js](http://nodejs.org/) (from TypeScript samples) * [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei)) * [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall)) +* [Spin](http://fgnass.github.com/spin.js/) * [Underscore.js](http://underscorejs.org/) Next @@ -34,9 +35,11 @@ Next * jQuery Mobile * jQuery.Validate * Knockout.Mapping +* Meteor * PhoneGap * Isotope * ember.js +* Zepto Node Modules Definitions ------------------------ diff --git a/Tests/spin-tests.ts b/Tests/spin-tests.ts new file mode 100644 index 000000000..2b85bf447 --- /dev/null +++ b/Tests/spin-tests.ts @@ -0,0 +1,8 @@ +/// + +var spinner = new Spinner().spin(); +target.appendChild(spinner.el); + +var target = document.getElementById('foo'); +var opts = { speed: 5, className: 'awesome' }; +var spinner2 = new Spinner(opts).spin(target); \ No newline at end of file