/**
 * A simple in-memory cache client that stores values in a map with TTL support.
 */
var MemoryCacheClient = /** @class */ (function () {
    function MemoryCacheClient() {
        this.cache = new Map();
    }
    MemoryCacheClient.prototype.get = function (key) {
        var _this = this;
        return new Promise(function (resolve) {
            var entry = _this.cache.get(key);
            if (entry === undefined)
                return resolve(null);
            if (entry.expiresAt && entry.expiresAt < Date.now()) {
                _this.cache.delete(key);
                return resolve(null);
            }
            resolve(entry.value);
        });
    };
    MemoryCacheClient.prototype.set = function (key, value, ttl) {
        var _this = this;
        return new Promise(function (resolve) {
            var expiresAt = ttl ? Date.now() + ttl * 1000 : null;
            _this.cache.set(key, { value: value, expiresAt: expiresAt });
            resolve(key);
        });
    };
    return MemoryCacheClient;
}());
export { MemoryCacheClient };
//# sourceMappingURL=MemoryCacheClient.js.map