mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
Add type definitions for wrap-ansi (https://www.npmjs.com/package/wrap-ansi) (#9090)
This commit is contained in:
committed by
Masahiro Wakame
parent
b97c0d5a22
commit
d4c9dc3197
@@ -0,0 +1,8 @@
|
||||
/// <reference path="./wrap-ansi.d.ts" />
|
||||
|
||||
import wrapAnsi = require("wrap-ansi");
|
||||
|
||||
wrapAnsi("input", 80) === "output";
|
||||
wrapAnsi("input", 80, {}) === "output";
|
||||
wrapAnsi("input", 80, { hard: true }) === "output";
|
||||
wrapAnsi("input", 80, { hard: false }) === "output";
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for wrap-ansi v2.0.0
|
||||
// Project: https://www.npmjs.com/package/wrap-ansi
|
||||
// Definitions by: Klaus Reimer <https://github.com/kayahr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "wrap-ansi" {
|
||||
/**
|
||||
* Wrap words to the specified column width.
|
||||
*
|
||||
* @param input String with ANSI escape codes. Like one styled by chalk.
|
||||
* @param columns Number of columns to wrap the text to.
|
||||
* @param options By default the wrap is soft, meaning long words may extend past the column width. Setting
|
||||
* this to true will make it hard wrap at the column width.
|
||||
*/
|
||||
function wrapAnsi(input: string, columns: number, options?: { hard?: boolean }): string;
|
||||
|
||||
namespace wrapAnsi {}
|
||||
|
||||
export = wrapAnsi;
|
||||
}
|
||||
Reference in New Issue
Block a user