import type { PlimiPlugin } from "../../core/plugins/plugin-types";
import { runPdfMerger } from "./run";
import PdfWorker from "./worker?worker";

export const pdfMergerPlugin: PlimiPlugin = {
  manifest: {
    id: "pdf-merger",
    name: "PDF Merger",
    description:
      "Merge multiple PDF files securely in your browser. Large files will not freeze your UI.",
    category: "pdf",
    version: "1.0.0",
    tags: ["pdf", "merge", "join"],
    input: {
      type: "files",
      accept: ["application/pdf"],
      multiple: true,
    },
    output: { type: "files" },
    offlineReady: true,
  },

  capabilities: {
    cancelable: true,
    worker: true,
  },

  run: runPdfMerger,
  worker: () => new PdfWorker(),
};
