import { CaseSensitivityBasic, CharacterEncoding, CharacterEncodingBasic, HashAlgorithm, HashAlgorithmBasic } from '../common'; /** * Convert a string to base 64 representation. * @param text The text to encode to base64 representation. * @param textEncoding The character encoding of the input text (default = UTF-8). * * @returns The text string encoded to base64 representation. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function base64Encode(text: string, textEncoding?: CharacterEncoding | CharacterEncodingBasic | E | EB): string; /** * Convert a string from base 64 representation. * @param text The text to decode from base64 representation. * @param outputEncoding The character encoding of the output text (default = UTF-8). * * @returns The text string decoded from base64 representation. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function base64Decode(text: string, outputEncoding?: CharacterEncoding | CharacterEncodingBasic | E | EB): string; /** * Determine if a string contains at least one occurrence of a search term. * @param text The string to search. * @param search The search term. * @param caseSensitivity Search term case sensitivity. * * @returns True if the search term is found at least once. False otherwise. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function containsBasic(text: string, search: string, caseSensitivity?: CaseSensitivityBasic | C): boolean; /** * Find occurrences of a search term in a string and returns an array of all indices where the search term is located. * @param text The string to search. * @param search The search term. * @param caseSensitivity Search term case sensitivity. * * @returns An array of all indices where the search term is located. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function matchBasic(text: string, search: string, caseSensitivity?: CaseSensitivityBasic | C): number[]; /** * Find occurrences of a search term in a string and replaces each occurrence with another string. * @param text The string to search. * @param search The search term. * @param caseSensitivity Search term case sensitivity. * @param replacement The replacement value. * * @returns The input string with each occurrence of the search term replaced with the replacement string up to the replacement limit, if specified. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function replaceBasic(text: string, search: string, caseSensitivity?: CaseSensitivityBasic | C, replacement?: string): string; /** * Find occurrences a delimiter in a string and splits the string into an array of substrings for each occurrence. * @param text The string to search. * @param delimiter The delimiter with which to split the string. * * @returns An array of strings containing the segments of the input string that were split on each matching occurrence of the search term up to the split limit, if specified * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function split(text: string, delimiter: string): string[]; /** * Replaces and/or surrounds certain characters in a string to render it unactionable (e.g. non-clickable). * @param text The string to defang. * * @returns The defanged input string. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function defang(text: string): string; /** * Restore a defanged string to its original value to re-render it actionable (e.g. clickable). * @param text The string to refang. * * @returns The refanged input string. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function refang(text: string): string; /** * Convert stringified JSON text to a JSON value. * @param text The stringified text to convert to a JSON value. * * @returns A JSON value obtained by parsing the stringified input text. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function jsonParse(text: string): object; /** * Convert URL-unsafe characters in a given string to URL-safe characters. * @param text The string to URL encode. * * @returns An output string that is URL encoded. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function urlEncode(text: string): string; /** * Convert URL-safe characters in a given string to URL-unsafe characters. * @param text The string to URL decode. * * @returns An output string that is URL decoded. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function urlDecode(text: string): string; /** * Find the edit/Levenshtein distance between two strings. * @param source The source string. * @param target The target string. * * @returns A Value indicating edit/Levenshtein distance between two strings. * * @throws `InputRequiredError` "" is a required input but was not provided */ export declare function levenshteinDistance(source: string, target: string): number; /** * Remove all whitespace (tabs, spaces, and newlines) from both the left and right side of text. Spaces in between * words will not be removed. * @param source The string to trim. * * @returns The input string stripped of whitespace from both its beginning and end. * */ export declare function strip(source: string): string; /** * Generate a v4 universally unique identifier (UUID). * * @returns The unique identifier. */ export declare function uuidv4(): string; /** * Compute that hash of a value. * @param source The value to hash. * @param algorithm The hash algorithm. * * @returns The hashed value in hex. * * @throws `InvalidHashType` "" is not a valid hash type. */ export declare function hash(source: string, algorithm: HashAlgorithm | HashAlgorithmBasic | H | HB | string): string; /** * Pad a string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length. * @param source The string to pad. * @param length The padding length. * @param chars The string used as padding. * * @returns The padded string. * * @throws `InvalidNumberError` "" is not a valid number. */ export declare function pad(source: string, length: number | string, chars?: string): string; /** * Pad a string on the left side if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length. * @param source The string to pad. * @param length The padding length. * @param chars The string used as padding. * * @returns The padded string. * * @throws `InvalidNumberError` "" is not a valid number. */ export declare function padStart(source: string, length: number | string, chars?: string): string; /** * Pad a string on the right side if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length. * @param source The input string to pad. * @param length The padding length. * @param chars The string used as padding. * * @returns The padded string. * * @throws `InvalidNumberError` "" is not a valid number. */ export declare function padEnd(source: string, length: number | string, chars?: string): string; /** * Repeat a string N times. * @param source The string to repeat. * @param repeatNumber The number of times to repeat the string. * * @returns The repeated string. * * @throws `InvalidNumberError` "" is not a valid number. */ export declare function repeat(source: string, repeatNumber: number | string): string; /** * Convert a string to camel case. * @param source The string to convert. * * @returns The camel-cased input string. * */ export declare function camelCase(source: string): string; /** * Convert the first character of a string to upper case and the remaining to lower case. * @param source The string to convert. * * @returns The capitalized string. * */ export declare function capitalize(source: string): string; /** * Check if a string starts with another. * @param source The string to search. * @param target The search value. * * @returns True if the input string starts with the search string. False otherwise. */ export declare function startsWith(source: string, target: string): boolean; /** * Check if string ends with another. * @param source The string to search. * @param target The search value. * * @returns Returns true if string ends with target, else false. */ export declare function endsWith(source: string, target: string): boolean; /** * Parse and evaluate a string containing literal JSON or a JSONata expression. * @param expr Expression to evaluate. * @param data Data to use when evaluating the expression. * * @returns The result of the evaluation. * */ export declare function evalExpression(expr: string, data?: unknown): Promise;