extended-dynamic-forms
Version:
Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events
77 lines (75 loc) • 1.85 kB
TypeScript
import { UiRule } from './hooks/useConditionalUi';
import { SchemaRule } from './hooks/useConditionalSchema';
interface V1Rule {
conditions: Record<string, any>;
event: {
type: string;
params?: any;
};
order?: number;
}
interface JsonRulesEngineRule {
conditions: {
all?: JsonRulesEngineCondition[];
any?: JsonRulesEngineCondition[];
};
event: {
type: string;
params?: any;
};
}
interface JsonRulesEngineCondition {
fact: string;
operator: string;
value: any;
all?: JsonRulesEngineCondition[];
any?: JsonRulesEngineCondition[];
}
export interface MigrationReport {
totalRules: number;
migratedRules: number;
manualReviewRequired: Array<{
rule: any;
reason: string;
suggestion: string;
}>;
warnings: string[];
}
/**
* Analyzes v1 rules and suggests which pillar they belong to
*/
export declare function analyzeRules(rules: V1Rule[]): {
uiRules: V1Rule[];
schemaRules: V1Rule[];
validationRules: V1Rule[];
unknown: V1Rule[];
};
/**
* Migrates v1 rules to v2 UI rules
*/
export declare function migrateV1ToUiRules(rules: V1Rule[]): {
rules: UiRule[];
report: MigrationReport;
};
/**
* Migrates v1 rules to v2 Schema rules
*/
export declare function migrateV1ToSchemaRules(rules: V1Rule[]): {
rules: SchemaRule[];
report: MigrationReport;
};
/**
* Migrates JSON Rules Engine format to Three Pillars format
*/
export declare function migrateJsonRulesEngine(rules: JsonRulesEngineRule[]): {
uiRules: UiRule[];
report: MigrationReport;
};
/**
* Generates a comprehensive migration report
*/
export declare function generateMigrationReport(v1Rules: V1Rule[], options?: {
includeExamples?: boolean;
outputFormat?: 'markdown' | 'json';
}): string;
export {};