@axarai/axar
Version:
TypeScript-based agent framework for building agentic applications powered by LLMs
26 lines (25 loc) • 813 B
TypeScript
import { ValidationRule } from './types';
/**
* Registers a property in the metadata registry for schema generation.
* Ensures each property is only registered once.
*
* @param target - The target object (typically the class prototype)
* @param propertyKey - The property symbol
*/
export declare function registerProperty(target: Object, propertyKey: string | symbol): void;
/**
* Adds a validation rule to a property's metadata.
*
* @param target - The target object
* @param propertyKey - The property to validate
* @param rule - The validation rule to add
*
* @example
* ```typescript
* addValidationRule(user, 'age', {
* type: 'minimum',
* params: [0]
* });
* ```
*/
export declare function addValidationRule(target: Object, propertyKey: string | symbol, rule: ValidationRule): void;