2 * Wrap words to a specified length.
6 declare function wrap(str: string, options?: wrap.IOptions): string;
8 declare namespace wrap {
9 export interface IOptions {
12 * The width of the text before wrapping to a new line.
18 * The string to use at the beginning of each line.
19 * @default ´ ´ (two spaces)
24 * The string to use at the end of each line.
30 * An escape function to run on each line after splitting them.
31 * @default (str: string) => string;
33 escape?: (str: string) => string;
36 * Trim trailing whitespace from the returned string.
37 * This option is included since .trim() would also strip
38 * the leading indentation from the first line.
44 * Break a word between any two letters when the word is longer
45 * than the specified width.