UNPKG

@aws-lambda-powertools/parameters

Version:
25 lines 788 B
import type { ExpirableValueInterface } from '../types/BaseProvider.js'; /** * Class to represent a value that can expire. * * Upon creation, the value is assigned a TTL (time to live) that is calculated * by adding the current time with the maximum age. */ declare class ExpirableValue implements ExpirableValueInterface { ttl: number; value: unknown; /** * * @param value - Value to be cached * @param maxAge - Maximum age in seconds for the value to be cached */ constructor(value: unknown, maxAge: number); /** * Check if the value has expired. * * @returns {boolean} - True if the value has expired, false otherwise */ isExpired(): boolean; } export { ExpirableValue }; //# sourceMappingURL=ExpirableValue.d.ts.map