Sha256: 14e27c8804ce2fe36fe1cfdbea2c0625cb97f4c20394fa9973567fb09cc03406

Contents?: true

Size: 1.21 KB

Versions: 34

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 ´  ´ (two spaces)
         */
        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

34 entries across 34 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.68 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.67 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.66 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.65 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.64 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.63 node_modules/word-wrap/index.d.ts
rapid_stack-0.2.0 templates/frontend/node_modules/word-wrap/index.d.ts
rapid_stack-0.1.1 templates/FrontEnd/node_modules/word-wrap/index.d.ts
rapid_stack-0.1.0 templates/FrontEnd/node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.62 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.61 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.60 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.59 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.58 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.57 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.56 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.55 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.54 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.53 node_modules/word-wrap/index.d.ts
immosquare-cleaner-0.1.52 node_modules/word-wrap/index.d.ts