"use strict";
/**
 * Cadence-option types and validation shared by WS listeners and the
 * subscription manager. Two knobs:
 *   - `throttleMs` — own trailing-edge timer at this interval.
 *   - `scheduler` — cross-stream coordinator; needs `throttleMs` for the
 *     group cadence.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateThrottleMs = validateThrottleMs;
exports.assertCadenceOptions = assertCadenceOptions;
/** Throws synchronously at the entrypoint so partial subscription state never lands. */
function validateThrottleMs(throttleMs, callSiteName) {
    if (throttleMs === undefined)
        return;
    if (!Number.isFinite(throttleMs) || throttleMs <= 0) {
        throw new Error(`${callSiteName}: \`throttleMs\` must be a positive finite number, got ${throttleMs}`);
    }
}
function assertCadenceOptions(callSiteName, scheduler, throttleMs) {
    if (scheduler && throttleMs === undefined) {
        throw new Error(`${callSiteName}: \`scheduler\` requires \`throttleMs\` to set the group cadence`);
    }
}
//# sourceMappingURL=wsCadenceOptions.js.map