Skip to content

Commit

Permalink
add angular-http-auth definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
vvakame committed Oct 21, 2014
1 parent 59b63ac commit f4b502c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All definitions files include a header with the author and editors, so at some p
* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal))
* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27))
* [angular-http-auth](https://github.com/witoldsz/angular-http-auth) (by [vvakame](https://github.com/vvakame))
* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong))
* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted))
Expand Down Expand Up @@ -317,7 +318,7 @@ All definitions files include a header with the author and editors, so at some p
* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura))
* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame))
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613))
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov))
Expand Down
14 changes: 14 additions & 0 deletions angular-http-auth/angular-http-auth-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// <reference path="./angular-http-auth.d.ts" />

(function () {
'use strict';
angular.module('login', ['http-auth-interceptor'])

.controller('LoginController', ($scope:any, $http:any, authService:ng.httpAuth.IAuthService) => {
$scope.submit = () => {
$http.post('auth/login').success(() => {
authService.loginConfirmed();
});
}
});
})();
19 changes: 19 additions & 0 deletions angular-http-auth/angular-http-auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Type definitions for angular-http-auth 1.2.1
// Project: https://github.com/witoldsz/angular-http-auth
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path="../angularjs/angular.d.ts" />

declare module ng.httpAuth {
interface IAuthService {
loginConfirmed(data?:any, configUpdater?:Function):void;
loginCancelled(data?:any, reason?:any):void;
}

interface IHttpBuffer {
append(config:ng.IRequestConfig, deferred:{resolve(data:any):void; reject(data:any):void;}):void;
rejectAll(reason?:any):void;
retryAll(updater?:Function):void;
}
}

0 comments on commit f4b502c

Please sign in to comment.