import get from 'lodash/get' ; import Ajv from 'ajv' ; import { JsonFormsState } from '../store' ; import { JsonSchema , UISchemaElement } from '../models' ; import { extractAjv , extractData , extractSchema , extractUiSchema , } from './core' ; import { extractDefaultData , JsonFormsDefaultDataRegistryEntry } from './default-data' ; import { JsonFormsRendererRegistryEntry } from './renderers' ; import { JsonFormsCellRendererRegistryEntry } from './cells' ; import { JsonFormsUISchemaRegistryEntry } from './uischemas' ; export const getData = ( state ) => extractData ( get ( state , 'jsonforms.core' ) ) ; export const getSchema = ( state ) : JsonSchema => extractSchema ( get ( state , 'jsonforms.core' ) ) ; export const getUiSchema = ( state ) : UISchemaElement => extractUiSchema ( get ( state , 'jsonforms.core' ) ) ; export const getAjv = ( state ) : Ajv => extractAjv ( get ( state , 'jsonforms.core' ) ) ; export const getDefaultData = ( state ) : JsonFormsDefaultDataRegistryEntry [ ] => extractDefaultData ( get ( state , 'jsonforms.defaultData' ) ) ; export const getRenderers = ( state ) : JsonFormsRendererRegistryEntry [ ] => get ( state , 'jsonforms.renderers' ) ; export const getCells = ( state ) : JsonFormsCellRendererRegistryEntry [ ] => get ( state , 'jsonforms.cells' ) ; export const getUISchemas = ( state ) : JsonFormsUISchemaRegistryEntry [ ] => get ( state , 'jsonforms.uischemas' ) ;