"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Scheduler = void 0;
const dateTimestampProvider_js_1 = require("./scheduler/dateTimestampProvider.js");
class Scheduler {
    schedulerActionCtor;
    static now = dateTimestampProvider_js_1.dateTimestampProvider.now;
    constructor(schedulerActionCtor, now = Scheduler.now) {
        this.schedulerActionCtor = schedulerActionCtor;
        this.now = now;
    }
    now;
    schedule(work, delay = 0, state) {
        return new this.schedulerActionCtor(this, work).schedule(state, delay);
    }
}
exports.Scheduler = Scheduler;