1 | /**
|
2 | Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
3 |
|
4 | @param string - A string with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
5 | @param startSlice - Zero-based index at which to start the slice.
|
6 | @param endSlice - Zero-based index at which to end the slice.
|
7 |
|
8 | @example
|
9 | ```
|
10 | import chalk from 'chalk';
|
11 | import sliceAnsi from 'slice-ansi';
|
12 |
|
13 | const string = 'The quick brown ' + chalk.red('fox jumped over ') +
|
14 | 'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
15 |
|
16 | console.log(sliceAnsi(string, 20, 30));
|
17 | ```
|
18 | */
|
19 | export default function sliceAnsi(string: string, startSlice: number, endSlice?: number): string;
|