import { OnDestroy } from '@angular/core'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { TokenPayload } from './token-payload/token-payload'; import { TokenStorage } from './token-storage/token-storage'; import { TokenDecoder } from './token-decoder/token-decoder'; export declare class AuthTokenService implements OnDestroy { protected storage: TokenStorage; protected decoder: TokenDecoder; protected autoRemove: boolean; /** * RxJS BehaviorSubject that stores the token so that observers can subscribe to the subject to receive * the last (or initial) value and all subsequent notifications. * WARNING: This stream never completes, so you have to unsubscribe manually from it!!! * * In most cases it should be sufficient to just use {@link AuthTokenService#value} in case you are not * interested in changes over time */ readonly value$: BehaviorSubject; /** * The current raw value of the token */ get value(): string | undefined; get payload(): undefined | Readonly; protected authTokenName: string; protected tokenPayload: undefined | Readonly; protected autoRemoveTokenSubscription: Subscription; constructor(storage: TokenStorage, decoder: TokenDecoder, autoRemove: boolean, authTokenName?: string); ngOnDestroy(): void; isValid(): boolean; activateTokenAutoRemove(): void; deactivateTokenAutoRemove(): void; protected setToken(token: string | undefined): void; protected getToken(): string | undefined; protected removeTokenWhenNotValidOrExpires(): Subscription; protected whenTokenExpires(payload?: T): Observable; }