Sha256: 08f234e8871dacf59e1f194fd83c11d002d8d4d488f7be138900755e3e637a24

Contents?: true

Size: 792 Bytes

Versions: 199

Compression:

Stored size: 792 Bytes

Contents

declare const stringWidth: {
	/**
	Get the visual width of a string - the number of columns required to display it.

	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.

	@example
	```
	import stringWidth = require('string-width');

	stringWidth('a');
	//=> 1

	stringWidth('古');
	//=> 2

	stringWidth('\u001B[1m古\u001B[22m');
	//=> 2
	```
	*/
	(string: string): number;

	// TODO: remove this in the next major version, refactor the whole definition to:
	// declare function stringWidth(string: string): number;
	// export = stringWidth;
	default: typeof stringWidth;
}

export = stringWidth;

Version data entries

199 entries across 110 versions & 7 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/@isaacs/cliui/node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.60 node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.60 node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.60 node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.59 node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.59 node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.59 node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.59 node_modules/@isaacs/cliui/node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.58 node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.58 node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.58 node_modules/@isaacs/cliui/node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.58 node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.57 node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.57 node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.57 node_modules/@isaacs/cliui/node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.57 node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.56 node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.56 node_modules/@isaacs/cliui/node_modules/string-width-cjs/index.d.ts
immosquare-cleaner-0.1.56 node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts
immosquare-cleaner-0.1.56 node_modules/string-width/index.d.ts