Upgrade Ava to v4
This commit is contained in:
parent
9a40cc5274
commit
ce89f1b611
1153 changed files with 27264 additions and 95308 deletions
108
node_modules/cli-truncate/index.d.ts
generated
vendored
108
node_modules/cli-truncate/index.d.ts
generated
vendored
|
|
@ -1,64 +1,86 @@
|
|||
declare namespace cliTruncate {
|
||||
interface Options {
|
||||
/**
|
||||
Position to truncate the string.
|
||||
export interface Options {
|
||||
/**
|
||||
The position to truncate the string.
|
||||
|
||||
@default 'end'
|
||||
*/
|
||||
readonly position?: 'start' | 'middle' | 'end';
|
||||
@default 'end'
|
||||
*/
|
||||
readonly position?: 'start' | 'middle' | 'end';
|
||||
|
||||
/**
|
||||
Add a space between the text and the ellipsis.
|
||||
/**
|
||||
Add a space between the text and the ellipsis.
|
||||
|
||||
@default false
|
||||
@default false
|
||||
|
||||
@example
|
||||
```
|
||||
cliTruncate('unicorns', 5, {position: 'end', space: true});
|
||||
//=> 'uni …'
|
||||
@example
|
||||
```
|
||||
import cliTruncate from 'cli-truncate';
|
||||
|
||||
cliTruncate('unicorns', 5, {position: 'end', space: false});
|
||||
//=> 'unic…'
|
||||
cliTruncate('unicorns', 5, {position: 'end', space: true});
|
||||
//=> 'uni …'
|
||||
|
||||
cliTruncate('unicorns', 6, {position: 'start', space: true});
|
||||
//=> '… orns'
|
||||
cliTruncate('unicorns', 5, {position: 'end', space: false});
|
||||
//=> 'unic…'
|
||||
|
||||
cliTruncate('unicorns', 7, {position: 'middle', space: true});
|
||||
//=> 'uni … s'
|
||||
```
|
||||
*/
|
||||
readonly space?: boolean;
|
||||
cliTruncate('unicorns', 6, {position: 'start', space: true});
|
||||
//=> '… orns'
|
||||
|
||||
/**
|
||||
Truncate the string from a whitespace if it is within 3 characters from the actual breaking point.
|
||||
cliTruncate('unicorns', 7, {position: 'middle', space: true});
|
||||
//=> 'uni … s'
|
||||
```
|
||||
*/
|
||||
readonly space?: boolean;
|
||||
|
||||
@default false
|
||||
/**
|
||||
Truncate the string from a whitespace if it is within 3 characters from the actual breaking point.
|
||||
|
||||
@example
|
||||
```
|
||||
cliTruncate('unicorns rainbow dragons', 20, {position: 'start', preferTruncationOnSpace: true});
|
||||
//=> '…rainbow dragons'
|
||||
@default false
|
||||
|
||||
cliTruncate('unicorns rainbow dragons', 20, {position: 'middle', preferTruncationOnSpace: true});
|
||||
//=> 'unicorns…dragons'
|
||||
@example
|
||||
```
|
||||
import cliTruncate from 'cli-truncate';
|
||||
|
||||
cliTruncate('unicorns rainbow dragons', 6, {position: 'end', preferTruncationOnSpace: true});
|
||||
//=> 'unico…'
|
||||
````
|
||||
*/
|
||||
readonly preferTruncationOnSpace?: boolean;
|
||||
}
|
||||
cliTruncate('unicorns rainbow dragons', 20, {position: 'start', preferTruncationOnSpace: true});
|
||||
//=> '…rainbow dragons'
|
||||
|
||||
cliTruncate('unicorns rainbow dragons', 20, {position: 'middle', preferTruncationOnSpace: true});
|
||||
//=> 'unicorns…dragons'
|
||||
|
||||
cliTruncate('unicorns rainbow dragons', 6, {position: 'end', preferTruncationOnSpace: true});
|
||||
//=> 'unico…'
|
||||
````
|
||||
*/
|
||||
readonly preferTruncationOnSpace?: boolean;
|
||||
|
||||
/**
|
||||
The character to use at the breaking point.
|
||||
|
||||
@default '…'
|
||||
|
||||
@example
|
||||
```
|
||||
import cliTruncate from 'cli-truncate';
|
||||
|
||||
cliTruncate('unicorns', 5, {position: 'end'});
|
||||
//=> 'unic…'
|
||||
|
||||
cliTruncate('unicorns', 5, {position: 'end', truncationCharacter: '.'});
|
||||
//=> 'unic.'
|
||||
|
||||
cliTruncate('unicorns', 5, {position: 'end', truncationCharacter: ''});
|
||||
//=> 'unico'
|
||||
*/
|
||||
readonly truncationCharacter?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
Truncate a string to a specific width in the terminal.
|
||||
|
||||
@param text - Text to truncate.
|
||||
@param columns - Columns to occupy in the terminal.
|
||||
@param columns - The number of columns to occupy in the terminal.
|
||||
|
||||
@example
|
||||
```
|
||||
import cliTruncate = require('cli-truncate');
|
||||
import cliTruncate from 'cli-truncate';
|
||||
|
||||
cliTruncate('unicorn', 4);
|
||||
//=> 'uni…'
|
||||
|
|
@ -87,10 +109,8 @@ cliTruncate(paragraph, process.stdout.columns));
|
|||
//=> 'Lorem ipsum dolor sit amet, consectetuer adipiscing…'
|
||||
```
|
||||
*/
|
||||
declare function cliTruncate(
|
||||
export default function cliTruncate(
|
||||
text: string,
|
||||
columns: number,
|
||||
options?: cliTruncate.Options
|
||||
options?: Options
|
||||
): string;
|
||||
|
||||
export = cliTruncate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue