util.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. /**
  2. * sanitizes input string by handling escape characters eg: converts '''' to '\'\'' and trim input if required
  3. *
  4. * @param {String} inputString - Input String to sanitize
  5. * @param {Boolean} [trim] - Indicates whether to trim string or not
  6. * @returns {String} Sanitized String handling escape characters
  7. */
  8. export function sanitize(inputString: string, trim?: boolean | undefined): string;
  9. /**
  10. * sanitizes input options
  11. *
  12. * @param {Object} options - Options provided by the user
  13. * @param {Array} optionsArray - options array received from getOptions function
  14. *
  15. * @returns {Object} - Sanitized options object
  16. */
  17. export function sanitizeOptions(options: any, optionsArray: any[]): any;
  18. /**
  19. *
  20. * @param {Array} array - form data array
  21. * @param {String} key - key of form data param
  22. * @param {String} type - type of form data param(file/text)
  23. * @param {String} val - value/src property of form data param
  24. * @param {String} disabled - Boolean denoting whether the param is disabled or not
  25. * @param {String} contentType - content type header of the param
  26. * Appends a single param to form data array
  27. */
  28. export function addFormParam(array: any[], key: string, type: string, val: string, disabled: string, contentType: string): void;