export class VersionCacheMemoryGateway {
    cachedResult = null;
    lastCheckedAt = 0;
    ttlMilliseconds;
    constructor(ttlMilliseconds = 30 * 60 * 1000) {
        this.ttlMilliseconds = ttlMilliseconds;
    }
    get() {
        return this.cachedResult;
    }
    set(result) {
        this.cachedResult = result;
        this.lastCheckedAt = Date.now();
    }
    isExpired() {
        if (this.cachedResult === null) {
            return true;
        }
        return Date.now() - this.lastCheckedAt > this.ttlMilliseconds;
    }
}
//# sourceMappingURL=versionCache.memory.gateway.js.map