"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CacheOnInterval = exports.CacheOnIntervalBuilder = exports.CACHE_ON_INTERVAL_OPTIONS = void 0;
const common_1 = require("@nestjs/common");
exports.CACHE_ON_INTERVAL_OPTIONS = 'CACHE_ON_INTERVAL_OPTIONS';
function CacheOnIntervalBuilder(_a) {
    var { targetMethod } = _a, opts = __rest(_a, ["targetMethod"]);
    return (target) => {
        const method = target.prototype[targetMethod];
        if (!method)
            throw new Error(`Method ${targetMethod} not found!`);
        return (0, exports.CacheOnInterval)(opts)(method);
    };
}
exports.CacheOnIntervalBuilder = CacheOnIntervalBuilder;
const CacheOnInterval = (options) => {
    return (0, common_1.applyDecorators)((0, common_1.SetMetadata)(exports.CACHE_ON_INTERVAL_OPTIONS, options));
};
exports.CacheOnInterval = CacheOnInterval;
//# sourceMappingURL=cache-on-interval.decorator.js.map