UNPKG

@jsonforms/material-tree-renderer

Version:

Material-based tree renderer for JSON Forms

40 lines (39 loc) 1.58 kB
import { JsonSchema7 } from '@jsonforms/core'; /** * A Property wraps a JsonSchema and provides additional information * like a label and the property key. */ export interface Property { label: string; property: string; schemaPath?: string; /** * The schema is the JsonSchema this property describes. */ schema: JsonSchema7; } /** * Returns the label of a property based on the best-effort solution * @param property The property contains a schema, label and a property as key * @returns {string} */ export declare const findPropertyLabel: (property: Property) => string; /** * Calculate references for a given schema and copy definitions into the schema * * @param parentSchema root schema which is used to find all the schema refs * @param schema current subschema without resolved references * @returns JsonSchema current subschema with resolved references */ export declare const makeSchemaSelfContained: (parentSchema: JsonSchema7, schema: JsonSchema7) => JsonSchema7; /** * Retrieves an array of properties based on the provided schema. * * @param schema the schema to check for container properties * @param rootSchema the root schema * @param recurse whether to recurse in case properties have already been found. * Set to true for finding all valid, i.e. nested container properties * @return The array of {@link Property} or empty if no properties are available * @see Property */ export declare const findContainerProperties: (schema: JsonSchema7, rootSchema: JsonSchema7, recurse: boolean) => Property[];