import { Ajv } from "ajv" ; import { JSONSchema6 } from "json-schema" ; import { BaseFactory } from "./libs/factory" ; import { FxJsonSchema } from "./models/jsonschema" ; export const schemaFieldFactory = new BaseFactory < FxJsonSchema > ( ) ; export const schemaKeyWordFactory = new BaseFactory < ( $id : string , schema : JSONSchema6 , ajv : Ajv ) => JSONSchema6 > ( ) ; export const schemaTypeFactory = new BaseFactory < ( schema : JSONSchema6 , $id : string , ajv : Ajv ) => JSONSchema6 > ( ) ; export const schemaKeysFactory = new BaseFactory < string > ( ) ; param { JSONSchema6 } schema param { Ajv } ajv returns { JSONSchema6 } export const convertKeys = ( $id , schema , ajv ) : JSONSchema6 => { schemaKeyWordFactory . forEach ( ( key , val ) => { schema = val ( $id , schema , ajv ) ; } ) ; return schema ; } ;