export declare const TokenStatus: { readonly INVALID: "INVALID"; readonly EXPIRED: "EXPIRED"; readonly REFRESH_REQUIRED: "REFRESH_REQUIRED"; readonly VALID: "VALID"; }; export type TokenStatus = (typeof TokenStatus)[keyof typeof TokenStatus]; /** * Checks whether a token has expired. * @param expirationTimestamp - Unix timestamp in seconds */ export declare function isTokenExpired(expirationTimestamp: number): boolean; /** * Checks whether a token needs to be refreshed. Refresh is required once the remaining * time drops to 50% of the token's total lifetime (exp - iat). Falls back to a fixed * 6-hour margin when the issued-at claim isn't available to compute the lifetime. * Returns false for a token that has already expired. * @param expirationTimestamp - Unix timestamp in seconds the token expires at * @param issuedAtTimestamp - Unix timestamp in seconds the token was issued at */ export declare function isTokenRefreshRequired(expirationTimestamp: number, issuedAtTimestamp?: number | null): boolean; /** * Checks token expiration status. See isTokenExpired and isTokenRefreshRequired * for the individual checks, or use those directly if only one is needed. * @param expirationTimestamp - Unix timestamp in seconds the token expires at * @param issuedAtTimestamp - Unix timestamp in seconds the token was issued at * @returns EXPIRED, REFRESH_REQUIRED, or VALID */ export declare function checkTokenExpiration(expirationTimestamp: number, issuedAtTimestamp?: number | null): TokenStatus; export declare function calculateMillisecondsUntilRefresh(expirationTimestamp: number, issuedAtTimestamp?: number | null): number;