import { Application, Logger, Plugin, PluginOptions, Registry, Transactionable } from '@tego/server';
import { CustomFunction } from './functions';
import { InstructionInterface } from './instructions';
import Processor from './Processor';
import Trigger from './triggers';
import type { ExecutionModel, JobModel, WorkflowModel } from './types';
type ID = number | string;
export default class PluginWorkflowServer extends Plugin {
    instructions: Registry<InstructionInterface>;
    triggers: Registry<Trigger>;
    functions: Registry<CustomFunction>;
    enabledCache: Map<number, WorkflowModel>;
    private ready;
    private executing;
    private pending;
    private events;
    private eventsCount;
    private loggerCache;
    private meter;
    constructor(app: Application, options?: PluginOptions);
    getLogger(workflowId: ID): Logger;
    isWorkflowSync(workflow: WorkflowModel): boolean;
    private onBeforeSave;
    registerTrigger<T extends Trigger>(type: string, trigger: T | {
        new (p: Plugin): T;
    }): void;
    registerInstruction(type: string, instruction: InstructionInterface | {
        new (p: Plugin): InstructionInterface;
    }): void;
    private initTriggers;
    private initInstructions;
    load(): Promise<void>;
    removeWebhooksCache(): Promise<void>;
    toggle(workflow: WorkflowModel, enable?: boolean): void;
    trigger(workflow: WorkflowModel, context: object, options?: {
        [key: string]: any;
    } & Transactionable): void | Promise<Processor | null>;
    private triggerSync;
    resume(job: JobModel): Promise<void>;
    createProcessor(execution: ExecutionModel, options?: {}): Processor;
    private createExecution;
    private prepare;
    private dispatch;
    private process;
    useDataSourceTransaction(dataSourceName: string, transaction: any, create?: boolean): any;
}
export {};
