/// export declare type AsyncValueUpdateData = { id?: number; value: any; }; export interface AsyncValueUpdateOptions { /** * Optional: If you wish to set the id value on the data supplied to the API end point. */ getIdCallback?: ($element: JQuery) => number; /** * Optional: If you wish to perform a form validation before submitting. If not supplied the module wont perform form validation. */ performValidation?: boolean; /** * Optional: Callback if the update request is failed */ updateFailedCallback?: ($element: JQuery, jqXHR: JQuery.jqXHR, errorTextStatus: JQuery.Ajax.ErrorTextStatus, errorThrown: string) => void; /** * Optional: Callback if when the request is finished */ updateCompletedCallback?: ($element: JQuery, successData: any, successTextStatus: JQuery.Ajax.SuccessTextStatus, jqXHR: JQuery.jqXHR) => void; /** * Optional: Callback to supply the API endpoint with more data, if needed. */ getAdditionalPostParametersCallback?: ($element: JQuery) => object; } /** This module is used for updating input fields asynchronous. * The elements with the given selector must have a data attribute called "async-value-update-url" in order to work. * The value of async-value-update-url is an endpoint of your API with a parameter called "Id" and "Value". * You will also need a form with the a class called fake-async-validation-form if you wish the validation to work properly. */ export default class AsyncValueUpdateModule { init(selector: string, options?: AsyncValueUpdateOptions): void; private initAsyncValueUpdateModule; private getValueFromElement; private setValueForElement; private setValueForInputElement; private getValueFromInputElement; }