1 declare const stringWidth: {
3 Get the visual width of a string - the number of columns required to display it.
5 Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
9 import stringWidth = require('string-width');
17 stringWidth('\u001B[1m古\u001B[22m');
21 (string: string): number;
23 // TODO: remove this in the next major version, refactor the whole definition to:
24 // declare function stringWidth(string: string): number;
25 // export = stringWidth;
26 default: typeof stringWidth;