gatsby-drupal-webform
Version:
React component for Drupal webforms
15 lines (14 loc) • 474 B
TypeScript
/**
* @file Utils
* @see: https://lengstorf.com/code/get-form-values-as-json/
*/
declare type FormJSON = {
[name: string]: string | string[];
};
/**
* Retrieves input data from a form and returns it as a JSON object.
* @param {HTMLFormControlsCollection} elements the form elements
* @return {Object} form data as an object literal
*/
export declare const formToJSON: (elements: HTMLFormControlsCollection) => FormJSON;
export {};