UNPKG

@logicflow/engine

Version:

a process engine for javascript

47 lines (46 loc) 1.5 kB
import { Engine } from '..'; export declare const MAX_RECORDER = 100; export declare const MAX_INSTANCE = 100; export declare const LOGICFLOW_ENGINE_INSTANCES = "LOGICFLOW_ENGINE_INSTANCES"; export declare class Recorder implements Recorder.Base { instanceId: Engine.Key; maxRecorder: number; constructor({ instanceId }: { instanceId: any; }); setMaxRecorderNumber(max: number): void; setItem(key: string | number, value: unknown): void; getItem(key: string | number): any; getExecutionActions(executionId: Engine.Key): Promise<any>; getExecutionList(): Promise<any>; private addExecution; private popExecution; private pushActionToExecution; /** * @param {Object} action * { * actionId: '', * nodeId: '', * executionId: '', * nodeType: '', * timestamp: '', * properties: {}, * } */ addActionRecord(action: Recorder.Info): Promise<void>; getActionRecord(actionId: Engine.Key): Promise<Recorder.Info>; clear(): void; clearInstance(instanceId: Engine.Key): void; } export declare namespace Recorder { interface Base { addActionRecord: (action: Info) => Promise<void>; getActionRecord: (actionId: Engine.Key) => Promise<Info>; getExecutionActions: (executionId: Engine.Key) => Promise<string[]>; clear: () => void; } type Info = { timestamp: number; } & Engine.NextActionParam; } export default Recorder;