import * as Joi from 'joi'; import { IContext, IActionHandlerMetadata, IDelegatedParameters } from '../interfaces'; import { ActionSnapshot } from './ActionSnapshot'; import { ActionProcessor } from './ActionProcessor'; /** * Context variables resolver */ export declare abstract class ActionHandler { /** * Get handler metadata * @returns {IActionHandlerMetadata} */ abstract getMetadata(): IActionHandlerMetadata; /** * Get working directory * @returns {string} with alternative wd to use * @returns {null} when original working directory should be used */ getWorkingDirectory(): string | null; /** * Get action processor (should create new instance upon call) * @return {ActionProcessor} */ getProcessor(options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters): ActionProcessor; /** * Validate options before processing. * Should throw exception on error. * @param options * @param {IContext} context * @param {ActionSnapshot} snapshot * @param parameters * @returns {Promise} * Get action processor (should create new instance upon call) * @deprecated */ validate(options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters): Promise /** istanbul ignore next */; /** * Get Joi schema to validate options with * @deprecated */ getValidationSchema(): Joi.Schema | null /** istanbul ignore next */; /** * Check if handler should be actually executed * @param options * @param {IContext} context * @param {ActionSnapshot} snapshot * @param {IDelegatedParameters} parameters * @deprecated */ isShouldExecute(options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters): Promise; /** * Execute handler * @param options * @param {IContext} context * @param {ActionSnapshot} snapshot * @param {IDelegatedParameters} parameters * @deprecated */ execute(options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters): Promise; }