@coveo/quantic 3.29.2 → 3.29.3-pre.18e705913a

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.
@@ -32,6 +32,18 @@ export interface Sort extends Controller {
32
32
  * Verifies whether the specified sort criterion is the currently active one.
33
33
  *
34
34
  * @param criterion - The sort criterion to evaluate.
35
+ * Can be a single criterion or an array of criteria.
36
+ * The criteria in an array will be applied sequentially. For example, if there's a tie on the 1st criterion, the API uses the 2nd criterion to break the tie. However, this only works when combining:
37
+ * `SortByRelevancy` followed by one or more `SortByField` or `SortByDate` criteria.
38
+ * `SortByQRE` followed by one or more `SortByField` or `SortByDate` criteria.
39
+ * Two or more `SortByField` criteria.
40
+ * A single `SortByDate` criterion and one or more `SortByField` criteria in any order.
41
+ *
42
+ * Examples:
43
+ * * `SortByRelevancy`, `SortByField`
44
+ * * `SortByQRE`, `SortByField`
45
+ * * `SortByDate`, `SortByField`, `SortByField`
46
+ *
35
47
  * @returns `true` if the specified sort criterion is the currently active one; `false` otherwise.
36
48
  */
37
49
  isSortedBy(criterion: SortCriterion | SortCriterion[]): boolean;
@@ -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;