UNPKG

chrono-forge

Version:

A comprehensive framework for building resilient Temporal workflows, advanced state management, and real-time streaming activities in TypeScript. Designed for a seamless developer experience with powerful abstractions, dynamic orchestration, and full cont

21 lines (20 loc) 645 B
import 'reflect-metadata'; /** * Validator decorator for type-safe action validation in StatefulWorkflow. * Allows defining validator methods that run before actions are executed. * * @typeParam T - The type of action this validator validates * * @example * ```typescript * class MyWorkflow extends StatefulWorkflow { * @Validator<AddItemAction>('addItem') * protected validateAddItem(action: AddItemAction) { * if (!action.payload.item) { * throw new Error('Item is required'); * } * } * } * ``` */ export declare function Validator<T = any>(actionName: string): (target: any, propertyKey: string) => void;