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

47 lines (46 loc) 1.82 kB
import type { Nullish } from '../../../@aileron/declare'; import type { ObjectSchema, ObjectValue } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import type { BranchNodeConstructorProps, SchemaNode, UnionSetValueOption } from '../type'; /** * A node class for handling object schemas. * Manages object properties and handles complex schemas like oneOf. */ export declare class ObjectNode extends AbstractNode<ObjectSchema, ObjectValue> { #private; readonly type = "object"; /** * Gets the value of the object node. * @returns Object value or undefined (if empty) or null (if nullable) */ get value(): ObjectValue | Nullish; /** * Sets the value of the object node. * @param input - Object value to set */ set value(input: ObjectValue | Nullish); /** * Applies input value to the object node. * @param input - Object value to set * @param option - Setting options */ protected applyValue(this: ObjectNode, input: ObjectValue | Nullish, option: UnionSetValueOption): void; /** * Gets the child nodes of the object node. * @returns List of child nodes */ get children(): import("../type").ChildNode[] | null; /** * Gets the list of subnodes of the object node. * @returns List of subnodes */ get subnodes(): import("../type").ChildNode[] | null; /** * Activates this ObjectNode and propagates activation to all child nodes. * @param actor - The node that requested activation * @returns {boolean} Whether activation was successful * @internal Internal implementation method. Do not call directly. */ initialize(this: ObjectNode, actor?: SchemaNode): boolean; constructor(properties: BranchNodeConstructorProps<ObjectSchema>); }