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

38 lines (37 loc) 1.47 kB
import type { Nullish } from '../../../@aileron/declare'; import type { StringSchema, StringValue } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import { type HandleChange, type SchemaNodeConstructorProps, type UnionSetValueOption } from '../type'; /** * Node class for handling string schemas. * Manages and parses string values. */ export declare class StringNode extends AbstractNode<StringSchema, StringValue> { #private; readonly type = "string"; /** * Gets the value of the string node. * @returns String value or undefined */ get value(): StringValue | Nullish; /** * Sets the value of the string node. * @param input - The string value to set */ set value(input: StringValue | Nullish); /** * Applies the input value to the string node. * @param input - The string value to set * @param option - Set value options */ protected applyValue(this: StringNode, input: StringValue | Nullish, option: UnionSetValueOption): void; protected onChange: HandleChange<StringValue | Nullish>; constructor(properties: SchemaNodeConstructorProps<StringSchema>); /** * Reflects value changes excluding empty values. * @param input - The value to set * @param batch - Optional flag indicating whether the change should be batched * @internal Internal implementation method. Do not call directly. */ private onChangeWithOmitEmpty; }