import { assembleImagePdf } from "../assemble"; import { renderBytes } from "./core"; import type { AssembleJob, AssembleResult } from "./jobs"; /** Runs an assemble job where it is called: the worker, the main thread, or a Node test. */ export async function runAssembleJob(job: AssembleJob): Promise { const t0 = performance.now(); const bytes = await renderBytes(assembleImagePdf({ pages: job.pages, title: job.title })); return { id: job.id, bytes, ms: Math.round(performance.now() - t0) }; }