import type { ValidateFunction } from 'ajv'; import type { AnyObject } from 'pinejs-client-core'; import { PinejsClient } from '../sbvr-api/sbvr-utils.js'; import type { Task } from './tasks.js'; import type TasksModel from './tasks.js'; import type { Resolvable } from '../sbvr-api/common-types.js'; interface TaskArgs { api: PinejsClient; params: T; } type TaskResponse = Resolvable<{ status: Task['Read']['status']; error?: string; }>; export interface TaskHandler> { name: string; fn: (options: TaskArgs) => TaskResponse; validate?: ValidateFunction; } export declare class Worker { private readonly client; handlers: Map>>; private currentConcurrency; private running; constructor(client: PinejsClient); private canExecute; private execute; private update; private getNextAttemptTime; private poll; stop(): void; start(): void; assertNoUnknownHandlers(): Promise; } export {};