extended-dynamic-forms
Version:
Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events
49 lines (47 loc) • 1.54 kB
TypeScript
import { Rule, UiEffect, SchemaEffect, ValidationEffect } from '../conditionals/v2/types';
export interface DevToolsOptions {
enabled: boolean;
logToConsole?: boolean;
captureHistory?: boolean;
historySize?: number;
}
export interface RuleEvaluation {
ruleName: string;
pillar: 'UI' | 'Schema' | 'Validation';
active: boolean;
error?: string;
timestamp: number;
}
export interface DevToolsHistory {
formData: any;
evaluations: RuleEvaluation[];
timestamp: number;
}
export interface DevToolsOutput {
evaluations: RuleEvaluation[];
history: DevToolsHistory[];
activeRules: {
ui: string[];
schema: string[];
validation: string[];
};
hasErrors: boolean;
errors: RuleEvaluation[];
summary: {
totalRules: number;
activeCount: number;
errorCount: number;
};
}
/**
* Debugging hook for the Three Pillars conditional system.
* Provides visibility into which rules are active and any errors that occur.
*
* @param formData - Current form data
* @param uiRules - UI pillar rules
* @param schemaRules - Schema pillar rules
* @param validationRules - Validation pillar rules
* @param options - DevTools configuration options
* @returns DevToolsOutput with evaluation results and debugging information
*/
export declare function useFormDevTools(formData: any, uiRules?: Rule<UiEffect>[], schemaRules?: Rule<SchemaEffect>[], validationRules?: Rule<ValidationEffect>[], options?: DevToolsOptions): DevToolsOutput;