UNPKG

@canard/schema-form

Version:

React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components

33 lines (32 loc) 1.35 kB
import type { VirtualNodeValue, VirtualSchema } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import { type ChildNode, type UnionSetValueOption, type VirtualNodeConstructorProps } from '../type'; /** * Node class for handling virtual schemas. * Holds references to multiple nodes and works by integrating them. */ export declare class VirtualNode extends AbstractNode<VirtualSchema, VirtualNodeValue> { #private; /** * Gets the value of the virtual node. * @returns Array of values from all referenced nodes or undefined */ get value(): VirtualNodeValue | undefined; /** * Sets the value of the virtual node. * @param input - The value to set */ set value(input: VirtualNodeValue | undefined); /** * Applies the input value to the virtual node. * @param input - The value to set * @param option - Set value options */ protected applyValue(this: VirtualNode, input: VirtualNodeValue | undefined, option: UnionSetValueOption): void; /** * Gets the child nodes of the virtual node. * @returns List of child nodes */ get children(): ChildNode[]; constructor({ key, name, jsonSchema, defaultValue, onChange, parentNode, refNodes, validationMode, validatorFactory, required, }: VirtualNodeConstructorProps<VirtualSchema>); }