mui-dynamic-field
Version:
A dynamic and customizable input field component for React, built with Material UI & TypeScript.
20 lines (19 loc) • 920 B
TypeScript
import { IDynamicField } from './types';
export declare const getUpdatedKey: (_key: string) => string;
export declare const getErrorKey: (_key: string) => string;
export declare const getErrorText: (_key: string) => string;
interface IValidationProps<T extends Record<string, any> = Record<string, any>> {
_state: Record<string, any>;
fields: IDynamicField.FieldItemConfig<T>[];
getLocalizedText?: (text: string, params?: Record<string, any>) => string;
customFunctions?: Record<string, () => string | null>;
}
export declare const validateFields: <T extends Record<string, any>>({ _state, fields, getLocalizedText, customFunctions, }: IValidationProps<T>) => {
isValid: boolean;
_state: {
[x: string]: any;
};
};
export declare const queryString: (obj: Record<string, any>) => string;
export declare function extractValue<T extends unknown>(obj: T, key: string): unknown;
export {};