string.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * It encodes any string in UTF-8 format
  3. * taken from https://github.com/mathiasbynens/utf8.js
  4. * @param {string} s
  5. * @returns {string}
  6. */
  7. export declare function utf8_encode(s: string): string;
  8. /**
  9. * Converts a camelCase string into hyphenated string
  10. * from https://gist.github.com/youssman/745578062609e8acac9f
  11. * @param {string} str
  12. * @return {string}
  13. */
  14. export declare function camelCaseToHyphen(str: string): string | null;
  15. /**
  16. * Converts a hyphenated string into camelCase string
  17. * from https://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase
  18. * @param {string} str
  19. * @return {string}
  20. */
  21. export declare function hyphenToCamelCase(str: string): string | null;
  22. export declare function capitalise(str: string): string;
  23. export declare function escape(toEscape: string | null): string | null;
  24. /**
  25. * Converts a camelCase string into regular text
  26. * from: https://stackoverflow.com/questions/15369566/putting-space-in-camel-case-string-using-regular-expression
  27. * @param {string} camelCase
  28. * @return {string}
  29. */
  30. export declare function camelCaseToHumanText(camelCase: string | undefined): string | null;