import { JsonSchema } from './jsonSchema'; /** * Interface for describing an UI schema element that is referencing * a subschema. The value of the scope may be a JSON Pointer. */ export interface Scopable { /** * The scope that determines to which part this element should be bound to. */ scope?: string; } /** * Interface for describing an UI schema element that is referencing * a subschema. The value of the scope must be a JSON Pointer. */ export interface Scoped extends Scopable { /** * The scope that determines to which part this element should be bound to. */ scope: string; } /** * Interface for describing an UI schema element that may be labeled. */ export interface Labelable { /** * Label for UI schema element. */ label?: string | T; } /** * Interface for describing an UI schema element that is labeled. */ export interface Labeled extends Labelable { label: string | T; } export interface Internationalizable { i18n?: string; } /** * A rule that may be attached to any UI schema element. */ export interface Rule { /** * The effect of the rule */ effect: RuleEffect; /** * The condition of the rule that must evaluate to true in order * to trigger the effect. */ condition: Condition; } /** * The different rule effects. */ export declare enum RuleEffect { /** * Effect that hides the associated element. */ HIDE = "HIDE", /** * Effect that shows the associated element. */ SHOW = "SHOW", /** * Effect that enables the associated element. */ ENABLE = "ENABLE", /** * Effect that disables the associated element. */ DISABLE = "DISABLE" } /** * Represents a condition to be evaluated. */ export interface Condition { /** * The type of condition. */ readonly type?: string; } /** * A leaf condition. */ export interface LeafCondition extends Condition, Scoped { type: 'LEAF'; /** * The expected value when evaluating the condition */ expectedValue: any; } export interface SchemaBasedCondition extends Condition, Scoped { schema: JsonSchema; } /** * A composable condition. */ export interface ComposableCondition extends Condition { conditions: Condition[]; } /** * An or condition. */ export interface OrCondition extends ComposableCondition { type: 'OR'; } /** * An and condition. */ export interface AndCondition extends ComposableCondition { type: 'AND'; } /** * Common base interface for any UI schema element. */ export interface UISchemaElement { /** * The type of this UI schema element. */ type: string; /** * An optional rule. */ rule?: Rule; /** * Any additional options. */ options?: { [key: string]: any; }; } /** * Represents a layout element which can order its children * in a specific way. */ export interface Layout extends UISchemaElement { /** * The child elements of this layout. */ elements: UISchemaElement[]; } /** * A layout which orders its child elements vertically (i.e. from top to bottom). */ export interface VerticalLayout extends Layout { type: 'VerticalLayout'; } /** * A layout which orders its children horizontally (i.e. from left to right). */ export interface HorizontalLayout extends Layout { type: 'HorizontalLayout'; } /** * A group resembles a vertical layout, but additionally might have a label. * This layout is useful when grouping different elements by a certain criteria. */ export interface GroupLayout extends Layout, Labelable { type: 'Group'; } /** * Represents an object that can be used to configure a label. */ export interface LabelDescription { /** * An optional text to be displayed. */ text?: string; /** * Optional property that determines whether to show this label. */ show?: boolean; } /** * A label element. */ export interface LabelElement extends UISchemaElement, Internationalizable { type: 'Label'; /** * The text of label. */ text: string; } /** * A control element. The scope property of the control determines * to which part of the schema the control should be bound. */ export interface ControlElement extends UISchemaElement, Scoped, Labelable, Internationalizable { type: 'Control'; } /** * The category layout. */ export interface Category extends Layout, Labeled { type: 'Category'; } /** * The categorization element, which may have children elements. * A child element may either be itself a Categorization or a Category, hence * the categorization element can be used to represent recursive structures like trees. */ export interface Categorization extends UISchemaElement, Labeled { type: 'Categorization'; /** * The child elements of this categorization which are either of type * {@link Category} or {@link Categorization}. */ elements: (Category | Categorization)[]; } export declare const isInternationalized: (element: any) => element is Required; export declare const isGroup: (layout: Layout) => layout is GroupLayout; export declare const isLayout: (uischema: UISchemaElement) => uischema is Layout; export declare const isScopable: (obj: any) => obj is Scopable; export declare const isScoped: (obj: any) => obj is Scoped; export declare const isLabelable: (obj: any) => obj is Labelable; export declare const isLabeled: (obj: any) => obj is Labeled;