index.d.ts 490 B

12345678910111213141516171819202122
  1. declare const widestLine: {
  2. /**
  3. Get the visual width of the widest line in a string - the number of columns required to display it.
  4. @example
  5. ```
  6. import widestLine = require('widest-line');
  7. widestLine('古\n\u001B[1m@\u001B[22m');
  8. //=> 2
  9. ```
  10. */
  11. (input: string): number;
  12. // TODO: remove this in the next major version, refactor definition to:
  13. // declare function widestLine(input: string): number;
  14. // export = widestLine;
  15. default: typeof widestLine;
  16. };
  17. export = widestLine;