@coveo/quantic 3.29.2 → 3.29.3-pre.39f4592e8e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ export interface JWTPayload {
2
+ exp?: number;
3
+ [key: string]: unknown;
4
+ }
5
+ /**
6
+ * Parses a JWT token and returns its payload
7
+ * @param token - The JWT token to parse
8
+ * @returns The parsed JWT payload or null if invalid
9
+ */
10
+ export declare function parseJWT(token?: string): JWTPayload | null;
11
+ /**
12
+ * Checks if a JWT token should be renewed (expired or will expire soon)
13
+ * @param token - The JWT token to check
14
+ * @param bufferSeconds - Buffer time in seconds before expiration to consider token as needing renewal
15
+ * @returns true if the token should be renewed (expired or expiring within buffer time), false otherwise
16
+ */
17
+ export declare function shouldRenewJWT(token?: string, bufferSeconds?: number): boolean;