1 | # Installation
|
2 | > `npm install --save @types/wrap-ansi`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for wrap-ansi (https://www.npmjs.com/package/wrap-ansi).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wrap-ansi.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wrap-ansi/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for wrap-ansi 8.0
|
12 | // Project: https://www.npmjs.com/package/wrap-ansi
|
13 | // Definitions by: Klaus Reimer <https://github.com/kayahr>
|
14 | // Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
15 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
16 |
|
17 | /**
|
18 | * Wrap words to the specified column width.
|
19 | *
|
20 | * @param input String with ANSI escape codes. Like one styled by chalk.
|
21 | * @param columns Number of columns to wrap the text to.
|
22 | * @param options By default the wrap is soft, meaning long words may extend past the column width. Setting
|
23 | * this to true will make it hard wrap at the column width.
|
24 | */
|
25 | declare function wrapAnsi(input: string, columns: number, options?: wrapAnsi.Options): string;
|
26 |
|
27 | declare namespace wrapAnsi {
|
28 | interface Options {
|
29 | /** @default false */
|
30 | hard?: boolean | undefined;
|
31 | /** @default true */
|
32 | trim?: boolean | undefined;
|
33 | /** @default true */
|
34 | wordWrap?: boolean | undefined;
|
35 | }
|
36 | }
|
37 |
|
38 | export default wrapAnsi;
|
39 |
|
40 | ````
|
41 |
|
42 | ### Additional Details
|
43 | * Last updated: Fri, 02 Jul 2021 18:06:02 GMT
|
44 | * Dependencies: none
|
45 | * Global values: none
|
46 |
|
47 | # Credits
|
48 | These definitions were written by [Klaus Reimer](https://github.com/kayahr), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
49 |
|
\ | No newline at end of file |