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

35 lines (34 loc) 1.16 kB
import type { ObjectSchema } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import { type SchemaNodeConstructorProps } from '../type'; /** * Node class for providing context data to descendant nodes. * * ContextNode serves as a context provider in the schema form tree, * allowing descendant nodes to access shared context values through * computed properties and expressions. */ export declare class ContextNode extends AbstractNode<ObjectSchema> { #private; readonly type = "object"; /** * Gets the current context value. * @returns The context value object */ get value(): unknown; /** * Sets the context value. * @param input - The context value to set */ set value(input: unknown); /** * Applies the input value to the context node. * @param input - The context value to apply */ protected applyValue(this: ContextNode, input: unknown): void; /** * Creates a new ContextNode instance. * @param properties - The constructor properties for the context node */ constructor(properties: SchemaNodeConstructorProps<ObjectSchema>); }