utilities.d.ts 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @param {number} a The number to test.
  3. * @param {number} min The minimum value in the range, inclusive.
  4. * @param {number} max The maximum value in the range, inclusive.
  5. * @return {boolean} True if a >= min and a <= max.
  6. */
  7. export declare function inRange(a: number, min: number, max: number): boolean;
  8. /**
  9. * @param {!Array.<*>} array The array to check.
  10. * @param {*} item The item to look for in the array.
  11. * @return {boolean} True if the item appears in the array.
  12. */
  13. export declare function includes(array: Array<any>, item: any): boolean;
  14. /**
  15. * @param {*} o
  16. * @return {Object}
  17. */
  18. export declare function ToDictionary(o: any): {
  19. [x: string]: any;
  20. };
  21. /**
  22. * @param {string} string Input string of UTF-16 code units.
  23. * @return {!Array.<number>} Code points.
  24. */
  25. export declare function stringToCodePoints(string: string): Array<number>;
  26. /**
  27. * @param {!Array.<number>} code_points Array of code points.
  28. * @return {string} string String of UTF-16 code units.
  29. */
  30. export declare function codePointsToString(code_points: Array<number>): string;