From 408fa8ee325764513939aff48fa92c2d976791d6 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 22 Apr 2016 19:46:53 +0100 Subject: [PATCH] Added missing definition files --- .../src/authentication.service.d.ts | 40 +++++++++++++++++++ .../src/login.component.d.ts | 19 ++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/ng2-components/ng2-alfresco-login/src/authentication.service.d.ts b/ng2-components/ng2-alfresco-login/src/authentication.service.d.ts index 5ab310a645..664d5214f5 100644 --- a/ng2-components/ng2-alfresco-login/src/authentication.service.d.ts +++ b/ng2-components/ng2-alfresco-login/src/authentication.service.d.ts @@ -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|Observable} + */ login(method: string, username: string, password: string): Observable; + /** + * The method provide the login with GET Request + * @param username + * @param password + * @returns {Observable|Observable} + */ loginGet(username: string, password: string): Observable; + /** + * The method provide the login with POST Request + * @param username + * @param password + * @returns {Observable|Observable} + */ loginPost(username: string, password: string): Observable; + /** + * 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} + */ logout(): Observable; + /** + * The method write the error in the console browser + * @param error + * @returns {ErrorObservable} + */ private handleError(error); } diff --git a/ng2-components/ng2-alfresco-login/src/login.component.d.ts b/ng2-components/ng2-alfresco-login/src/login.component.d.ts index 25613d1e0d..2b50963410 100644 --- a/ng2-components/ng2-alfresco-login/src/login.component.d.ts +++ b/ng2-components/ng2-alfresco-login/src/login.component.d.ts @@ -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; }