Options
All
  • Public
  • Public/Protected
  • All
Menu

Preferences to pass to the TextWrapper constructor to control its behavior. All choices are optional. See default values in DEF_WRAP_OPTIONS.

Hierarchy

  • WrapOptions

Implemented by

Index

Properties

Optional allowedExceedingCharacters

allowedExceedingCharacters: RegExp

This determines which characters are allowed to exceed the limitation (after wrapOn value). By default, this has been set to /\s/ to allow any white-space character. new-line-character ('\n') will be ignored, anyway.

Note: This RegExp will be tested against only a single character (each time)!

Optional breakableCharacters

breakableCharacters: RegExp

Long lines don't break at any where the length is exceeded. But it occurs only on word-boundaries by default. So this options has been set to /[^\w\xA0]/ to be broken on any non-word character (/^\w/ === /[^a-zA-Z0-9_]/) except a special white-space character named non-breakable space ('\xA0').

Note: This RegExp will be tested against only a single character (each time)!

Optional continuationIndent

continuationIndent: undefined | string

This value will be added after each line-break ('\n') character that this tool adds to the text. So it appears in the leading of each new line (not the already-present lines).

Optional tabLength

tabLength: undefined | number

This determines the max-length that should be considered for tab-characters ('\t'). Notice that the length of each tab-character is depended on its location in its line. For example if this option is set to 4, then the length of '\tA' will appear 5 and the length of 'A\t' will appear 4.

see

visual (virtual) length: vLen

Optional wrapOn

wrapOn: undefined | number

This is the most common option. It determines the maximum allowed length of each line. The words exceed this rule will go to the next line. There are some configurable options to say the program how does this work:

  1. Allowed characters for exceeding the limitation (by default: white-spaces): allowedExceedingCharacters
  2. Word-boundaries: breakableCharacters
  3. Tab-character length: tabLength
  4. The indents to be inserted in the leading of each newly created line: continuationIndent

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc