Sha256: 2fca8fbc9d4d28c92b17f4473508397d9a4fea19674e9156f67c861f89b53806

Contents?: true

Size: 1.21 KB

Versions: 27

Compression:

Stored size: 1.21 KB

Contents

/**
 * Wrap words to a specified length.
 */
export = wrap;

declare function wrap(str: string, options?: wrap.IOptions): string;

declare namespace wrap {
    export interface IOptions {

        /**
         * The width of the text before wrapping to a new line.
         * @default ´50´
         */
        width?: number;

        /**
         * The string to use at the beginning of each line.
         * @default ´´ (none)
         */
        indent?: string;

        /**
         * The string to use at the end of each line.
         * @default ´\n´
         */
        newline?: string;

        /**
         * An escape function to run on each line after splitting them.
         * @default (str: string) => string;
         */
        escape?: (str: string) => string;

        /**
         * Trim trailing whitespace from the returned string.
         * This option is included since .trim() would also strip
         * the leading indentation from the first line.
         * @default true
         */
        trim?: boolean;

        /**
         * Break a word between any two letters when the word is longer
         * than the specified width.
         * @default false
         */
        cut?: boolean;
    }
}

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.31 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.30 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.29 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.28 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.27 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.26 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.25 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.24 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.23 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.22 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.21 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.20 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.19 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.18 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.17 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.16 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.14 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.13 node_modules/@aashutoshrathi/word-wrap/index.d.ts
immosquare-cleaner-0.1.12 node_modules/@aashutoshrathi/word-wrap/index.d.ts