@anushase/json-form-builder
Version:
A dynamic JSON form builder with multi-language support, validation, and responsive design
27 lines (26 loc) • 1.15 kB
TypeScript
import { FormConfig, FormData, AdditionalConfig, AdditionalSchema } from "./types";
declare global {
interface Window {
grecaptcha?: {
render: (container: HTMLElement, options: {
sitekey: string;
callback?: (response: string) => void;
"expired-callback"?: () => void;
}) => number;
getResponse: (widgetId?: number) => string;
reset: (widgetId?: number) => void;
};
videoLocalStream: MediaStream | null;
}
}
/**
* Gets the form data from the current state, normalizing language codes to 3-letter codes.
* @param {FormState} state Current form state containing schema, container, and other properties.
* @returns {FormData} The collected form data with normalized language codes.
*/
declare const JsonFormBuilder: (config: FormConfig, containerId: string, additionalConfig: AdditionalConfig) => Readonly<{
render: () => Promise<void>;
getFormData: () => FormData;
updateLanguage: (newLanguage: string, submitButtonLabel?: string, additionalSchema?: AdditionalSchema) => void;
}>;
export { JsonFormBuilder };