import EventEmitter from "events"; import type LongRunningProcesses from "../app/collections/long-running-processes.js"; import type { CollectionItem, Context } from "../main.js"; type LongRunningProcessEvent = { type: string; message: string; timestamp: number; }; export type LPRState = "running" | "error" | "finished"; export declare class LongRunningProcess = []> extends EventEmitter { protected context: Context; status: "ready" | LPRState; protected itemPromise: Promise>; protected isFinishedPromise: Promise; protected static registry: Record; constructor(context: Context, callback: (process: LongRunningProcess | null, ...rest: Args) => Promise, args: Args, name?: string, owner_id?: string | null); error(message: string): Promise; addEvent(message: string, type: "info" | "error", progress?: number): Promise; emit(...args: Parameters): boolean; info(message: string, progress?: number): Promise; private setState; getID(): Promise; waitForFinished(): Promise; static getByID(context: Context, id: string): Promise<{ emitter: LongRunningProcess | null; events: LongRunningProcessEvent[]; latestEvent: LongRunningProcessEvent; state: LPRState; progress: number; }>; } export {};