import { FormSchema } from './formSchema'; import * as yup from 'yup'; /** * @class JsonSchemaParser * @description Prase the json schema, validates it and create `FormSchema`, which can be access with method `getForm` * */ export default class JsonSchemaParser { private _schema; private _compiledFormSchema; private _validationSchema?; constructor(schema: Record, validationSchema?: yup.AnySchema); private _validateSchema; /** * * @param newFields {Field[]} */ addField(newFields: any[], sectionKey?: string, options?: { addAfter?: string; }): void; removeField(fieldKey: string, sectionKey?: string): void; addSections(newSections: any[]): void; private _validateFieldSchema; _validateSectionSchema(sections: any): boolean; private _checkProps; getCompiledSchema(): FormSchema; getForm(): FormSchema; private _generateValidationSchema; }