UNPKG

@yyasinaslan/easyform

Version:
18 lines (17 loc) 1.74 kB
import { FormFieldBase } from "./interfaces/form-field"; import { EasyFormField } from "./easy-form-field"; import { ObservableString } from "./interfaces/observable-string"; import { SelectOptions } from "./interfaces/select-options"; import { FormSchema } from "./interfaces/form-schema"; export type GeneratorBaseOptions = Omit<FormFieldBase, "label" | "validations">; export declare abstract class EasyFormGenerator { static text<ValueType = string>(value: ValueType, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static textarea<ValueType = string>(value: ValueType, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static select<ValueType = any>(value: ValueType, options: SelectOptions<any>, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static checkbox<ValueType = boolean>(value: ValueType, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static switch<ValueType = any>(value: ValueType, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static radio<ValueType = any>(value: ValueType, options: SelectOptions<any>, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static custom<ValueType = any>(value: ValueType, type: string, label?: ObservableString, configs?: GeneratorBaseOptions): EasyFormField<ValueType>; static group<TValue>(schema: FormSchema<TValue>, configs?: GeneratorBaseOptions): EasyFormField<TValue>; static array<TItem, TArray extends TItem[]>(schema: EasyFormField<TItem> | FormSchema<TItem>, configs?: GeneratorBaseOptions): EasyFormField<TArray>; }