UNPKG

@mobx-ecosystem/mobx-form

Version:

provides the ability to use forms with validation in MobX stores

47 lines (46 loc) 1.8 kB
import { FieldService } from "./field-service"; import { AutocompleteFieldOptionsType, IField, ValueType } from "./types"; export declare class AutocompleteFieldService<T = ValueType<unknown>> implements IField { field: FieldService<T>; inputField: FieldService<string, { value: string; onChange: (_: any, value: ValueType<string>) => void; onBlur: (_: any) => void; error?: string | undefined; disabled?: boolean | undefined; }>; options?: AutocompleteFieldOptionsType<T>; constructor(initValue?: ValueType<T>, options?: AutocompleteFieldOptionsType<T>); get validate(): (() => Promise<unknown>) | undefined; set validate(validate: (() => Promise<unknown>) | undefined); setValue: (value: ValueType<T>, { inputValue, withNotification, withBlur }: { inputValue?: string | undefined; withNotification?: boolean | undefined; withBlur?: boolean | undefined; }) => true | undefined; reset: () => void; setAsInit: () => void; onInputChange: (e: any, value: string) => void; touch: () => void; disable: () => void; enable: () => void; get value(): ValueType<T>; set value(value: ValueType<T>); get error(): string | undefined; set error(error: string | undefined); get disabled(): boolean; set disabled(disabled: boolean); get isValid(): boolean; get isInit(): boolean; set initValue(initValue: ValueType<T>); get isTouched(): boolean; get initValue(): ValueType<T>; get props(): { onSearchChange: (e: any, value: string) => void; value: T; onChange: (_: any, value: ValueType<T>) => void; onBlur: (_: any) => void; error?: string | undefined; disabled?: boolean | undefined; }; }