import { EventEmitter } from '@angular/core'; import { TokenResponse } from '../../api/interfaces/token.response'; export declare class TokenService { /** * This event fires, when the Expires In variable nearly expired. */ nearlyExpired: EventEmitter; /** * Token expiration timer id */ private expirationTimer; /** * This variable stores the actual token. * * @private * @type {string} * @memberof TokenService */ private cachedToken; /** * Name of the cookie, that stores the Access Token. */ private readonly accessTokenCookieName; /** * Name of the cookie, that stores the Refresh Token. */ private readonly refreshTokenCookieName; /** * Name of the cookie, that stores the Expires In variable. */ private readonly expirationAtCookieName; /** * Plus time added to the expires_in property. * * @private * @memberof OauthService */ private readonly expiresInAddon; /** * Amount of time, when the token nearly expired (in ms). * * @private * @memberof OauthService */ private readonly nearlyExpiredMs; constructor(); /** * This function returns the stored Access Token. */ getToken(): string; /** * This function stores the given token to the CookieStore. * @param token The token that came from the API. */ setToken(token: TokenResponse): void; /** * This function returns `true` if there is any Access Token in the browser's CookieStore. */ hasToken(): boolean; /** * This function removes the Access Token from the browser's CookieStore. */ deleteToken(): void; /** * This function (re)starts the token expiration timer */ private startExpirationTimer; /** * This function stops the token expiration timer */ private stopExpirationTimer; }