add angular-http-auth definitions

This commit is contained in:
vvakame
2014-10-21 14:49:03 +09:00
parent 59b63ac939
commit f4b502ceac
3 changed files with 35 additions and 1 deletions
@@ -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
View File
@@ -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;
}
}