import type { IValueModel, IResettableModel, IValueModelReadonly, IFocusableModel } from '@zajno/common/models/types'; import { Getter } from '@zajno/common/types/getter'; import { ValidatableModel } from './Validatable.js'; import type { Nullable } from '@zajno/common/types'; import type { ISymbolDisposable } from '@zajno/common/functions/disposer'; import { SymbolDisposable } from '@zajno/common/functions/disposer.symbols'; export type TextInputConfig = { name?: Getter; title?: Getter; value?: Getter; async?: boolean; noSubscribe?: boolean; }; /** * The feature of this Text model is that it should store the observable copy of a value, pulled from source via reaction, with optional delay. * * However consider using ValueModel if it's just needed to store an observable value. */ export declare class Text extends SymbolDisposable implements IValueModelReadonly { private _value; private _dispose; constructor(getter: () => string, delay?: number | boolean); get value(): string | null; dispose(): void; } export declare class TextInputVM extends ValidatableModel implements IValueModel>, IFocusableModel, IResettableModel, ISymbolDisposable { private readonly _value; private readonly _focused; private readonly _name; private readonly _title; private _valueObserving; constructor(config?: TextInputConfig); get name(): Nullable; get title(): Nullable; get value(): Nullable; set value(val: Nullable); readonly setValue: (value: Nullable, ignoreReadonly?: boolean) => void; get isEmpty(): boolean; get focused(): boolean; set focused(val: boolean); readonly setFocused: (value?: boolean) => void; protected get valueToValidate(): string; private onBlur; reset: () => void; dispose(): void; [Symbol.dispose](): void; }