Added missing definition files

This commit is contained in:
Denys Vuika
2016-04-22 19:46:53 +01:00
parent 379003010b
commit 408fa8ee32
2 changed files with 58 additions and 1 deletions

View File

@@ -5,12 +5,52 @@ export declare class Authentication {
token: string;
private _host;
private _baseUrl;
/**
* Constructor
* @param http
*/
constructor(http: Http);
/**
* The method return tru if the user is logged in
* @returns {boolean}
*/
isLoggedIn(): boolean;
/**
* Method to delegate GET or POST login
* @param method
* @param username
* @param password
* @returns {Observable<R>|Observable<T>}
*/
login(method: string, username: string, password: string): Observable<void>;
/**
* The method provide the login with GET Request
* @param username
* @param password
* @returns {Observable<R>|Observable<T>}
*/
loginGet(username: string, password: string): Observable<void>;
/**
* The method provide the login with POST Request
* @param username
* @param password
* @returns {Observable<R>|Observable<T>}
*/
loginPost(username: string, password: string): Observable<void>;
/**
* The method save the toke in the localStorage
* @param jwt
*/
saveJwt(jwt: any): void;
/**
* The method remove the token from the local storage
* @returns {Observable<T>}
*/
logout(): Observable<boolean>;
/**
* The method write the error in the console browser
* @param error
* @returns {ErrorObservable}
*/
private handleError(error);
}

View File

@@ -4,9 +4,26 @@ import { Authentication } from './authentication.service';
export declare class Login {
auth: Authentication;
router: Router;
method: string;
form: ControlGroup;
error: boolean;
isErrorStyle(field: ControlGroup): boolean;
/**
* Constructor
* @param fb
* @param auth
* @param router
*/
constructor(fb: FormBuilder, auth: Authentication, router: Router);
/**
* Method called on submit form
* @param value
* @param event
*/
onSubmit(value: any, event: any): void;
/**
* The method return if a field is valid or not
* @param field
* @returns {boolean}
*/
isErrorStyle(field: ControlGroup): boolean;
}