import { PlainTextEncoderOptions } from '../index'; export declare const strings: { /** * @param [encodeHtml] defaults to true */ nl2br(text: string, encodeHtml?: boolean): string; insertAt(text: string, insertText: string, position: number): string; /** * @returns true if the given string contains any non-space characters */ hasText(text: string): boolean; /** * Inverse operation of hasText(string). Used because empty(s) is more readable than !hasText(s). * @returns true if the given string is not set or contains only white-space characters. */ empty(text: string): boolean; repeat(pattern: string, count: number): string; padZeroLeft(string: string | number, padding: number): string; contains(string: string, searchFor: string): boolean; startsWith(fullString: string, startString: string): boolean; endsWith(fullString: string, endString: string): boolean; /** * Returns the number of occurrences of 'separator' in 'string' */ count(string: string, separator: string): number; /** * Returns the HTML encoded text. If the text is falsy, the input value is returned. * * Example: 'Foo<br>Bar' returns 'Foo<br>Bar'. * * @param text text to encode * @returns HTML encoded text */ encode(text: string): string; /** * Returns the plain text of the given html string using simple tag replacement.
* Tries to preserve the new lines. Since it does not consider the style, it won't be right in any cases.
* A div for example always generates a new line, even if display style is not set to block.
*/
plainText(text: string, options?: PlainTextEncoderOptions): string;
/**
* Joins a list of strings to a single string using the given separator. Elements that are
* not defined or have zero length are ignored. The default return value is the empty string.
*
* @param separator String to use as separator
* @param args list of strings to join. Can be an array or individual arguments
*/
join(separator: string, ...args: string[]): string;
/**
* If the given 'string' has text, it is returned with the 'prefix' and 'suffix'
* prepended and appended, respectively. Otherwise, the empty string is returned.
*/
box(prefix: string, string: string, suffix?: string): string;
/**
* Quotes a string for use in a regular expression, i.e. escapes all characters with special meaning.
*/
quote(string: string): string;
/**
* If the given input is not of type string, it is converted to a string (using the standard
* JavaScript "String()" function). Inputs 'null' and 'undefined' are returned as they are.
*/
asString(input: any): string;
/**
* This is a shortcut for scout.nvl(string, '').
* @param string String to check
* @returns Empty string '' when given string is null or undefined.
*/
nvl(string: string): string;
/**
* Null-safe version of String.prototype.length.
* If the argument is null or undefined, 0 will be returned.
* A non-string argument will be converted to a string.
*/
length(string: string): number;
/**
* Null-safe version of String.prototype.trim.
* If the argument is null or undefined, the same value will be returned.
* A non-string argument will be converted to a string.
*/
trim(string: string): string;
/**
* Null-safe version of String.prototype.toUpperCase.
* If the argument is null or undefined, the same value will be returned.
* A non-string argument will be converted to a string.
*/
toUpperCase(string: string): string;
/**
* Null-safe version of String.prototype.toLowerCase.
* If the argument is null or undefined, the same value will be returned.
* A non-string argument will be converted to a string.
*/
toLowerCase(string: string): string;
/**
* Returns the given string, with the first character converted to upper case and the remainder unchanged.
* If the argument is null or undefined, the same value will be returned.
* A non-string argument will be converted to a string.
*/
toUpperCaseFirstLetter(string: string): string;
/**
* Returns the given string, with the first character converted to lower case and the remainder unchanged.
* If the argument is null or undefined, the same value will be returned.
* A non-string argument will be converted to a string.
*/
toLowerCaseFirstLetter(string: string): string;
/**
* Returns the number of unicode characters in the given string.
* As opposed to the string.length property, astral symbols are
* counted as one single character.
*
* Example: '\uD83D\uDC4D'.length returns 2, whereas
* countCodePoints('\uD83D\uDC4D') returns 1.
*
* (\uD83D\uDC4D = unicode character U+1F44D 'THUMBS UP SIGN')
*/
countCodePoints(string: string): number;
/**
* Splits the given 'string' at 'separator' while returning at most 'limit' elements.
* Unlike String.prototype.split(), this function does not discard elements if more than
* 'limit' elements are found. Instead, the surplus elements are joined with the last element.
*
* Example:
*