import { TokenData } from "@twilio/flex-sdk"; import type { Config } from "../state"; import { ConsoleLoginStorageParams } from "./ConsoleLoginStorage"; import type { SSOTokenPayload } from "./TokenStorage"; import { Permissions } from "./TokenStorage"; export declare function triggerLogout(): void; export type TokenManagerConfig = { consoleFlowItem: ConsoleLoginStorageParams | undefined; } & Config; export declare const TokenManager: { isUpdatingToken: () => boolean; setUpdatingToken: (isUpdatingToken: boolean) => void; initialize(c: TokenManagerConfig): Promise; destroy(): void; hasActiveToken(): Promise; validate(token: string): Promise; getPermissions(roles: Array): Permissions; getActiveTokenPayload(): Promise; parseTokenPayloadFromQueryString(): SSOTokenPayload | undefined; clearTokenPayload(): void; storeTokenPayload(tokenPayload: SSOTokenPayload): Promise; /** * Check whether the conditions to attempt a refresh using the refresh token are met. * @example * // Attempt refresh when access token expired but refresh token is still valid * const shouldRefresh = TokenManager.checkRefreshTokenCondition(true, false, { refreshToken: 'r', ...other }); * * @param {boolean} isTokenExpired - Whether the access token is expired. * @param {boolean} isRefreshTokenExpired - Whether the refresh token is expired. * @param {SSOTokenPayload} tokenPayload - The stored token payload which may contain a refresh token. * @returns {boolean} whether the refresh token conditions are met * @since 2.15.0 */ checkRefreshTokenCondition(isTokenExpired: boolean, isRefreshTokenExpired: boolean, tokenPayload: SSOTokenPayload): boolean; verifyToken(): Promise; isTokenCloseToExpiry(): boolean; isTokenExpired(): boolean; isRefreshTokenExpired(): boolean; getRemainingAccessTokenMinutes(): number; clearRefreshTokenAndLogout(): void; showSessionExpirationWarning(): void; updateSSOToken(): Promise; updateOauthToken(): Promise; };