export const setCollectionName: any; export const setQueuePrefix: any; export const Steps: StepsEngine; declare const _default: StepsEngine; export default _default; /** * StepsEngine class that manages step-based workflows * @extends EventEmitter */ declare class StepsEngine { static instance: any; static collectionName: string; static queuePrefix: string; /** * Set the collection name for storing steps data * @param {string} name - Collection name * @throws {Error} If name is not a non-empty string */ static setCollectionName(name: string): void; /** * Set the queue prefix for steps jobs * @param {string} prefix - Queue prefix * @throws {Error} If prefix is not a non-empty string */ static setQueuePrefix(prefix: string): void; /** * Get the singleton instance of StepsEngine * @returns {StepsEngine} The singleton instance */ static getInstance(): StepsEngine; definitions: any; /** * Get the step definition for a specific step * @param {string} stepsName - Name of the steps workflow * @param {string} stepName - Name of the step * @returns {Function} The step function * @throws {Error} If steps definition or step function not found */ getDefinition(stepsName: string, stepName: string): Function; /** * Validate a step definition * @param {Function} step - The step function to validate * @throws {Error} If step definition is invalid */ validateStepDefinition(step: Function): void; /** * Handle the next step in the workflow * @param {string} stepsName - Name of the steps workflow * @param {string|null} nextStep - Name of the next step or null if finished * @param {Object} newState - The new state to set * @param {string} instanceId - ID of the steps instance * @param {Object} options - Step options (waitForInput, timeout, retry, abort) * @returns {Promise} Queue ID(s) for the next step(s) * @throws {Error} If step execution fails */ handleNextStep(stepsName: string, nextStep: string | null, newState: any, instanceId: string, options: any): Promise; /** * Register a new steps workflow * @param {Codehooks} app - Codehooks application instance * @param {string} name - Unique identifier for the steps workflow * @param {string} description - Human-readable description * @param {Object} definition - Object containing step definitions * @returns {Promise} The registered steps name * @throws {Error} If step definition is invalid */ register(app: Codehooks, name: string, description: string, definition: any): Promise; /** * Start a new steps instance * @param {string} name - Name of the steps workflow to start * @param {Object} initialState - Initial state for the steps instance * @returns {Promise<{id: string}>} The steps instance ID * @throws {Error} If starting steps fails */ start(name: string, initialState: any): Promise<{ id: string; }>; /** * Update the state of a steps instance * @param {string} stepsName - Name of the steps workflow * @param {string} instanceId - ID of the steps instance * @param {Object} state - New state to update with * @returns {Promise} The updated state */ updateState(stepsName: string, instanceId: string, state: any): Promise; /** * Set the complete state of a steps instance * @param {string} instanceId - ID of the steps instance * @param {Object} state - Complete state to set * @returns {Promise} */ setState(instanceId: string, { _id, state }: any): Promise; /** * Continue a paused steps instance * @param {string} stepsName - Name of the steps workflow * @param {string} instanceId - ID of the steps instance * @returns {Promise<{qId: string}>} Queue ID for the continued step * @throws {Error} If steps instance not found */ continue(stepsName: string, instanceId: string): Promise<{ qId: string; }>; /** * Get the status of a steps instance * @param {string} id - ID of the steps instance * @returns {Promise} The steps status */ getStepsStatus(id: string): Promise; /** * List all steps instances matching a filter * @param {Object} filter - Filter criteria for steps workflows * @returns {Promise} List of steps instances */ listSteps(filter: any): Promise; /** * Cancel a steps instance * @param {string} id - ID of the steps instance to cancel * @returns {Promise} The cancellation result */ cancelSteps(id: string): Promise; /** * Get the status of a workflow instance (alias for getStepsStatus) * @param {string} id - ID of the workflow instance * @returns {Promise} The workflow status */ getWorkflowStatus(id: string): Promise; /** * Get the state of a workflow instance (alias for getStepsStatus) * @param {string} id - ID of the workflow instance * @returns {Promise} The workflow state */ getState(id: string): Promise; /** * Cancel a workflow instance (alias for cancelSteps) * @param {string} id - ID of the workflow instance to cancel * @returns {Promise} The cancellation result */ cancelWorkflow(id: string): Promise; } //# sourceMappingURL=engine.d.mts.map