import { Http, RequestOptions } from '@angular/http'; import { Location } from '@angular/common'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import { Observable } from 'rxjs/Observable'; import { Account } from '../shared/account'; import { AuthToken } from './auth.token'; import { StormpathConfiguration } from './stormpath.config'; import { TokenStoreManager } from './token-store.manager'; export declare class JsonGetOptions extends RequestOptions { constructor(); } export declare class JsonPostOptions extends JsonGetOptions { constructor(); } export declare function defaultSpTokenResolver(location: Location): string; export interface RegistrationFormModel { email?: string; surname?: string; givenName?: string; password?: string; [propName: string]: any; } export interface ForgotPasswordFormModel { email: string; accountStore?: Object; organizationNameKey?: string; } export interface ResendEmailVerificationRequest { login: string; accountStore?: Object; organizationNameKey?: string; } export interface PasswordResetRequest { accountStore?: Object; organizationNameKey?: string; password: string; sptoken: string; } export interface LoginFormModel { login: string; password: string; accountStore?: Object; organizationNameKey?: string; } export interface StormpathErrorResponse { status: number; message: string; } export declare class LoginService { forgot: boolean; login: boolean; register: boolean; constructor(); forgotPassword(): void; } export declare class Stormpath { http: Http; config: StormpathConfiguration; tokenStore: TokenStoreManager; user$: Observable; userSource: ReplaySubject; private currentDomain; private oauthHeaders; constructor(http: Http, config: StormpathConfiguration, tokenStore: TokenStoreManager); /** * Attempts to get the current user by making a request of the /me endpoint. * * @return {Observable} * An observable that will return an Account if the user is logged in, or false * if the user is not logged in. */ getAccount(): Observable; /** * Retrieves the OAuth token data object from storage, relying on its set token * store for the loading implementation details. * @returns {@link AuthToken} */ getToken(): AuthToken; getRegistrationViewModel(): any; /** * Attempts to register a new account by making a POST request to the * /register endpoint. * * @return {Observable} * An observable that will return an Account if the POST was successful. */ register(form: Object): Observable; login(form: LoginFormModel): Observable; logout(): void; resendVerificationEmail(request: ResendEmailVerificationRequest): any; sendPasswordResetEmail(form: ForgotPasswordFormModel): any; resetPassword(form: PasswordResetRequest): any; verifyEmailVerificationToken(sptoken: string): any; verifyPasswordResetToken(sptoken: string): any; /** * Returns the JSON error from an HTTP response, or a generic error if the * response is not a JSON error * @param {any} error */ private errorTranslator(error); private errorThrower(error); private accountTransformer(json); private jsonParser(res); }