import { Http, Request, RequestOptions, RequestOptionsArgs, Response } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/fromPromise'; import 'rxjs/add/operator/mergeMap'; export interface IAuthConfig { globalHeaders: Array; headerName: string; headerPrefix: string; noJwtError: boolean; noTokenScheme?: boolean; tokenGetter: any; tokenName: string; } /** * Sets up the authentication configuration. */ export declare class AuthConfig { globalHeaders: Array; headerName: string; headerPrefix: string; noJwtError: boolean; noTokenScheme: boolean; tokenGetter: any; tokenName: string; constructor(config?: any); getConfig(): IAuthConfig; } /** * Allows for explicit authenticated HTTP requests. */ export declare class AuthHttp { private http; private defOpts; private config; tokenStream: Observable; constructor(options: AuthConfig, http: Http, defOpts?: RequestOptions); private mergeOptions(providedOpts, defaultOpts?); private requestHelper(requestArgs, additionalOptions?); setGlobalHeaders(headers: Array, request: Request | RequestOptionsArgs): void; request(url: string | Request, options?: RequestOptionsArgs): Observable; private requestWithToken(req, token); get(url: string, options?: RequestOptionsArgs): Observable; post(url: string, body: any, options?: RequestOptionsArgs): Observable; put(url: string, body: any, options?: RequestOptionsArgs): Observable; delete(url: string, options?: RequestOptionsArgs): Observable; patch(url: string, body: any, options?: RequestOptionsArgs): Observable; head(url: string, options?: RequestOptionsArgs): Observable; options(url: string, options?: RequestOptionsArgs): Observable; } /** * Helper class to decode and find JWT expiration. */ export declare class JwtHelper { urlBase64Decode(str: string): string; decodeToken(token: string): any; getTokenExpirationDate(token: string): Date; isTokenExpired(token: string, offsetSeconds?: number): boolean; } /** * Checks for presence of token and that token hasn't expired. * For use with the @CanActivate router decorator and NgIf */ export declare function tokenNotExpired(tokenName?: string, jwt?: string): boolean; export declare const AUTH_PROVIDERS: any; export declare function provideAuth(config?: {}): any[];