import { Components, ComponentSchema } from "formiojs"; import { Submission } from "../../interfaces/Submission"; export declare class ReactComponent extends Components.components.field { reactInstance: any; shouldSetValue: boolean; private dataForSetting; /** * This is the first phase of component building where the component is instantiated. * * @param component - The component definition created from the settings form. * @param options - Any options passed into the renderer. * @param data - The submission data where this component's data exists. */ constructor(component: ComponentSchema, options: any, data: Submission); get $reactNode(): any; /** * This method is called any time the component needs to be rebuilt. It is most frequently used to listen to other * components using the this.on() function. */ init(): void; /** * This method is called before the component is going to be destroyed, which is when the component instance is * destroyed. This is different from detach which is when the component instance still exists but the dom instance is * removed. */ destroy(): void; /** * The second phase of component building where the component is rendered as an HTML string. * * @returns {string} - The return is the full string of the component */ render(): any; /** * The third phase of component building where the component has been attached to the DOM as 'element' and is ready * to have its javascript events attached. * * @param element * @returns {Promise} - Return a promise that resolves when the attach is complete. */ attach(element: any): Promise; /** * The fourth phase of component building where the component is being removed from the page. This could be a redraw * or it is being removed from the form. */ detach(): void; /** * Override this function to render a react component. */ renderReact(): any; /** * Override this function to insert your custom component. * * @param element */ attachReact(element?: any): Element; /** * Override this function. */ detachReact(element?: any): void; /** * Something external has set a value and our component needs to be updated to reflect that. For example, loading a submission. * * @param value * @param flags */ setValue(value: any, flags?: any): boolean; /** * The user has changed the value in the component and the value needs to be updated on the main submission object and other components notified of a change event. * * @param value * @param flags */ updateValue: (value?: Data, flags?: Record) => boolean; /** * Get the current value of the component. Should return the value set in the react component. * * @returns {*} */ getValue(): Data; /** * Override normal validation check to insert custom validation in react component. * * @param data * @param dirty * @param rowData * @returns {boolean} */ checkValidity(data: Data, dirty: boolean, rowData: any): boolean; validate(data: Data, dirty: boolean, rowData: any): boolean; }