@vaadin/hilla-lit-form
Version:
Hilla form utils
45 lines (44 loc) • 2.07 kB
TypeScript
import type { BinderRoot } from './BinderRoot.js';
import { AbstractModel, type ArrayItemModel, type Value } from './Models.js';
import type { ClassStaticProperties } from './types.js';
import type { Validator, ValueError } from './Validation.js';
import { _validity } from './Validity.js';
export declare const _updateValidation: unique symbol;
export declare const _update: unique symbol;
export declare const _setErrorsWithDescendants: unique symbol;
export declare const _clearValidation: unique symbol;
export declare function getBinderNode<M extends AbstractModel>(model: M): BinderNode<M>;
export declare const CHANGED: Event;
export declare class BinderNode<M extends AbstractModel = AbstractModel> extends EventTarget {
#private;
readonly ['constructor']: ClassStaticProperties<typeof BinderNode<M>>;
readonly model: M;
[_validity]?: ValidityState;
constructor(model: M);
get binder(): BinderRoot;
get defaultValue(): Value<M> | undefined;
get dirty(): boolean;
get errors(): readonly ValueError[];
get invalid(): boolean;
get name(): string;
get ownErrors(): ReadonlyArray<ValueError<Value<M>>>;
get parent(): BinderNode | undefined;
get required(): boolean;
get validators(): ReadonlyArray<Validator<Value<M>>>;
set validators(validators: ReadonlyArray<Validator<Value<M>>>);
get value(): Value<M> | undefined;
set value(value: Value<M> | undefined);
get visited(): boolean;
set visited(v: boolean);
addValidator(validator: Validator<Value<M>>): void;
appendItem(item?: Value<ArrayItemModel<M>>): void;
for<N extends AbstractModel>(model: N): BinderNode<N>;
prependItem(item?: Value<ArrayItemModel<M>>): void;
removeSelf(): void;
validate(): Promise<readonly ValueError[]>;
protected [_clearValidation](): boolean;
protected [_setErrorsWithDescendants](errors?: readonly ValueError[]): void;
protected [_update](_?: Value<M>): void;
protected [_updateValidation](): Promise<void>;
initializeValue(forceInitialize?: boolean): void;
}