// src/server/render-queue/job.ts
export const RENDER_JOB_STATUSES = [
    "queued",
    "running",
    "done",
    "failed",
    "cancelled",
];
export const RENDER_STAGES = [
    "render",
    "duck",
    "loudnorm",
    "burn",
    "encode",
];
export const RENDER_JOB_TYPES = ["full", "proxy"];
export const TERMINAL_STATUSES = new Set([
    "done",
    "failed",
    "cancelled",
]);
export function isTerminalStatus(s) {
    return TERMINAL_STATUSES.has(s);
}
export function assertStatus(s) {
    if (RENDER_JOB_STATUSES.includes(s)) {
        return s;
    }
    throw new Error(`render-queue: invalid status "${s}"`);
}
export function assertStage(s) {
    if (s == null || s === "")
        return undefined;
    if (RENDER_STAGES.includes(s)) {
        return s;
    }
    throw new Error(`render-queue: invalid stage "${s}"`);
}
export function assertType(s) {
    if (RENDER_JOB_TYPES.includes(s)) {
        return s;
    }
    throw new Error(`render-queue: invalid type "${s}"`);
}
//# sourceMappingURL=job.js.map